Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
260
node_modules/eslint-utils/index.js
generated
vendored
260
node_modules/eslint-utils/index.js
generated
vendored
|
|
@ -80,13 +80,23 @@ function negate(f) {
|
|||
return negate0.bind(f)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given token is a PunctuatorToken with the given value
|
||||
* @param {Token} token - The token to check.
|
||||
* @param {string} value - The value to check.
|
||||
* @returns {boolean} `true` if the token is a PunctuatorToken with the given value.
|
||||
*/
|
||||
function isPunctuatorTokenWithValue(token, value) {
|
||||
return token.type === "Punctuator" && token.value === value
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given token is an arrow token or not.
|
||||
* @param {Token} token - The token to check.
|
||||
* @returns {boolean} `true` if the token is an arrow token.
|
||||
*/
|
||||
function isArrowToken(token) {
|
||||
return token.value === "=>" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "=>")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,7 +105,7 @@ function isArrowToken(token) {
|
|||
* @returns {boolean} `true` if the token is a comma token.
|
||||
*/
|
||||
function isCommaToken(token) {
|
||||
return token.value === "," && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ",")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,7 +114,7 @@ function isCommaToken(token) {
|
|||
* @returns {boolean} `true` if the token is a semicolon token.
|
||||
*/
|
||||
function isSemicolonToken(token) {
|
||||
return token.value === ";" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ";")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,7 +123,7 @@ function isSemicolonToken(token) {
|
|||
* @returns {boolean} `true` if the token is a colon token.
|
||||
*/
|
||||
function isColonToken(token) {
|
||||
return token.value === ":" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ":")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -122,7 +132,7 @@ function isColonToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening parenthesis token.
|
||||
*/
|
||||
function isOpeningParenToken(token) {
|
||||
return token.value === "(" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "(")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,7 +141,7 @@ function isOpeningParenToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing parenthesis token.
|
||||
*/
|
||||
function isClosingParenToken(token) {
|
||||
return token.value === ")" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ")")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -140,7 +150,7 @@ function isClosingParenToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening square bracket token.
|
||||
*/
|
||||
function isOpeningBracketToken(token) {
|
||||
return token.value === "[" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "[")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +159,7 @@ function isOpeningBracketToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing square bracket token.
|
||||
*/
|
||||
function isClosingBracketToken(token) {
|
||||
return token.value === "]" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "]")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -158,7 +168,7 @@ function isClosingBracketToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening brace token.
|
||||
*/
|
||||
function isOpeningBraceToken(token) {
|
||||
return token.value === "{" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "{")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -167,7 +177,7 @@ function isOpeningBraceToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing brace token.
|
||||
*/
|
||||
function isClosingBraceToken(token) {
|
||||
return token.value === "}" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "}")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -176,11 +186,7 @@ function isClosingBraceToken(token) {
|
|||
* @returns {boolean} `true` if the token is a comment token.
|
||||
*/
|
||||
function isCommentToken(token) {
|
||||
return (
|
||||
token.type === "Line" ||
|
||||
token.type === "Block" ||
|
||||
token.type === "Shebang"
|
||||
)
|
||||
return ["Block", "Line", "Shebang"].includes(token.type)
|
||||
}
|
||||
|
||||
const isNotArrowToken = negate(isArrowToken);
|
||||
|
|
@ -225,7 +231,8 @@ function getFunctionHeadLocation(node, sourceCode) {
|
|||
end = arrowToken.loc.end;
|
||||
} else if (
|
||||
parent.type === "Property" ||
|
||||
parent.type === "MethodDefinition"
|
||||
parent.type === "MethodDefinition" ||
|
||||
parent.type === "PropertyDefinition"
|
||||
) {
|
||||
start = parent.loc.start;
|
||||
end = getOpeningParenOfParams(node, sourceCode).loc.start;
|
||||
|
|
@ -235,12 +242,12 @@ function getFunctionHeadLocation(node, sourceCode) {
|
|||
}
|
||||
|
||||
return {
|
||||
start: Object.assign({}, start),
|
||||
end: Object.assign({}, end),
|
||||
start: { ...start },
|
||||
end: { ...end },
|
||||
}
|
||||
}
|
||||
|
||||
/* globals BigInt, globalThis, global, self, window */
|
||||
/* globals globalThis, global, self, window */
|
||||
|
||||
const globalObject =
|
||||
typeof globalThis !== "undefined"
|
||||
|
|
@ -301,7 +308,7 @@ const builtinNames = Object.freeze(
|
|||
"unescape",
|
||||
"WeakMap",
|
||||
"WeakSet",
|
||||
])
|
||||
]),
|
||||
);
|
||||
const callAllowed = new Set(
|
||||
[
|
||||
|
|
@ -319,8 +326,8 @@ const callAllowed = new Set(
|
|||
isNaN,
|
||||
isPrototypeOf,
|
||||
...Object.getOwnPropertyNames(Math)
|
||||
.map(k => Math[k])
|
||||
.filter(f => typeof f === "function"),
|
||||
.map((k) => Math[k])
|
||||
.filter((f) => typeof f === "function"),
|
||||
Number,
|
||||
Number.isFinite,
|
||||
Number.isNaN,
|
||||
|
|
@ -341,11 +348,10 @@ const callAllowed = new Set(
|
|||
String.fromCharCode,
|
||||
String.fromCodePoint,
|
||||
String.raw,
|
||||
Symbol,
|
||||
Symbol.for,
|
||||
Symbol.keyFor,
|
||||
unescape,
|
||||
].filter(f => typeof f === "function")
|
||||
].filter((f) => typeof f === "function"),
|
||||
);
|
||||
const callPassThrough = new Set([
|
||||
Object.freeze,
|
||||
|
|
@ -490,6 +496,9 @@ const operations = Object.freeze({
|
|||
|
||||
if (args != null) {
|
||||
if (calleeNode.type === "MemberExpression") {
|
||||
if (calleeNode.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
const object = getStaticValueR(calleeNode.object, initialScope);
|
||||
if (object != null) {
|
||||
if (
|
||||
|
|
@ -498,9 +507,10 @@ const operations = Object.freeze({
|
|||
) {
|
||||
return { value: undefined, optional: true }
|
||||
}
|
||||
const property = calleeNode.computed
|
||||
? getStaticValueR(calleeNode.property, initialScope)
|
||||
: { value: calleeNode.property.name };
|
||||
const property = getStaticPropertyNameValue(
|
||||
calleeNode,
|
||||
initialScope,
|
||||
);
|
||||
|
||||
if (property != null) {
|
||||
const receiver = object.value;
|
||||
|
|
@ -607,14 +617,15 @@ const operations = Object.freeze({
|
|||
},
|
||||
|
||||
MemberExpression(node, initialScope) {
|
||||
if (node.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
const object = getStaticValueR(node.object, initialScope);
|
||||
if (object != null) {
|
||||
if (object.value == null && (object.optional || node.optional)) {
|
||||
return { value: undefined, optional: true }
|
||||
}
|
||||
const property = node.computed
|
||||
? getStaticValueR(node.property, initialScope)
|
||||
: { value: node.property.name };
|
||||
const property = getStaticPropertyNameValue(node, initialScope);
|
||||
|
||||
if (property != null && !isGetter(object.value, property.value)) {
|
||||
return { value: object.value[property.value] }
|
||||
|
|
@ -653,9 +664,10 @@ const operations = Object.freeze({
|
|||
if (propertyNode.kind !== "init") {
|
||||
return null
|
||||
}
|
||||
const key = propertyNode.computed
|
||||
? getStaticValueR(propertyNode.key, initialScope)
|
||||
: { value: propertyNode.key.name };
|
||||
const key = getStaticPropertyNameValue(
|
||||
propertyNode,
|
||||
initialScope,
|
||||
);
|
||||
const value = getStaticValueR(propertyNode.value, initialScope);
|
||||
if (key == null || value == null) {
|
||||
return null
|
||||
|
|
@ -667,7 +679,7 @@ const operations = Object.freeze({
|
|||
) {
|
||||
const argument = getStaticValueR(
|
||||
propertyNode.argument,
|
||||
initialScope
|
||||
initialScope,
|
||||
);
|
||||
if (argument == null) {
|
||||
return null
|
||||
|
|
@ -690,13 +702,13 @@ const operations = Object.freeze({
|
|||
const tag = getStaticValueR(node.tag, initialScope);
|
||||
const expressions = getElementValues(
|
||||
node.quasi.expressions,
|
||||
initialScope
|
||||
initialScope,
|
||||
);
|
||||
|
||||
if (tag != null && expressions != null) {
|
||||
const func = tag.value;
|
||||
const strings = node.quasi.quasis.map(q => q.value.cooked);
|
||||
strings.raw = node.quasi.quasis.map(q => q.value.raw);
|
||||
const strings = node.quasi.quasis.map((q) => q.value.cooked);
|
||||
strings.raw = node.quasi.quasis.map((q) => q.value.raw);
|
||||
|
||||
if (func === String.raw) {
|
||||
return { value: func(strings, ...expressions) }
|
||||
|
|
@ -763,6 +775,33 @@ function getStaticValueR(node, initialScope) {
|
|||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the static value of property name from a MemberExpression node or a Property node.
|
||||
* @param {Node} node The node to get.
|
||||
* @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
|
||||
* @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.
|
||||
*/
|
||||
function getStaticPropertyNameValue(node, initialScope) {
|
||||
const nameNode = node.type === "Property" ? node.key : node.property;
|
||||
|
||||
if (node.computed) {
|
||||
return getStaticValueR(nameNode, initialScope)
|
||||
}
|
||||
|
||||
if (nameNode.type === "Identifier") {
|
||||
return { value: nameNode.name }
|
||||
}
|
||||
|
||||
if (nameNode.type === "Literal") {
|
||||
if (nameNode.bigint) {
|
||||
return { value: nameNode.bigint }
|
||||
}
|
||||
return { value: String(nameNode.value) }
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a given node if it's a static value.
|
||||
* @param {Node} node The node to get.
|
||||
|
|
@ -810,16 +849,23 @@ function getPropertyName(node, initialScope) {
|
|||
if (node.computed) {
|
||||
return getStringIfConstant(node.property, initialScope)
|
||||
}
|
||||
if (node.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
return node.property.name
|
||||
|
||||
case "Property":
|
||||
case "MethodDefinition":
|
||||
case "PropertyDefinition":
|
||||
if (node.computed) {
|
||||
return getStringIfConstant(node.key, initialScope)
|
||||
}
|
||||
if (node.key.type === "Literal") {
|
||||
return String(node.key.value)
|
||||
}
|
||||
if (node.key.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
return node.key.name
|
||||
|
||||
// no default
|
||||
|
|
@ -831,14 +877,27 @@ function getPropertyName(node, initialScope) {
|
|||
/**
|
||||
* Get the name and kind of the given function node.
|
||||
* @param {ASTNode} node - The function node to get.
|
||||
* @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
|
||||
* @returns {string} The name and kind of the function node.
|
||||
*/
|
||||
function getFunctionNameWithKind(node) {
|
||||
// eslint-disable-next-line complexity
|
||||
function getFunctionNameWithKind(node, sourceCode) {
|
||||
const parent = node.parent;
|
||||
const tokens = [];
|
||||
const isObjectMethod = parent.type === "Property" && parent.value === node;
|
||||
const isClassMethod =
|
||||
parent.type === "MethodDefinition" && parent.value === node;
|
||||
const isClassFieldMethod =
|
||||
parent.type === "PropertyDefinition" && parent.value === node;
|
||||
|
||||
if (parent.type === "MethodDefinition" && parent.static) {
|
||||
tokens.push("static");
|
||||
// Modifiers.
|
||||
if (isClassMethod || isClassFieldMethod) {
|
||||
if (parent.static) {
|
||||
tokens.push("static");
|
||||
}
|
||||
if (parent.key.type === "PrivateIdentifier") {
|
||||
tokens.push("private");
|
||||
}
|
||||
}
|
||||
if (node.async) {
|
||||
tokens.push("async");
|
||||
|
|
@ -847,12 +906,8 @@ function getFunctionNameWithKind(node) {
|
|||
tokens.push("generator");
|
||||
}
|
||||
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
tokens.push("arrow", "function");
|
||||
} else if (
|
||||
parent.type === "Property" ||
|
||||
parent.type === "MethodDefinition"
|
||||
) {
|
||||
// Kinds.
|
||||
if (isObjectMethod || isClassMethod) {
|
||||
if (parent.kind === "constructor") {
|
||||
return "constructor"
|
||||
}
|
||||
|
|
@ -863,35 +918,45 @@ function getFunctionNameWithKind(node) {
|
|||
} else {
|
||||
tokens.push("method");
|
||||
}
|
||||
} else if (isClassFieldMethod) {
|
||||
tokens.push("method");
|
||||
} else {
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
tokens.push("arrow");
|
||||
}
|
||||
tokens.push("function");
|
||||
}
|
||||
|
||||
if (node.id) {
|
||||
// Names.
|
||||
if (isObjectMethod || isClassMethod || isClassFieldMethod) {
|
||||
if (parent.key.type === "PrivateIdentifier") {
|
||||
tokens.push(`#${parent.key.name}`);
|
||||
} else {
|
||||
const name = getPropertyName(parent);
|
||||
if (name) {
|
||||
tokens.push(`'${name}'`);
|
||||
} else if (sourceCode) {
|
||||
const keyText = sourceCode.getText(parent.key);
|
||||
if (!keyText.includes("\n")) {
|
||||
tokens.push(`[${keyText}]`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (node.id) {
|
||||
tokens.push(`'${node.id.name}'`);
|
||||
} else {
|
||||
const name = getPropertyName(parent);
|
||||
|
||||
if (name) {
|
||||
tokens.push(`'${name}'`);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
if (
|
||||
parent.type === "VariableDeclarator" &&
|
||||
parent.id &&
|
||||
parent.id.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.id.name}'`);
|
||||
}
|
||||
if (
|
||||
parent.type === "AssignmentExpression" &&
|
||||
parent.left &&
|
||||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
}
|
||||
} else if (
|
||||
parent.type === "VariableDeclarator" &&
|
||||
parent.id &&
|
||||
parent.id.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.id.name}'`);
|
||||
} else if (
|
||||
(parent.type === "AssignmentExpression" ||
|
||||
parent.type === "AssignmentPattern") &&
|
||||
parent.left &&
|
||||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
}
|
||||
|
||||
return tokens.join(" ")
|
||||
|
|
@ -917,7 +982,7 @@ const typeConversionBinaryOps = Object.freeze(
|
|||
"^",
|
||||
"&",
|
||||
"in",
|
||||
])
|
||||
]),
|
||||
);
|
||||
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));
|
||||
|
||||
|
|
@ -1032,6 +1097,16 @@ const visitor = Object.freeze(
|
|||
}
|
||||
return this.$visitChildren(node, options, visitorKeys)
|
||||
},
|
||||
PropertyDefinition(node, options, visitorKeys) {
|
||||
if (
|
||||
options.considerImplicitTypeConversion &&
|
||||
node.computed &&
|
||||
node.key.type !== "Literal"
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return this.$visitChildren(node, options, visitorKeys)
|
||||
},
|
||||
UnaryExpression(node, options, visitorKeys) {
|
||||
if (node.operator === "delete") {
|
||||
return true
|
||||
|
|
@ -1051,7 +1126,7 @@ const visitor = Object.freeze(
|
|||
YieldExpression() {
|
||||
return true
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -1067,12 +1142,12 @@ const visitor = Object.freeze(
|
|||
function hasSideEffect(
|
||||
node,
|
||||
sourceCode,
|
||||
{ considerGetters = false, considerImplicitTypeConversion = false } = {}
|
||||
{ considerGetters = false, considerImplicitTypeConversion = false } = {},
|
||||
) {
|
||||
return visitor.$visit(
|
||||
node,
|
||||
{ considerGetters, considerImplicitTypeConversion },
|
||||
sourceCode.visitorKeys || evk.KEYS
|
||||
sourceCode.visitorKeys || evk.KEYS,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1092,7 +1167,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
if (parent.arguments.length === 1 && parent.arguments[0] === node) {
|
||||
return sourceCode.getTokenAfter(
|
||||
parent.callee,
|
||||
isOpeningParenToken
|
||||
isOpeningParenToken,
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
|
@ -1101,7 +1176,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
if (parent.test === node) {
|
||||
return sourceCode.getTokenAfter(
|
||||
parent.body,
|
||||
isOpeningParenToken
|
||||
isOpeningParenToken,
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
|
@ -1152,7 +1227,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
function isParenthesized(
|
||||
timesOrNode,
|
||||
nodeOrSourceCode,
|
||||
optionalSourceCode
|
||||
optionalSourceCode,
|
||||
) {
|
||||
let times, node, sourceCode, maybeLeftParen, maybeRightParen;
|
||||
if (typeof timesOrNode === "number") {
|
||||
|
|
@ -1168,7 +1243,11 @@ function isParenthesized(
|
|||
sourceCode = nodeOrSourceCode;
|
||||
}
|
||||
|
||||
if (node == null) {
|
||||
if (
|
||||
node == null ||
|
||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -1368,7 +1447,7 @@ function isModifiedGlobal(variable) {
|
|||
return (
|
||||
variable == null ||
|
||||
variable.defs.length !== 0 ||
|
||||
variable.references.some(r => r.isWrite())
|
||||
variable.references.some((r) => r.isWrite())
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1412,7 +1491,7 @@ class ReferenceTracker {
|
|||
{
|
||||
mode = "strict",
|
||||
globalObjectNames = ["global", "globalThis", "self", "window"],
|
||||
} = {}
|
||||
} = {},
|
||||
) {
|
||||
this.variableStack = [];
|
||||
this.globalScope = globalScope;
|
||||
|
|
@ -1439,7 +1518,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
nextTraceMap,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1455,7 +1534,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1532,11 +1611,8 @@ class ReferenceTracker {
|
|||
esm
|
||||
? nextTraceMap
|
||||
: this.mode === "legacy"
|
||||
? Object.assign(
|
||||
{ default: nextTraceMap },
|
||||
nextTraceMap
|
||||
)
|
||||
: { default: nextTraceMap }
|
||||
? { default: nextTraceMap, ...nextTraceMap }
|
||||
: { default: nextTraceMap },
|
||||
);
|
||||
|
||||
if (esm) {
|
||||
|
|
@ -1622,7 +1698,7 @@ class ReferenceTracker {
|
|||
yield* this._iteratePropertyReferences(
|
||||
parent,
|
||||
path,
|
||||
nextTraceMap
|
||||
nextTraceMap,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1679,7 +1755,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1705,7 +1781,7 @@ class ReferenceTracker {
|
|||
yield* this._iterateLhsReferences(
|
||||
property.value,
|
||||
nextPath,
|
||||
nextTraceMap
|
||||
nextTraceMap,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1748,7 +1824,7 @@ class ReferenceTracker {
|
|||
findVariable(this.globalScope, specifierNode.local),
|
||||
path,
|
||||
nextTraceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return
|
||||
|
|
@ -1759,7 +1835,7 @@ class ReferenceTracker {
|
|||
findVariable(this.globalScope, specifierNode.local),
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
return
|
||||
}
|
||||
|
|
|
|||
2
node_modules/eslint-utils/index.js.map
generated
vendored
2
node_modules/eslint-utils/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
260
node_modules/eslint-utils/index.mjs
generated
vendored
260
node_modules/eslint-utils/index.mjs
generated
vendored
|
|
@ -74,13 +74,23 @@ function negate(f) {
|
|||
return negate0.bind(f)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given token is a PunctuatorToken with the given value
|
||||
* @param {Token} token - The token to check.
|
||||
* @param {string} value - The value to check.
|
||||
* @returns {boolean} `true` if the token is a PunctuatorToken with the given value.
|
||||
*/
|
||||
function isPunctuatorTokenWithValue(token, value) {
|
||||
return token.type === "Punctuator" && token.value === value
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given token is an arrow token or not.
|
||||
* @param {Token} token - The token to check.
|
||||
* @returns {boolean} `true` if the token is an arrow token.
|
||||
*/
|
||||
function isArrowToken(token) {
|
||||
return token.value === "=>" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "=>")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -89,7 +99,7 @@ function isArrowToken(token) {
|
|||
* @returns {boolean} `true` if the token is a comma token.
|
||||
*/
|
||||
function isCommaToken(token) {
|
||||
return token.value === "," && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ",")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -98,7 +108,7 @@ function isCommaToken(token) {
|
|||
* @returns {boolean} `true` if the token is a semicolon token.
|
||||
*/
|
||||
function isSemicolonToken(token) {
|
||||
return token.value === ";" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ";")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +117,7 @@ function isSemicolonToken(token) {
|
|||
* @returns {boolean} `true` if the token is a colon token.
|
||||
*/
|
||||
function isColonToken(token) {
|
||||
return token.value === ":" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ":")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -116,7 +126,7 @@ function isColonToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening parenthesis token.
|
||||
*/
|
||||
function isOpeningParenToken(token) {
|
||||
return token.value === "(" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "(")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -125,7 +135,7 @@ function isOpeningParenToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing parenthesis token.
|
||||
*/
|
||||
function isClosingParenToken(token) {
|
||||
return token.value === ")" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, ")")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -134,7 +144,7 @@ function isClosingParenToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening square bracket token.
|
||||
*/
|
||||
function isOpeningBracketToken(token) {
|
||||
return token.value === "[" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "[")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -143,7 +153,7 @@ function isOpeningBracketToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing square bracket token.
|
||||
*/
|
||||
function isClosingBracketToken(token) {
|
||||
return token.value === "]" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "]")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -152,7 +162,7 @@ function isClosingBracketToken(token) {
|
|||
* @returns {boolean} `true` if the token is an opening brace token.
|
||||
*/
|
||||
function isOpeningBraceToken(token) {
|
||||
return token.value === "{" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "{")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -161,7 +171,7 @@ function isOpeningBraceToken(token) {
|
|||
* @returns {boolean} `true` if the token is a closing brace token.
|
||||
*/
|
||||
function isClosingBraceToken(token) {
|
||||
return token.value === "}" && token.type === "Punctuator"
|
||||
return isPunctuatorTokenWithValue(token, "}")
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -170,11 +180,7 @@ function isClosingBraceToken(token) {
|
|||
* @returns {boolean} `true` if the token is a comment token.
|
||||
*/
|
||||
function isCommentToken(token) {
|
||||
return (
|
||||
token.type === "Line" ||
|
||||
token.type === "Block" ||
|
||||
token.type === "Shebang"
|
||||
)
|
||||
return ["Block", "Line", "Shebang"].includes(token.type)
|
||||
}
|
||||
|
||||
const isNotArrowToken = negate(isArrowToken);
|
||||
|
|
@ -219,7 +225,8 @@ function getFunctionHeadLocation(node, sourceCode) {
|
|||
end = arrowToken.loc.end;
|
||||
} else if (
|
||||
parent.type === "Property" ||
|
||||
parent.type === "MethodDefinition"
|
||||
parent.type === "MethodDefinition" ||
|
||||
parent.type === "PropertyDefinition"
|
||||
) {
|
||||
start = parent.loc.start;
|
||||
end = getOpeningParenOfParams(node, sourceCode).loc.start;
|
||||
|
|
@ -229,12 +236,12 @@ function getFunctionHeadLocation(node, sourceCode) {
|
|||
}
|
||||
|
||||
return {
|
||||
start: Object.assign({}, start),
|
||||
end: Object.assign({}, end),
|
||||
start: { ...start },
|
||||
end: { ...end },
|
||||
}
|
||||
}
|
||||
|
||||
/* globals BigInt, globalThis, global, self, window */
|
||||
/* globals globalThis, global, self, window */
|
||||
|
||||
const globalObject =
|
||||
typeof globalThis !== "undefined"
|
||||
|
|
@ -295,7 +302,7 @@ const builtinNames = Object.freeze(
|
|||
"unescape",
|
||||
"WeakMap",
|
||||
"WeakSet",
|
||||
])
|
||||
]),
|
||||
);
|
||||
const callAllowed = new Set(
|
||||
[
|
||||
|
|
@ -313,8 +320,8 @@ const callAllowed = new Set(
|
|||
isNaN,
|
||||
isPrototypeOf,
|
||||
...Object.getOwnPropertyNames(Math)
|
||||
.map(k => Math[k])
|
||||
.filter(f => typeof f === "function"),
|
||||
.map((k) => Math[k])
|
||||
.filter((f) => typeof f === "function"),
|
||||
Number,
|
||||
Number.isFinite,
|
||||
Number.isNaN,
|
||||
|
|
@ -335,11 +342,10 @@ const callAllowed = new Set(
|
|||
String.fromCharCode,
|
||||
String.fromCodePoint,
|
||||
String.raw,
|
||||
Symbol,
|
||||
Symbol.for,
|
||||
Symbol.keyFor,
|
||||
unescape,
|
||||
].filter(f => typeof f === "function")
|
||||
].filter((f) => typeof f === "function"),
|
||||
);
|
||||
const callPassThrough = new Set([
|
||||
Object.freeze,
|
||||
|
|
@ -484,6 +490,9 @@ const operations = Object.freeze({
|
|||
|
||||
if (args != null) {
|
||||
if (calleeNode.type === "MemberExpression") {
|
||||
if (calleeNode.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
const object = getStaticValueR(calleeNode.object, initialScope);
|
||||
if (object != null) {
|
||||
if (
|
||||
|
|
@ -492,9 +501,10 @@ const operations = Object.freeze({
|
|||
) {
|
||||
return { value: undefined, optional: true }
|
||||
}
|
||||
const property = calleeNode.computed
|
||||
? getStaticValueR(calleeNode.property, initialScope)
|
||||
: { value: calleeNode.property.name };
|
||||
const property = getStaticPropertyNameValue(
|
||||
calleeNode,
|
||||
initialScope,
|
||||
);
|
||||
|
||||
if (property != null) {
|
||||
const receiver = object.value;
|
||||
|
|
@ -601,14 +611,15 @@ const operations = Object.freeze({
|
|||
},
|
||||
|
||||
MemberExpression(node, initialScope) {
|
||||
if (node.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
const object = getStaticValueR(node.object, initialScope);
|
||||
if (object != null) {
|
||||
if (object.value == null && (object.optional || node.optional)) {
|
||||
return { value: undefined, optional: true }
|
||||
}
|
||||
const property = node.computed
|
||||
? getStaticValueR(node.property, initialScope)
|
||||
: { value: node.property.name };
|
||||
const property = getStaticPropertyNameValue(node, initialScope);
|
||||
|
||||
if (property != null && !isGetter(object.value, property.value)) {
|
||||
return { value: object.value[property.value] }
|
||||
|
|
@ -647,9 +658,10 @@ const operations = Object.freeze({
|
|||
if (propertyNode.kind !== "init") {
|
||||
return null
|
||||
}
|
||||
const key = propertyNode.computed
|
||||
? getStaticValueR(propertyNode.key, initialScope)
|
||||
: { value: propertyNode.key.name };
|
||||
const key = getStaticPropertyNameValue(
|
||||
propertyNode,
|
||||
initialScope,
|
||||
);
|
||||
const value = getStaticValueR(propertyNode.value, initialScope);
|
||||
if (key == null || value == null) {
|
||||
return null
|
||||
|
|
@ -661,7 +673,7 @@ const operations = Object.freeze({
|
|||
) {
|
||||
const argument = getStaticValueR(
|
||||
propertyNode.argument,
|
||||
initialScope
|
||||
initialScope,
|
||||
);
|
||||
if (argument == null) {
|
||||
return null
|
||||
|
|
@ -684,13 +696,13 @@ const operations = Object.freeze({
|
|||
const tag = getStaticValueR(node.tag, initialScope);
|
||||
const expressions = getElementValues(
|
||||
node.quasi.expressions,
|
||||
initialScope
|
||||
initialScope,
|
||||
);
|
||||
|
||||
if (tag != null && expressions != null) {
|
||||
const func = tag.value;
|
||||
const strings = node.quasi.quasis.map(q => q.value.cooked);
|
||||
strings.raw = node.quasi.quasis.map(q => q.value.raw);
|
||||
const strings = node.quasi.quasis.map((q) => q.value.cooked);
|
||||
strings.raw = node.quasi.quasis.map((q) => q.value.raw);
|
||||
|
||||
if (func === String.raw) {
|
||||
return { value: func(strings, ...expressions) }
|
||||
|
|
@ -757,6 +769,33 @@ function getStaticValueR(node, initialScope) {
|
|||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the static value of property name from a MemberExpression node or a Property node.
|
||||
* @param {Node} node The node to get.
|
||||
* @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
|
||||
* @returns {{value:any}|{value:undefined,optional?:true}|null} The static value of the property name of the node, or `null`.
|
||||
*/
|
||||
function getStaticPropertyNameValue(node, initialScope) {
|
||||
const nameNode = node.type === "Property" ? node.key : node.property;
|
||||
|
||||
if (node.computed) {
|
||||
return getStaticValueR(nameNode, initialScope)
|
||||
}
|
||||
|
||||
if (nameNode.type === "Identifier") {
|
||||
return { value: nameNode.name }
|
||||
}
|
||||
|
||||
if (nameNode.type === "Literal") {
|
||||
if (nameNode.bigint) {
|
||||
return { value: nameNode.bigint }
|
||||
}
|
||||
return { value: String(nameNode.value) }
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a given node if it's a static value.
|
||||
* @param {Node} node The node to get.
|
||||
|
|
@ -804,16 +843,23 @@ function getPropertyName(node, initialScope) {
|
|||
if (node.computed) {
|
||||
return getStringIfConstant(node.property, initialScope)
|
||||
}
|
||||
if (node.property.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
return node.property.name
|
||||
|
||||
case "Property":
|
||||
case "MethodDefinition":
|
||||
case "PropertyDefinition":
|
||||
if (node.computed) {
|
||||
return getStringIfConstant(node.key, initialScope)
|
||||
}
|
||||
if (node.key.type === "Literal") {
|
||||
return String(node.key.value)
|
||||
}
|
||||
if (node.key.type === "PrivateIdentifier") {
|
||||
return null
|
||||
}
|
||||
return node.key.name
|
||||
|
||||
// no default
|
||||
|
|
@ -825,14 +871,27 @@ function getPropertyName(node, initialScope) {
|
|||
/**
|
||||
* Get the name and kind of the given function node.
|
||||
* @param {ASTNode} node - The function node to get.
|
||||
* @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
|
||||
* @returns {string} The name and kind of the function node.
|
||||
*/
|
||||
function getFunctionNameWithKind(node) {
|
||||
// eslint-disable-next-line complexity
|
||||
function getFunctionNameWithKind(node, sourceCode) {
|
||||
const parent = node.parent;
|
||||
const tokens = [];
|
||||
const isObjectMethod = parent.type === "Property" && parent.value === node;
|
||||
const isClassMethod =
|
||||
parent.type === "MethodDefinition" && parent.value === node;
|
||||
const isClassFieldMethod =
|
||||
parent.type === "PropertyDefinition" && parent.value === node;
|
||||
|
||||
if (parent.type === "MethodDefinition" && parent.static) {
|
||||
tokens.push("static");
|
||||
// Modifiers.
|
||||
if (isClassMethod || isClassFieldMethod) {
|
||||
if (parent.static) {
|
||||
tokens.push("static");
|
||||
}
|
||||
if (parent.key.type === "PrivateIdentifier") {
|
||||
tokens.push("private");
|
||||
}
|
||||
}
|
||||
if (node.async) {
|
||||
tokens.push("async");
|
||||
|
|
@ -841,12 +900,8 @@ function getFunctionNameWithKind(node) {
|
|||
tokens.push("generator");
|
||||
}
|
||||
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
tokens.push("arrow", "function");
|
||||
} else if (
|
||||
parent.type === "Property" ||
|
||||
parent.type === "MethodDefinition"
|
||||
) {
|
||||
// Kinds.
|
||||
if (isObjectMethod || isClassMethod) {
|
||||
if (parent.kind === "constructor") {
|
||||
return "constructor"
|
||||
}
|
||||
|
|
@ -857,35 +912,45 @@ function getFunctionNameWithKind(node) {
|
|||
} else {
|
||||
tokens.push("method");
|
||||
}
|
||||
} else if (isClassFieldMethod) {
|
||||
tokens.push("method");
|
||||
} else {
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
tokens.push("arrow");
|
||||
}
|
||||
tokens.push("function");
|
||||
}
|
||||
|
||||
if (node.id) {
|
||||
// Names.
|
||||
if (isObjectMethod || isClassMethod || isClassFieldMethod) {
|
||||
if (parent.key.type === "PrivateIdentifier") {
|
||||
tokens.push(`#${parent.key.name}`);
|
||||
} else {
|
||||
const name = getPropertyName(parent);
|
||||
if (name) {
|
||||
tokens.push(`'${name}'`);
|
||||
} else if (sourceCode) {
|
||||
const keyText = sourceCode.getText(parent.key);
|
||||
if (!keyText.includes("\n")) {
|
||||
tokens.push(`[${keyText}]`);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (node.id) {
|
||||
tokens.push(`'${node.id.name}'`);
|
||||
} else {
|
||||
const name = getPropertyName(parent);
|
||||
|
||||
if (name) {
|
||||
tokens.push(`'${name}'`);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.type === "ArrowFunctionExpression") {
|
||||
if (
|
||||
parent.type === "VariableDeclarator" &&
|
||||
parent.id &&
|
||||
parent.id.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.id.name}'`);
|
||||
}
|
||||
if (
|
||||
parent.type === "AssignmentExpression" &&
|
||||
parent.left &&
|
||||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
}
|
||||
} else if (
|
||||
parent.type === "VariableDeclarator" &&
|
||||
parent.id &&
|
||||
parent.id.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.id.name}'`);
|
||||
} else if (
|
||||
(parent.type === "AssignmentExpression" ||
|
||||
parent.type === "AssignmentPattern") &&
|
||||
parent.left &&
|
||||
parent.left.type === "Identifier"
|
||||
) {
|
||||
tokens.push(`'${parent.left.name}'`);
|
||||
}
|
||||
|
||||
return tokens.join(" ")
|
||||
|
|
@ -911,7 +976,7 @@ const typeConversionBinaryOps = Object.freeze(
|
|||
"^",
|
||||
"&",
|
||||
"in",
|
||||
])
|
||||
]),
|
||||
);
|
||||
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));
|
||||
|
||||
|
|
@ -1026,6 +1091,16 @@ const visitor = Object.freeze(
|
|||
}
|
||||
return this.$visitChildren(node, options, visitorKeys)
|
||||
},
|
||||
PropertyDefinition(node, options, visitorKeys) {
|
||||
if (
|
||||
options.considerImplicitTypeConversion &&
|
||||
node.computed &&
|
||||
node.key.type !== "Literal"
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return this.$visitChildren(node, options, visitorKeys)
|
||||
},
|
||||
UnaryExpression(node, options, visitorKeys) {
|
||||
if (node.operator === "delete") {
|
||||
return true
|
||||
|
|
@ -1045,7 +1120,7 @@ const visitor = Object.freeze(
|
|||
YieldExpression() {
|
||||
return true
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -1061,12 +1136,12 @@ const visitor = Object.freeze(
|
|||
function hasSideEffect(
|
||||
node,
|
||||
sourceCode,
|
||||
{ considerGetters = false, considerImplicitTypeConversion = false } = {}
|
||||
{ considerGetters = false, considerImplicitTypeConversion = false } = {},
|
||||
) {
|
||||
return visitor.$visit(
|
||||
node,
|
||||
{ considerGetters, considerImplicitTypeConversion },
|
||||
sourceCode.visitorKeys || evk.KEYS
|
||||
sourceCode.visitorKeys || evk.KEYS,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1086,7 +1161,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
if (parent.arguments.length === 1 && parent.arguments[0] === node) {
|
||||
return sourceCode.getTokenAfter(
|
||||
parent.callee,
|
||||
isOpeningParenToken
|
||||
isOpeningParenToken,
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
|
@ -1095,7 +1170,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
if (parent.test === node) {
|
||||
return sourceCode.getTokenAfter(
|
||||
parent.body,
|
||||
isOpeningParenToken
|
||||
isOpeningParenToken,
|
||||
)
|
||||
}
|
||||
return null
|
||||
|
|
@ -1146,7 +1221,7 @@ function getParentSyntaxParen(node, sourceCode) {
|
|||
function isParenthesized(
|
||||
timesOrNode,
|
||||
nodeOrSourceCode,
|
||||
optionalSourceCode
|
||||
optionalSourceCode,
|
||||
) {
|
||||
let times, node, sourceCode, maybeLeftParen, maybeRightParen;
|
||||
if (typeof timesOrNode === "number") {
|
||||
|
|
@ -1162,7 +1237,11 @@ function isParenthesized(
|
|||
sourceCode = nodeOrSourceCode;
|
||||
}
|
||||
|
||||
if (node == null) {
|
||||
if (
|
||||
node == null ||
|
||||
// `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
|
||||
(node.parent.type === "CatchClause" && node.parent.param === node)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
@ -1362,7 +1441,7 @@ function isModifiedGlobal(variable) {
|
|||
return (
|
||||
variable == null ||
|
||||
variable.defs.length !== 0 ||
|
||||
variable.references.some(r => r.isWrite())
|
||||
variable.references.some((r) => r.isWrite())
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -1406,7 +1485,7 @@ class ReferenceTracker {
|
|||
{
|
||||
mode = "strict",
|
||||
globalObjectNames = ["global", "globalThis", "self", "window"],
|
||||
} = {}
|
||||
} = {},
|
||||
) {
|
||||
this.variableStack = [];
|
||||
this.globalScope = globalScope;
|
||||
|
|
@ -1433,7 +1512,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
nextTraceMap,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -1449,7 +1528,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1526,11 +1605,8 @@ class ReferenceTracker {
|
|||
esm
|
||||
? nextTraceMap
|
||||
: this.mode === "legacy"
|
||||
? Object.assign(
|
||||
{ default: nextTraceMap },
|
||||
nextTraceMap
|
||||
)
|
||||
: { default: nextTraceMap }
|
||||
? { default: nextTraceMap, ...nextTraceMap }
|
||||
: { default: nextTraceMap },
|
||||
);
|
||||
|
||||
if (esm) {
|
||||
|
|
@ -1616,7 +1692,7 @@ class ReferenceTracker {
|
|||
yield* this._iteratePropertyReferences(
|
||||
parent,
|
||||
path,
|
||||
nextTraceMap
|
||||
nextTraceMap,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1673,7 +1749,7 @@ class ReferenceTracker {
|
|||
variable,
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1699,7 +1775,7 @@ class ReferenceTracker {
|
|||
yield* this._iterateLhsReferences(
|
||||
property.value,
|
||||
nextPath,
|
||||
nextTraceMap
|
||||
nextTraceMap,
|
||||
);
|
||||
}
|
||||
return
|
||||
|
|
@ -1742,7 +1818,7 @@ class ReferenceTracker {
|
|||
findVariable(this.globalScope, specifierNode.local),
|
||||
path,
|
||||
nextTraceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return
|
||||
|
|
@ -1753,7 +1829,7 @@ class ReferenceTracker {
|
|||
findVariable(this.globalScope, specifierNode.local),
|
||||
path,
|
||||
traceMap,
|
||||
false
|
||||
false,
|
||||
);
|
||||
return
|
||||
}
|
||||
|
|
|
|||
2
node_modules/eslint-utils/index.mjs.map
generated
vendored
2
node_modules/eslint-utils/index.mjs.map
generated
vendored
File diff suppressed because one or more lines are too long
25
node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md
generated
vendored
25
node_modules/eslint-utils/node_modules/eslint-visitor-keys/CHANGELOG.md
generated
vendored
|
|
@ -1,25 +0,0 @@
|
|||
v1.3.0 - June 19, 2020
|
||||
|
||||
* [`c92dd7f`](https://github.com/eslint/eslint-visitor-keys/commit/c92dd7ff96f0044dba12d681406a025b92b4c437) Update: add `ChainExpression` node (#12) (Toru Nagashima)
|
||||
|
||||
v1.2.0 - June 4, 2020
|
||||
|
||||
* [`21f28bf`](https://github.com/eslint/eslint-visitor-keys/commit/21f28bf11be5329d740a8bf6bdbcd0ef13bbf1a2) Update: added exported in exportAllDeclaration key (#10) (Anix)
|
||||
|
||||
v1.1.0 - August 13, 2019
|
||||
|
||||
* [`9331cc0`](https://github.com/eslint/eslint-visitor-keys/commit/9331cc09e756e65b9044c9186445a474b037fac6) Update: add ImportExpression (#8) (Toru Nagashima)
|
||||
* [`5967f58`](https://github.com/eslint/eslint-visitor-keys/commit/5967f583b04f17fba9226aaa394e45d476d2b8af) Chore: add supported Node.js versions to CI (#7) (Kai Cataldo)
|
||||
* [`6f7c60f`](https://github.com/eslint/eslint-visitor-keys/commit/6f7c60fef2ceec9f6323202df718321cec45cab0) Upgrade: eslint-release@1.0.0 (#5) (Teddy Katz)
|
||||
|
||||
v1.0.0 - December 18, 2017
|
||||
|
||||
* 1f6bd38 Breaking: update keys (#4) (Toru Nagashima)
|
||||
|
||||
v0.1.0 - November 17, 2017
|
||||
|
||||
* 17b4a88 Chore: update `repository` field in package.json (#3) (Toru Nagashima)
|
||||
* a5a026b New: eslint-visitor-keys (#1) (Toru Nagashima)
|
||||
* a1a48b8 Update: Change license to Apache 2 (#2) (Ilya Volodin)
|
||||
* 2204715 Initial commit (Toru Nagashima)
|
||||
|
||||
201
node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE
generated
vendored
201
node_modules/eslint-utils/node_modules/eslint-visitor-keys/LICENSE
generated
vendored
|
|
@ -1,201 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright contributors
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
98
node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md
generated
vendored
98
node_modules/eslint-utils/node_modules/eslint-visitor-keys/README.md
generated
vendored
|
|
@ -1,98 +0,0 @@
|
|||
# eslint-visitor-keys
|
||||
|
||||
[](https://www.npmjs.com/package/eslint-visitor-keys)
|
||||
[](http://www.npmtrends.com/eslint-visitor-keys)
|
||||
[](https://travis-ci.org/eslint/eslint-visitor-keys)
|
||||
[](https://david-dm.org/eslint/eslint-visitor-keys)
|
||||
|
||||
Constants and utilities about visitor keys to traverse AST.
|
||||
|
||||
## 💿 Installation
|
||||
|
||||
Use [npm] to install.
|
||||
|
||||
```bash
|
||||
$ npm install eslint-visitor-keys
|
||||
```
|
||||
|
||||
### Requirements
|
||||
|
||||
- [Node.js] 4.0.0 or later.
|
||||
|
||||
## 📖 Usage
|
||||
|
||||
```js
|
||||
const evk = require("eslint-visitor-keys")
|
||||
```
|
||||
|
||||
### evk.KEYS
|
||||
|
||||
> type: `{ [type: string]: string[] | undefined }`
|
||||
|
||||
Visitor keys. This keys are frozen.
|
||||
|
||||
This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"]
|
||||
```
|
||||
|
||||
### evk.getKeys(node)
|
||||
|
||||
> type: `(node: object) => string[]`
|
||||
|
||||
Get the visitor keys of a given AST node.
|
||||
|
||||
This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`.
|
||||
|
||||
This will be used to traverse unknown nodes.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
const node = {
|
||||
type: "AssignmentExpression",
|
||||
left: { type: "Identifier", name: "foo" },
|
||||
right: { type: "Literal", value: 0 }
|
||||
}
|
||||
console.log(evk.getKeys(node)) // → ["type", "left", "right"]
|
||||
```
|
||||
|
||||
### evk.unionWith(additionalKeys)
|
||||
|
||||
> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }`
|
||||
|
||||
Make the union set with `evk.KEYS` and the given keys.
|
||||
|
||||
- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that.
|
||||
- It removes duplicated keys as keeping the first one.
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
console.log(evk.unionWith({
|
||||
MethodDefinition: ["decorators"]
|
||||
})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
|
||||
```
|
||||
|
||||
## 📰 Change log
|
||||
|
||||
See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases).
|
||||
|
||||
## 🍻 Contributing
|
||||
|
||||
Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/).
|
||||
|
||||
### Development commands
|
||||
|
||||
- `npm test` runs tests and measures code coverage.
|
||||
- `npm run lint` checks source codes with ESLint.
|
||||
- `npm run coverage` opens the code coverage report of the previous test with your default browser.
|
||||
- `npm run release` publishes this package to [npm] registory.
|
||||
|
||||
|
||||
[npm]: https://www.npmjs.com/
|
||||
[Node.js]: https://nodejs.org/en/
|
||||
[ESTree]: https://github.com/estree/estree
|
||||
81
node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js
generated
vendored
81
node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/index.js
generated
vendored
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
* @author Toru Nagashima <https://github.com/mysticatea>
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const KEYS = require("./visitor-keys.json");
|
||||
|
||||
// Types.
|
||||
const NODE_TYPES = Object.freeze(Object.keys(KEYS));
|
||||
|
||||
// Freeze the keys.
|
||||
for (const type of NODE_TYPES) {
|
||||
Object.freeze(KEYS[type]);
|
||||
}
|
||||
Object.freeze(KEYS);
|
||||
|
||||
// List to ignore keys.
|
||||
const KEY_BLACKLIST = new Set([
|
||||
"parent",
|
||||
"leadingComments",
|
||||
"trailingComments"
|
||||
]);
|
||||
|
||||
/**
|
||||
* Check whether a given key should be used or not.
|
||||
* @param {string} key The key to check.
|
||||
* @returns {boolean} `true` if the key should be used.
|
||||
*/
|
||||
function filterKey(key) {
|
||||
return !KEY_BLACKLIST.has(key) && key[0] !== "_";
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public interfaces
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = Object.freeze({
|
||||
|
||||
/**
|
||||
* Visitor keys.
|
||||
* @type {{ [type: string]: string[] | undefined }}
|
||||
*/
|
||||
KEYS,
|
||||
|
||||
/**
|
||||
* Get visitor keys of a given node.
|
||||
* @param {Object} node The AST node to get keys.
|
||||
* @returns {string[]} Visitor keys of the node.
|
||||
*/
|
||||
getKeys(node) {
|
||||
return Object.keys(node).filter(filterKey);
|
||||
},
|
||||
|
||||
// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
|
||||
// eslint-disable-next-line valid-jsdoc
|
||||
/**
|
||||
* Make the union set with `KEYS` and given keys.
|
||||
* @param {Object} additionalKeys The additional keys.
|
||||
* @returns {{ [type: string]: string[] | undefined }} The union set.
|
||||
*/
|
||||
unionWith(additionalKeys) {
|
||||
const retv = Object.assign({}, KEYS);
|
||||
|
||||
for (const type of Object.keys(additionalKeys)) {
|
||||
if (retv.hasOwnProperty(type)) {
|
||||
const keys = new Set(additionalKeys[type]);
|
||||
|
||||
for (const key of retv[type]) {
|
||||
keys.add(key);
|
||||
}
|
||||
|
||||
retv[type] = Object.freeze(Array.from(keys));
|
||||
} else {
|
||||
retv[type] = Object.freeze(Array.from(additionalKeys[type]));
|
||||
}
|
||||
}
|
||||
|
||||
return Object.freeze(retv);
|
||||
}
|
||||
});
|
||||
284
node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json
generated
vendored
284
node_modules/eslint-utils/node_modules/eslint-visitor-keys/lib/visitor-keys.json
generated
vendored
|
|
@ -1,284 +0,0 @@
|
|||
{
|
||||
"AssignmentExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"AssignmentPattern": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"ArrayExpression": [
|
||||
"elements"
|
||||
],
|
||||
"ArrayPattern": [
|
||||
"elements"
|
||||
],
|
||||
"ArrowFunctionExpression": [
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"AwaitExpression": [
|
||||
"argument"
|
||||
],
|
||||
"BlockStatement": [
|
||||
"body"
|
||||
],
|
||||
"BinaryExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"BreakStatement": [
|
||||
"label"
|
||||
],
|
||||
"CallExpression": [
|
||||
"callee",
|
||||
"arguments"
|
||||
],
|
||||
"CatchClause": [
|
||||
"param",
|
||||
"body"
|
||||
],
|
||||
"ChainExpression": [
|
||||
"expression"
|
||||
],
|
||||
"ClassBody": [
|
||||
"body"
|
||||
],
|
||||
"ClassDeclaration": [
|
||||
"id",
|
||||
"superClass",
|
||||
"body"
|
||||
],
|
||||
"ClassExpression": [
|
||||
"id",
|
||||
"superClass",
|
||||
"body"
|
||||
],
|
||||
"ConditionalExpression": [
|
||||
"test",
|
||||
"consequent",
|
||||
"alternate"
|
||||
],
|
||||
"ContinueStatement": [
|
||||
"label"
|
||||
],
|
||||
"DebuggerStatement": [],
|
||||
"DoWhileStatement": [
|
||||
"body",
|
||||
"test"
|
||||
],
|
||||
"EmptyStatement": [],
|
||||
"ExportAllDeclaration": [
|
||||
"exported",
|
||||
"source"
|
||||
],
|
||||
"ExportDefaultDeclaration": [
|
||||
"declaration"
|
||||
],
|
||||
"ExportNamedDeclaration": [
|
||||
"declaration",
|
||||
"specifiers",
|
||||
"source"
|
||||
],
|
||||
"ExportSpecifier": [
|
||||
"exported",
|
||||
"local"
|
||||
],
|
||||
"ExpressionStatement": [
|
||||
"expression"
|
||||
],
|
||||
"ExperimentalRestProperty": [
|
||||
"argument"
|
||||
],
|
||||
"ExperimentalSpreadProperty": [
|
||||
"argument"
|
||||
],
|
||||
"ForStatement": [
|
||||
"init",
|
||||
"test",
|
||||
"update",
|
||||
"body"
|
||||
],
|
||||
"ForInStatement": [
|
||||
"left",
|
||||
"right",
|
||||
"body"
|
||||
],
|
||||
"ForOfStatement": [
|
||||
"left",
|
||||
"right",
|
||||
"body"
|
||||
],
|
||||
"FunctionDeclaration": [
|
||||
"id",
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"FunctionExpression": [
|
||||
"id",
|
||||
"params",
|
||||
"body"
|
||||
],
|
||||
"Identifier": [],
|
||||
"IfStatement": [
|
||||
"test",
|
||||
"consequent",
|
||||
"alternate"
|
||||
],
|
||||
"ImportDeclaration": [
|
||||
"specifiers",
|
||||
"source"
|
||||
],
|
||||
"ImportDefaultSpecifier": [
|
||||
"local"
|
||||
],
|
||||
"ImportExpression": [
|
||||
"source"
|
||||
],
|
||||
"ImportNamespaceSpecifier": [
|
||||
"local"
|
||||
],
|
||||
"ImportSpecifier": [
|
||||
"imported",
|
||||
"local"
|
||||
],
|
||||
"JSXAttribute": [
|
||||
"name",
|
||||
"value"
|
||||
],
|
||||
"JSXClosingElement": [
|
||||
"name"
|
||||
],
|
||||
"JSXElement": [
|
||||
"openingElement",
|
||||
"children",
|
||||
"closingElement"
|
||||
],
|
||||
"JSXEmptyExpression": [],
|
||||
"JSXExpressionContainer": [
|
||||
"expression"
|
||||
],
|
||||
"JSXIdentifier": [],
|
||||
"JSXMemberExpression": [
|
||||
"object",
|
||||
"property"
|
||||
],
|
||||
"JSXNamespacedName": [
|
||||
"namespace",
|
||||
"name"
|
||||
],
|
||||
"JSXOpeningElement": [
|
||||
"name",
|
||||
"attributes"
|
||||
],
|
||||
"JSXSpreadAttribute": [
|
||||
"argument"
|
||||
],
|
||||
"JSXText": [],
|
||||
"JSXFragment": [
|
||||
"openingFragment",
|
||||
"children",
|
||||
"closingFragment"
|
||||
],
|
||||
"Literal": [],
|
||||
"LabeledStatement": [
|
||||
"label",
|
||||
"body"
|
||||
],
|
||||
"LogicalExpression": [
|
||||
"left",
|
||||
"right"
|
||||
],
|
||||
"MemberExpression": [
|
||||
"object",
|
||||
"property"
|
||||
],
|
||||
"MetaProperty": [
|
||||
"meta",
|
||||
"property"
|
||||
],
|
||||
"MethodDefinition": [
|
||||
"key",
|
||||
"value"
|
||||
],
|
||||
"NewExpression": [
|
||||
"callee",
|
||||
"arguments"
|
||||
],
|
||||
"ObjectExpression": [
|
||||
"properties"
|
||||
],
|
||||
"ObjectPattern": [
|
||||
"properties"
|
||||
],
|
||||
"Program": [
|
||||
"body"
|
||||
],
|
||||
"Property": [
|
||||
"key",
|
||||
"value"
|
||||
],
|
||||
"RestElement": [
|
||||
"argument"
|
||||
],
|
||||
"ReturnStatement": [
|
||||
"argument"
|
||||
],
|
||||
"SequenceExpression": [
|
||||
"expressions"
|
||||
],
|
||||
"SpreadElement": [
|
||||
"argument"
|
||||
],
|
||||
"Super": [],
|
||||
"SwitchStatement": [
|
||||
"discriminant",
|
||||
"cases"
|
||||
],
|
||||
"SwitchCase": [
|
||||
"test",
|
||||
"consequent"
|
||||
],
|
||||
"TaggedTemplateExpression": [
|
||||
"tag",
|
||||
"quasi"
|
||||
],
|
||||
"TemplateElement": [],
|
||||
"TemplateLiteral": [
|
||||
"quasis",
|
||||
"expressions"
|
||||
],
|
||||
"ThisExpression": [],
|
||||
"ThrowStatement": [
|
||||
"argument"
|
||||
],
|
||||
"TryStatement": [
|
||||
"block",
|
||||
"handler",
|
||||
"finalizer"
|
||||
],
|
||||
"UnaryExpression": [
|
||||
"argument"
|
||||
],
|
||||
"UpdateExpression": [
|
||||
"argument"
|
||||
],
|
||||
"VariableDeclaration": [
|
||||
"declarations"
|
||||
],
|
||||
"VariableDeclarator": [
|
||||
"id",
|
||||
"init"
|
||||
],
|
||||
"WhileStatement": [
|
||||
"test",
|
||||
"body"
|
||||
],
|
||||
"WithStatement": [
|
||||
"object",
|
||||
"body"
|
||||
],
|
||||
"YieldExpression": [
|
||||
"argument"
|
||||
]
|
||||
}
|
||||
40
node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json
generated
vendored
40
node_modules/eslint-utils/node_modules/eslint-visitor-keys/package.json
generated
vendored
|
|
@ -1,40 +0,0 @@
|
|||
{
|
||||
"name": "eslint-visitor-keys",
|
||||
"version": "1.3.0",
|
||||
"description": "Constants and utilities about visitor keys to traverse AST.",
|
||||
"main": "lib/index.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"eslint": "^4.7.2",
|
||||
"eslint-config-eslint": "^4.0.0",
|
||||
"eslint-release": "^1.0.0",
|
||||
"mocha": "^3.5.3",
|
||||
"nyc": "^11.2.1",
|
||||
"opener": "^1.4.3"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint lib tests/lib",
|
||||
"pretest": "npm run -s lint",
|
||||
"test": "nyc mocha tests/lib",
|
||||
"coverage": "nyc report --reporter lcov && opener coverage/lcov-report/index.html",
|
||||
"generate-release": "eslint-generate-release",
|
||||
"generate-alpharelease": "eslint-generate-prerelease alpha",
|
||||
"generate-betarelease": "eslint-generate-prerelease beta",
|
||||
"generate-rcrelease": "eslint-generate-prerelease rc",
|
||||
"publish-release": "eslint-publish-release"
|
||||
},
|
||||
"repository": "eslint/eslint-visitor-keys",
|
||||
"keywords": [],
|
||||
"author": "Toru Nagashima (https://github.com/mysticatea)",
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/eslint/eslint-visitor-keys/issues"
|
||||
},
|
||||
"homepage": "https://github.com/eslint/eslint-visitor-keys#readme"
|
||||
}
|
||||
29
node_modules/eslint-utils/package.json
generated
vendored
29
node_modules/eslint-utils/package.json
generated
vendored
|
|
@ -1,9 +1,9 @@
|
|||
{
|
||||
"name": "eslint-utils",
|
||||
"version": "2.1.0",
|
||||
"version": "3.0.0",
|
||||
"description": "Utilities for ESLint plugins.",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"main": "index",
|
||||
|
|
@ -11,20 +11,28 @@
|
|||
"files": [
|
||||
"index.*"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./index.mjs",
|
||||
"require": "./index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint-visitor-keys": "^1.1.0"
|
||||
"eslint-visitor-keys": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mysticatea/eslint-plugin": "^12.0.0",
|
||||
"@mysticatea/eslint-plugin": "^13.0.0",
|
||||
"codecov": "^3.6.1",
|
||||
"dot-prop": "^4.2.0",
|
||||
"eslint": "^6.5.1",
|
||||
"eslint": "^7.24.0",
|
||||
"esm": "^3.2.25",
|
||||
"espree": "^6.1.1",
|
||||
"espree": "github:eslint/espree#1c744b3a602b783926344811a9459b92afe57444",
|
||||
"mocha": "^6.2.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^14.1.1",
|
||||
"opener": "^1.5.1",
|
||||
"prettier": "~2.3.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"rollup": "^1.25.0",
|
||||
"rollup-plugin-sourcemaps": "^0.4.2",
|
||||
|
|
@ -32,6 +40,9 @@
|
|||
"vuepress": "^1.2.0",
|
||||
"warun": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=5"
|
||||
},
|
||||
"scripts": {
|
||||
"prebuild": "npm run -s clean",
|
||||
"build": "rollup -c",
|
||||
|
|
@ -40,8 +51,10 @@
|
|||
"coverage": "opener ./coverage/lcov-report/index.html",
|
||||
"docs:build": "vuepress build docs",
|
||||
"docs:watch": "vuepress dev docs",
|
||||
"lint": "eslint src test",
|
||||
"test": "run-s lint build test:mocha",
|
||||
"format": "npm run -s format:prettier -- --write",
|
||||
"format:prettier": "prettier docs/.vuepress/config.js src/**/*.js test/**/*.js rollup.config.js .vscode/*.json *.json .github/**/*.yml *.yml docs/**/*.md *.md",
|
||||
"lint": "eslint docs/.vuepress/config.js src test rollup.config.js",
|
||||
"test": "run-s \"format:prettier -- --check\" lint build test:mocha",
|
||||
"test:mocha": "nyc mocha --reporter dot \"test/*.js\"",
|
||||
"preversion": "npm test && npm run -s build",
|
||||
"postversion": "git push && git push --tags",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue