| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/share/node_modules/@babel/eslint-plugin-development/lib/rules/ |
Upload File : |
const getReferenceOrigin = require("../utils/get-reference-origin.cjs");
const isFromBabelTypes = require("../utils/is-from-babel-types.cjs");
function firstArgumentIsUndefinedString(argumentsArray) {
return argumentsArray.length > 0 && argumentsArray[0].type === "Literal" && argumentsArray[0].value === "undefined";
}
module.exports = {
meta: {
schema: []
},
create(context) {
return {
CallExpression(node) {
const {
callee
} = node;
const scope = context.getScope();
const origin = getReferenceOrigin(callee, scope);
if (!origin) return;
const {
name
} = origin;
if ((name === "identifier" || name === "Identifier") && firstArgumentIsUndefinedString(node.arguments) && isFromBabelTypes(origin, scope)) {
context.report(node, "Use path.scope.buildUndefinedNode() to create an undefined identifier directly.");
}
}
};
}
};
//# sourceMappingURL=no-undefined-identifier.cjs.map