MCPcopy Index your code
hub / github.com/nodejs/node / create

Function create

tools/eslint-rules/documented-errors.js:63–85  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

61// Main rule export
62module.exports = {
63 create(context) {
64 const { errors, legacyErrors } = getErrorsInDoc();
65 return {
66 ExpressionStatement(node) {
67 if (!isDefiningError(node)) return;
68
69 const code = node.expression.arguments?.[0]?.value;
70 if (!code) return;
71
72 if (legacyErrors.has(code)) {
73 context.report({
74 node,
75 message: `"${code}" is marked as legacy, yet it is used in lib/.`,
76 });
77 } else if (!errors.has(code)) {
78 context.report({
79 node,
80 message: `"${code}" is not documented in doc/api/errors.md`,
81 });
82 }
83 },
84 };
85 },
86};

Callers

nothing calls this directly

Calls 1

getErrorsInDocFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…