Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
24
node_modules/eslint/lib/rules/radix.js
generated
vendored
24
node_modules/eslint/lib/rules/radix.js
generated
vendored
|
|
@ -82,7 +82,7 @@ module.exports = {
|
|||
docs: {
|
||||
description: "Enforce the consistent use of the radix argument when using `parseInt()`",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/rules/radix"
|
||||
url: "https://eslint.org/docs/latest/rules/radix"
|
||||
},
|
||||
|
||||
hasSuggestions: true,
|
||||
|
|
@ -104,6 +104,7 @@ module.exports = {
|
|||
|
||||
create(context) {
|
||||
const mode = context.options[0] || MODE_ALWAYS;
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
/**
|
||||
* Checks the arguments of a given CallExpression node and reports it if it
|
||||
|
|
@ -131,7 +132,6 @@ module.exports = {
|
|||
{
|
||||
messageId: "addRadixParameter10",
|
||||
fix(fixer) {
|
||||
const sourceCode = context.getSourceCode();
|
||||
const tokens = sourceCode.getTokens(node);
|
||||
const lastToken = tokens[tokens.length - 1]; // Parenthesis.
|
||||
const secondToLastToken = tokens[tokens.length - 2]; // May or may not be a comma.
|
||||
|
|
@ -162,18 +162,18 @@ module.exports = {
|
|||
}
|
||||
|
||||
return {
|
||||
"Program:exit"() {
|
||||
const scope = context.getScope();
|
||||
"Program:exit"(node) {
|
||||
const scope = sourceCode.getScope(node);
|
||||
let variable;
|
||||
|
||||
// Check `parseInt()`
|
||||
variable = astUtils.getVariableByName(scope, "parseInt");
|
||||
if (variable && !isShadowed(variable)) {
|
||||
variable.references.forEach(reference => {
|
||||
const node = reference.identifier;
|
||||
const idNode = reference.identifier;
|
||||
|
||||
if (astUtils.isCallee(node)) {
|
||||
checkArguments(node.parent);
|
||||
if (astUtils.isCallee(idNode)) {
|
||||
checkArguments(idNode.parent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -182,12 +182,12 @@ module.exports = {
|
|||
variable = astUtils.getVariableByName(scope, "Number");
|
||||
if (variable && !isShadowed(variable)) {
|
||||
variable.references.forEach(reference => {
|
||||
const node = reference.identifier.parent;
|
||||
const maybeCallee = node.parent.type === "ChainExpression"
|
||||
? node.parent
|
||||
: node;
|
||||
const parentNode = reference.identifier.parent;
|
||||
const maybeCallee = parentNode.parent.type === "ChainExpression"
|
||||
? parentNode.parent
|
||||
: parentNode;
|
||||
|
||||
if (isParseIntMethod(node) && astUtils.isCallee(maybeCallee)) {
|
||||
if (isParseIntMethod(parentNode) && astUtils.isCallee(maybeCallee)) {
|
||||
checkArguments(maybeCallee.parent);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue