Bump the npm group with 4 updates (#2419)
* Bump the npm group with 4 updates Bumps the npm group with 4 updates: [adm-zip](https://github.com/cthackers/adm-zip), [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `adm-zip` from 0.5.14 to 0.5.15 - [Release notes](https://github.com/cthackers/adm-zip/releases) - [Changelog](https://github.com/cthackers/adm-zip/blob/master/history.md) - [Commits](https://github.com/cthackers/adm-zip/compare/v0.5.14...v0.5.15) Updates `@eslint/js` from 9.8.0 to 9.9.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/commits/v9.9.0/packages/js) Updates `@typescript-eslint/eslint-plugin` from 8.0.1 to 8.1.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.1.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.0.1 to 8.1.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.1.0/packages/parser) --- updated-dependencies: - dependency-name: adm-zip dependency-type: direct:production update-type: version-update:semver-patch dependency-group: npm - dependency-name: "@eslint/js" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
25ad3c8e40
commit
d620faa0b4
103 changed files with 1631 additions and 740 deletions
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js
generated
vendored
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js
generated
vendored
|
|
@ -245,7 +245,9 @@ function getNodeType(node) {
|
|||
case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration:
|
||||
return 'constructor';
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:
|
||||
case utils_1.AST_NODE_TYPES.TSPropertySignature:
|
||||
return node.readonly ? 'readonly-field' : 'field';
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty:
|
||||
case utils_1.AST_NODE_TYPES.AccessorProperty:
|
||||
return 'accessor';
|
||||
case utils_1.AST_NODE_TYPES.PropertyDefinition:
|
||||
|
|
@ -254,8 +256,6 @@ function getNodeType(node) {
|
|||
: node.readonly
|
||||
? 'readonly-field'
|
||||
: 'field';
|
||||
case utils_1.AST_NODE_TYPES.TSPropertySignature:
|
||||
return node.readonly ? 'readonly-field' : 'field';
|
||||
case utils_1.AST_NODE_TYPES.TSIndexSignature:
|
||||
return node.readonly ? 'readonly-signature' : 'signature';
|
||||
case utils_1.AST_NODE_TYPES.StaticBlock:
|
||||
|
|
@ -286,7 +286,9 @@ function getMemberName(node, sourceCode) {
|
|||
switch (node.type) {
|
||||
case utils_1.AST_NODE_TYPES.TSPropertySignature:
|
||||
case utils_1.AST_NODE_TYPES.TSMethodSignature:
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty:
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:
|
||||
case utils_1.AST_NODE_TYPES.AccessorProperty:
|
||||
case utils_1.AST_NODE_TYPES.PropertyDefinition:
|
||||
return getMemberRawName(node, sourceCode);
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:
|
||||
|
|
@ -317,7 +319,9 @@ function isMemberOptional(node) {
|
|||
switch (node.type) {
|
||||
case utils_1.AST_NODE_TYPES.TSPropertySignature:
|
||||
case utils_1.AST_NODE_TYPES.TSMethodSignature:
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty:
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:
|
||||
case utils_1.AST_NODE_TYPES.AccessorProperty:
|
||||
case utils_1.AST_NODE_TYPES.PropertyDefinition:
|
||||
case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:
|
||||
case utils_1.AST_NODE_TYPES.MethodDefinition:
|
||||
|
|
@ -370,7 +374,8 @@ function getRank(node, orderConfig, supportsModifiers) {
|
|||
// shouldn't happen but just in case, put it on the end
|
||||
return orderConfig.length - 1;
|
||||
}
|
||||
const abstract = node.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition ||
|
||||
const abstract = node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty ||
|
||||
node.type === utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition ||
|
||||
node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition;
|
||||
const scope = 'static' in node && node.static
|
||||
? 'static'
|
||||
|
|
@ -387,6 +392,7 @@ function getRank(node, orderConfig, supportsModifiers) {
|
|||
(type === 'readonly-field' ||
|
||||
type === 'field' ||
|
||||
type === 'method' ||
|
||||
type === 'accessor' ||
|
||||
type === 'get' ||
|
||||
type === 'set')) {
|
||||
memberGroups.push(`${accessibility}-decorated-${type}`);
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map
generated
vendored
File diff suppressed because one or more lines are too long
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js
generated
vendored
12
node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js
generated
vendored
|
|
@ -165,13 +165,11 @@ exports.default = (0, util_1.createRule)({
|
|||
const identifiers = getIdentifiersFromPattern(node.id);
|
||||
const baseModifiers = new Set();
|
||||
const parent = node.parent;
|
||||
if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclaration) {
|
||||
if (parent.kind === 'const') {
|
||||
baseModifiers.add(naming_convention_utils_1.Modifiers.const);
|
||||
}
|
||||
if (isGlobal(context.sourceCode.getScope(node))) {
|
||||
baseModifiers.add(naming_convention_utils_1.Modifiers.global);
|
||||
}
|
||||
if (parent.kind === 'const') {
|
||||
baseModifiers.add(naming_convention_utils_1.Modifiers.const);
|
||||
}
|
||||
if (isGlobal(context.sourceCode.getScope(node))) {
|
||||
baseModifiers.add(naming_convention_utils_1.Modifiers.global);
|
||||
}
|
||||
identifiers.forEach(id => {
|
||||
const modifiers = new Set(baseModifiers);
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map
generated
vendored
File diff suppressed because one or more lines are too long
33
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
33
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
|
|
@ -137,6 +137,10 @@ exports.default = (0, util_1.createRule)({
|
|||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
messageId: 'floatingFixAwait',
|
||||
fix: (fixer) => addAwait(fixer, expression, node),
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
|
@ -149,20 +153,7 @@ exports.default = (0, util_1.createRule)({
|
|||
suggest: [
|
||||
{
|
||||
messageId: 'floatingFixAwait',
|
||||
fix(fixer) {
|
||||
if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
|
||||
expression.operator === 'void') {
|
||||
return fixer.replaceTextRange([expression.range[0], expression.range[0] + 4], 'await');
|
||||
}
|
||||
const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression);
|
||||
if (isHigherPrecedenceThanUnary(tsNode)) {
|
||||
return fixer.insertTextBefore(node, 'await ');
|
||||
}
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
},
|
||||
fix: (fixer) => addAwait(fixer, expression, node),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -170,6 +161,20 @@ exports.default = (0, util_1.createRule)({
|
|||
}
|
||||
},
|
||||
};
|
||||
function addAwait(fixer, expression, node) {
|
||||
if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
|
||||
expression.operator === 'void') {
|
||||
return fixer.replaceTextRange([expression.range[0], expression.range[0] + 4], 'await');
|
||||
}
|
||||
const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression);
|
||||
if (isHigherPrecedenceThanUnary(tsNode)) {
|
||||
return fixer.insertTextBefore(node, 'await ');
|
||||
}
|
||||
return [
|
||||
fixer.insertTextBefore(node, 'await ('),
|
||||
fixer.insertTextAfterRange([expression.range[1], expression.range[1]], ')'),
|
||||
];
|
||||
}
|
||||
function isKnownSafePromiseReturn(node) {
|
||||
if (node.type !== utils_1.AST_NODE_TYPES.CallExpression) {
|
||||
return false;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
File diff suppressed because one or more lines are too long
71
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js
generated
vendored
71
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js
generated
vendored
|
|
@ -36,6 +36,7 @@ function parseChecksVoidReturn(checksVoidReturn) {
|
|||
return {
|
||||
arguments: true,
|
||||
attributes: true,
|
||||
inheritedMethods: true,
|
||||
properties: true,
|
||||
returns: true,
|
||||
variables: true,
|
||||
|
|
@ -44,6 +45,7 @@ function parseChecksVoidReturn(checksVoidReturn) {
|
|||
return {
|
||||
arguments: checksVoidReturn.arguments ?? true,
|
||||
attributes: checksVoidReturn.attributes ?? true,
|
||||
inheritedMethods: checksVoidReturn.inheritedMethods ?? true,
|
||||
properties: checksVoidReturn.properties ?? true,
|
||||
returns: checksVoidReturn.returns ?? true,
|
||||
variables: checksVoidReturn.variables ?? true,
|
||||
|
|
@ -60,10 +62,11 @@ exports.default = (0, util_1.createRule)({
|
|||
},
|
||||
messages: {
|
||||
voidReturnArgument: 'Promise returned in function argument where a void return was expected.',
|
||||
voidReturnVariable: 'Promise-returning function provided to variable where a void return was expected.',
|
||||
voidReturnAttribute: 'Promise-returning function provided to attribute where a void return was expected.',
|
||||
voidReturnInheritedMethod: "Promise-returning method provided where a void return was expected by extended/implemented type '{{ heritageTypeName }}'.",
|
||||
voidReturnProperty: 'Promise-returning function provided to property where a void return was expected.',
|
||||
voidReturnReturnValue: 'Promise-returning function provided to return value where a void return was expected.',
|
||||
voidReturnAttribute: 'Promise-returning function provided to attribute where a void return was expected.',
|
||||
voidReturnVariable: 'Promise-returning function provided to variable where a void return was expected.',
|
||||
conditional: 'Expected non-Promise value in a boolean conditional.',
|
||||
spread: 'Expected a non-Promise value to be spreaded in an object.',
|
||||
},
|
||||
|
|
@ -83,6 +86,7 @@ exports.default = (0, util_1.createRule)({
|
|||
properties: {
|
||||
arguments: { type: 'boolean' },
|
||||
attributes: { type: 'boolean' },
|
||||
inheritedMethods: { type: 'boolean' },
|
||||
properties: { type: 'boolean' },
|
||||
returns: { type: 'boolean' },
|
||||
variables: { type: 'boolean' },
|
||||
|
|
@ -131,6 +135,11 @@ exports.default = (0, util_1.createRule)({
|
|||
...(checksVoidReturn.attributes && {
|
||||
JSXAttribute: checkJSXAttribute,
|
||||
}),
|
||||
...(checksVoidReturn.inheritedMethods && {
|
||||
ClassDeclaration: checkClassLikeOrInterfaceNode,
|
||||
ClassExpression: checkClassLikeOrInterfaceNode,
|
||||
TSInterfaceDeclaration: checkClassLikeOrInterfaceNode,
|
||||
}),
|
||||
...(checksVoidReturn.properties && {
|
||||
Property: checkProperty,
|
||||
}),
|
||||
|
|
@ -379,6 +388,51 @@ exports.default = (0, util_1.createRule)({
|
|||
});
|
||||
}
|
||||
}
|
||||
function checkClassLikeOrInterfaceNode(node) {
|
||||
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
|
||||
const heritageTypes = getHeritageTypes(checker, tsNode);
|
||||
if (!heritageTypes?.length) {
|
||||
return;
|
||||
}
|
||||
for (const nodeMember of tsNode.members) {
|
||||
const memberName = nodeMember.name?.getText();
|
||||
if (memberName === undefined) {
|
||||
// Call/construct/index signatures don't have names. TS allows call signatures to mismatch,
|
||||
// and construct signatures can't be async.
|
||||
// TODO - Once we're able to use `checker.isTypeAssignableTo` (v8), we can check an index
|
||||
// signature here against its compatible index signatures in `heritageTypes`
|
||||
continue;
|
||||
}
|
||||
if (!returnsThenable(checker, nodeMember)) {
|
||||
continue;
|
||||
}
|
||||
for (const heritageType of heritageTypes) {
|
||||
checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Checks `heritageType` for a member named `memberName` that returns void; reports the
|
||||
* 'voidReturnInheritedMethod' message if found.
|
||||
* @param nodeMember Node member that returns a Promise
|
||||
* @param heritageType Heritage type to check against
|
||||
* @param memberName Name of the member to check for
|
||||
*/
|
||||
function checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName) {
|
||||
const heritageMember = getMemberIfExists(heritageType, memberName);
|
||||
if (heritageMember === undefined) {
|
||||
return;
|
||||
}
|
||||
const memberType = checker.getTypeOfSymbolAtLocation(heritageMember, nodeMember);
|
||||
if (!isVoidReturningFunctionType(checker, nodeMember, memberType)) {
|
||||
return;
|
||||
}
|
||||
context.report({
|
||||
node: services.tsNodeToESTreeNodeMap.get(nodeMember),
|
||||
messageId: 'voidReturnInheritedMethod',
|
||||
data: { heritageTypeName: checker.typeToString(heritageType) },
|
||||
});
|
||||
}
|
||||
function checkJSXAttribute(node) {
|
||||
if (node.value == null ||
|
||||
node.value.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer) {
|
||||
|
|
@ -592,4 +646,17 @@ function returnsThenable(checker, node) {
|
|||
.unionTypeParts(type)
|
||||
.some(t => anySignatureIsThenableType(checker, node, t));
|
||||
}
|
||||
function getHeritageTypes(checker, tsNode) {
|
||||
return tsNode.heritageClauses
|
||||
?.flatMap(clause => clause.types)
|
||||
.map(typeExpression => checker.getTypeAtLocation(typeExpression));
|
||||
}
|
||||
/**
|
||||
* @returns The member with the given name in `type`, if it exists.
|
||||
*/
|
||||
function getMemberIfExists(type, memberName) {
|
||||
const escapedMemberName = ts.escapeLeadingUnderscores(memberName);
|
||||
const symbolMemberMatch = type.getSymbol()?.members?.get(escapedMemberName);
|
||||
return (symbolMemberMatch ?? tsutils.getPropertyOfType(type, escapedMemberName));
|
||||
}
|
||||
//# sourceMappingURL=no-misused-promises.js.map
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map
generated
vendored
File diff suppressed because one or more lines are too long
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js
generated
vendored
|
|
@ -279,8 +279,8 @@ exports.default = (0, util_1.createRule)({
|
|||
if (isInRange(node.init, location)) {
|
||||
return true;
|
||||
}
|
||||
if ((node.parent.parent?.type === utils_1.AST_NODE_TYPES.ForInStatement ||
|
||||
node.parent.parent?.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
|
||||
if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement ||
|
||||
node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
|
||||
isInRange(node.parent.parent.right, location)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -31,12 +31,12 @@ exports.default = (0, util_1.createRule)({
|
|||
defaultOptions: [],
|
||||
meta: {
|
||||
docs: {
|
||||
description: 'Disallow type parameters that only appear once',
|
||||
description: "Disallow type parameters that aren't used multiple times",
|
||||
requiresTypeChecking: true,
|
||||
recommended: 'strict',
|
||||
},
|
||||
messages: {
|
||||
sole: 'Type parameter {{name}} is used only once.',
|
||||
sole: 'Type parameter {{name}} is {{uses}} in the {{descriptor}} signature.',
|
||||
},
|
||||
schema: [],
|
||||
type: 'problem',
|
||||
|
|
@ -44,11 +44,38 @@ exports.default = (0, util_1.createRule)({
|
|||
name: 'no-unnecessary-type-parameters',
|
||||
create(context) {
|
||||
const parserServices = (0, util_1.getParserServices)(context);
|
||||
function checkNode(node, descriptor) {
|
||||
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
|
||||
const checker = parserServices.program.getTypeChecker();
|
||||
let counts;
|
||||
for (const typeParameter of tsNode.typeParameters) {
|
||||
const esTypeParameter = parserServices.tsNodeToESTreeNodeMap.get(typeParameter);
|
||||
const scope = context.sourceCode.getScope(esTypeParameter);
|
||||
// Quick path: if the type parameter is used multiple times in the AST,
|
||||
// we don't need to dip into types to know it's repeated.
|
||||
if (isTypeParameterRepeatedInAST(esTypeParameter, scope.references, node.body?.range[0] ?? node.returnType?.range[1])) {
|
||||
continue;
|
||||
}
|
||||
// For any inferred types, we have to dip into type checking.
|
||||
counts ??= countTypeParameterUsage(checker, tsNode);
|
||||
const identifierCounts = counts.get(typeParameter.name);
|
||||
if (!identifierCounts || identifierCounts > 2) {
|
||||
continue;
|
||||
}
|
||||
context.report({
|
||||
data: {
|
||||
descriptor,
|
||||
uses: identifierCounts === 1 ? 'never used' : 'used only once',
|
||||
name: typeParameter.name.text,
|
||||
},
|
||||
node: esTypeParameter,
|
||||
messageId: 'sole',
|
||||
});
|
||||
}
|
||||
}
|
||||
return {
|
||||
[[
|
||||
'ArrowFunctionExpression[typeParameters]',
|
||||
'ClassDeclaration[typeParameters]',
|
||||
'ClassExpression[typeParameters]',
|
||||
'FunctionDeclaration[typeParameters]',
|
||||
'FunctionExpression[typeParameters]',
|
||||
'TSCallSignatureDeclaration[typeParameters]',
|
||||
|
|
@ -58,43 +85,29 @@ exports.default = (0, util_1.createRule)({
|
|||
'TSFunctionType[typeParameters]',
|
||||
'TSMethodSignature[typeParameters]',
|
||||
].join(', ')](node) {
|
||||
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
|
||||
const checker = parserServices.program.getTypeChecker();
|
||||
let counts;
|
||||
for (const typeParameter of tsNode.typeParameters) {
|
||||
const esTypeParameter = parserServices.tsNodeToESTreeNodeMap.get(typeParameter);
|
||||
const scope = context.sourceCode.getScope(esTypeParameter);
|
||||
// Quick path: if the type parameter is used multiple times in the AST,
|
||||
// we don't need to dip into types to know it's repeated.
|
||||
if (isTypeParameterRepeatedInAST(esTypeParameter, scope.references)) {
|
||||
continue;
|
||||
}
|
||||
// For any inferred types, we have to dip into type checking.
|
||||
counts ??= countTypeParameterUsage(checker, tsNode);
|
||||
const identifierCounts = counts.get(typeParameter.name);
|
||||
if (!identifierCounts || identifierCounts > 2) {
|
||||
continue;
|
||||
}
|
||||
context.report({
|
||||
data: {
|
||||
name: typeParameter.name.text,
|
||||
},
|
||||
node: esTypeParameter,
|
||||
messageId: 'sole',
|
||||
});
|
||||
}
|
||||
checkNode(node, 'function');
|
||||
},
|
||||
[[
|
||||
'ClassDeclaration[typeParameters]',
|
||||
'ClassExpression[typeParameters]',
|
||||
].join(', ')](node) {
|
||||
checkNode(node, 'class');
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
function isTypeParameterRepeatedInAST(node, references) {
|
||||
function isTypeParameterRepeatedInAST(node, references, startOfBody = Infinity) {
|
||||
let total = 0;
|
||||
for (const reference of references) {
|
||||
// References inside the type parameter's definition don't count.
|
||||
// References inside the type parameter's definition don't count...
|
||||
if (reference.identifier.range[0] < node.range[1] &&
|
||||
reference.identifier.range[1] > node.range[0]) {
|
||||
continue;
|
||||
}
|
||||
// ...nor references that are outside the declaring signature.
|
||||
if (reference.identifier.range[0] > startOfBody) {
|
||||
continue;
|
||||
}
|
||||
// Neither do references that aren't to the same type parameter,
|
||||
// namely value-land (non-type) identifiers of the type parameter's type,
|
||||
// and references to different type parameters or values.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
39
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js
generated
vendored
39
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js
generated
vendored
|
|
@ -37,9 +37,9 @@ exports.default = (0, util_1.createRule)({
|
|||
requiresTypeChecking: true,
|
||||
},
|
||||
messages: {
|
||||
unsafeReturn: 'Unsafe return of an {{type}} typed value.',
|
||||
unsafeReturn: 'Unsafe return of a value of type {{type}}.',
|
||||
unsafeReturnThis: [
|
||||
'Unsafe return of an `{{type}}` typed value. `this` is typed as `any`.',
|
||||
'Unsafe return of a value of type `{{type}}`. `this` is typed as `any`.',
|
||||
'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.',
|
||||
].join('\n'),
|
||||
unsafeReturnAssignment: 'Unsafe return of type `{{sender}}` from function with return type `{{receiver}}`.',
|
||||
|
|
@ -68,7 +68,8 @@ exports.default = (0, util_1.createRule)({
|
|||
}
|
||||
function checkReturn(returnNode, reportingNode = returnNode) {
|
||||
const tsNode = services.esTreeNodeToTSNodeMap.get(returnNode);
|
||||
const anyType = (0, util_1.isAnyOrAnyArrayTypeDiscriminated)(tsNode, checker);
|
||||
const type = checker.getTypeAtLocation(tsNode);
|
||||
const anyType = (0, util_1.discriminateAnyType)(type, checker, services.program, tsNode);
|
||||
const functionNode = getParentFunctionNode(returnNode);
|
||||
/* istanbul ignore if */ if (!functionNode) {
|
||||
return;
|
||||
|
|
@ -87,20 +88,31 @@ exports.default = (0, util_1.createRule)({
|
|||
if (!functionType) {
|
||||
functionType = services.getTypeAtLocation(functionNode);
|
||||
}
|
||||
const callSignatures = tsutils.getCallSignaturesOfType(functionType);
|
||||
// If there is an explicit type annotation *and* that type matches the actual
|
||||
// function return type, we shouldn't complain (it's intentional, even if unsafe)
|
||||
if (functionTSNode.type) {
|
||||
for (const signature of tsutils.getCallSignaturesOfType(functionType)) {
|
||||
if (returnNodeType === signature.getReturnType() ||
|
||||
(0, util_1.isTypeFlagSet)(signature.getReturnType(), ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
|
||||
for (const signature of callSignatures) {
|
||||
const signatureReturnType = signature.getReturnType();
|
||||
if (returnNodeType === signatureReturnType ||
|
||||
(0, util_1.isTypeFlagSet)(signatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
|
||||
return;
|
||||
}
|
||||
if (functionNode.async) {
|
||||
const awaitedSignatureReturnType = checker.getAwaitedType(signatureReturnType);
|
||||
const awaitedReturnNodeType = checker.getAwaitedType(returnNodeType);
|
||||
if (awaitedReturnNodeType === awaitedSignatureReturnType ||
|
||||
(awaitedSignatureReturnType &&
|
||||
(0, util_1.isTypeFlagSet)(awaitedSignatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (anyType !== util_1.AnyType.Safe) {
|
||||
// Allow cases when the declared return type of the function is either unknown or unknown[]
|
||||
// and the function is returning any or any[].
|
||||
for (const signature of functionType.getCallSignatures()) {
|
||||
for (const signature of callSignatures) {
|
||||
const functionReturnType = signature.getReturnType();
|
||||
if (anyType === util_1.AnyType.Any &&
|
||||
(0, util_1.isTypeUnknownType)(functionReturnType)) {
|
||||
|
|
@ -110,6 +122,15 @@ exports.default = (0, util_1.createRule)({
|
|||
(0, util_1.isTypeUnknownArrayType)(functionReturnType, checker)) {
|
||||
return;
|
||||
}
|
||||
const awaitedType = checker.getAwaitedType(functionReturnType);
|
||||
if (awaitedType &&
|
||||
anyType === util_1.AnyType.PromiseAny &&
|
||||
(0, util_1.isTypeUnknownType)(awaitedType)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (anyType === util_1.AnyType.PromiseAny && !functionNode.async) {
|
||||
return;
|
||||
}
|
||||
let messageId = 'unsafeReturn';
|
||||
const isErrorType = tsutils.isIntrinsicErrorType(returnNodeType);
|
||||
|
|
@ -130,7 +151,9 @@ exports.default = (0, util_1.createRule)({
|
|||
? 'error'
|
||||
: anyType === util_1.AnyType.Any
|
||||
? '`any`'
|
||||
: '`any[]`',
|
||||
: anyType === util_1.AnyType.PromiseAny
|
||||
? '`Promise<any>`'
|
||||
: '`any[]`',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"no-unsafe-return.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-return.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,sDAAwC;AACxC,+CAAiC;AAEjC,kCAaiB;AAEjB,kBAAe,IAAA,iBAAU,EAAC;IACxB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,4DAA4D;YACzE,WAAW,EAAE,aAAa;YAC1B,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,2CAA2C;YACzD,gBAAgB,EAAE;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,IAAI,CAAC,QAAQ,CAAC;gBAC/B,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,OAAO;gBACT,CAAC;gBAED,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9B,CAAC;YACD,qDAAqD,EAAE,WAAW;SACnE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js
generated
vendored
|
|
@ -130,8 +130,8 @@ function isInInitializer(variable, reference) {
|
|||
if (isInRange(node.init, location)) {
|
||||
return true;
|
||||
}
|
||||
if ((node.parent.parent?.type === utils_1.AST_NODE_TYPES.ForInStatement ||
|
||||
node.parent.parent?.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
|
||||
if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement ||
|
||||
node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) &&
|
||||
isInRange(node.parent.parent.right, location)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -133,7 +133,35 @@ const analyzeOrChainOperand = (parserServices, operand, index, chain) => {
|
|||
return null;
|
||||
}
|
||||
};
|
||||
function getFixer(sourceCode, parserServices, operator, options, chain) {
|
||||
/**
|
||||
* Returns the range that needs to be reported from the chain.
|
||||
* @param chain The chain of logical expressions.
|
||||
* @param boundary The boundary range that the range to report cannot fall outside.
|
||||
* @param sourceCode The source code to get tokens.
|
||||
* @returns The range to report.
|
||||
*/
|
||||
function getReportRange(chain, boundary, sourceCode) {
|
||||
const leftNode = chain[0].node;
|
||||
const rightNode = chain[chain.length - 1].node;
|
||||
let leftMost = (0, util_1.nullThrows)(sourceCode.getFirstToken(leftNode), util_1.NullThrowsReasons.MissingToken('any token', leftNode.type));
|
||||
let rightMost = (0, util_1.nullThrows)(sourceCode.getLastToken(rightNode), util_1.NullThrowsReasons.MissingToken('any token', rightNode.type));
|
||||
while (leftMost.range[0] > boundary[0]) {
|
||||
const token = sourceCode.getTokenBefore(leftMost);
|
||||
if (!token || !(0, util_1.isOpeningParenToken)(token) || token.range[0] < boundary[0]) {
|
||||
break;
|
||||
}
|
||||
leftMost = token;
|
||||
}
|
||||
while (rightMost.range[1] < boundary[1]) {
|
||||
const token = sourceCode.getTokenAfter(rightMost);
|
||||
if (!token || !(0, util_1.isClosingParenToken)(token) || token.range[1] > boundary[1]) {
|
||||
break;
|
||||
}
|
||||
rightMost = token;
|
||||
}
|
||||
return [leftMost.range[0], rightMost.range[1]];
|
||||
}
|
||||
function getReportDescriptor(sourceCode, parserServices, node, operator, options, chain) {
|
||||
const lastOperand = chain[chain.length - 1];
|
||||
let useSuggestionFixer;
|
||||
if (options.allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing ===
|
||||
|
|
@ -269,10 +297,22 @@ function getFixer(sourceCode, parserServices, operator, options, chain) {
|
|||
else if (lastOperand.comparisonType === "NotBoolean" /* NullishComparisonType.NotBoolean */) {
|
||||
newCode = `!${newCode}`;
|
||||
}
|
||||
const fix = fixer => fixer.replaceTextRange([chain[0].node.range[0], lastOperand.node.range[1]], newCode);
|
||||
return useSuggestionFixer
|
||||
? { suggest: [{ fix, messageId: 'optionalChainSuggest' }] }
|
||||
: { fix };
|
||||
const reportRange = getReportRange(chain, node.range, sourceCode);
|
||||
const fix = fixer => fixer.replaceTextRange(reportRange, newCode);
|
||||
return {
|
||||
messageId: 'preferOptionalChain',
|
||||
loc: {
|
||||
start: sourceCode.getLocFromIndex(reportRange[0]),
|
||||
end: sourceCode.getLocFromIndex(reportRange[1]),
|
||||
},
|
||||
...(0, util_1.getFixOrSuggest)({
|
||||
useFix: !useSuggestionFixer,
|
||||
suggestion: {
|
||||
messageId: 'optionalChainSuggest',
|
||||
fix,
|
||||
},
|
||||
}),
|
||||
};
|
||||
function flattenChainExpression(sourceCode, node) {
|
||||
switch (node.type) {
|
||||
case utils_1.AST_NODE_TYPES.ChainExpression:
|
||||
|
|
@ -332,7 +372,7 @@ function getFixer(sourceCode, parserServices, operator, options, chain) {
|
|||
}
|
||||
}
|
||||
}
|
||||
function analyzeChain(context, parserServices, options, operator, chain) {
|
||||
function analyzeChain(context, parserServices, options, node, operator, chain) {
|
||||
// need at least 2 operands in a chain for it to be a chain
|
||||
if (chain.length <= 1 ||
|
||||
/* istanbul ignore next -- previous checks make this unreachable, but keep it for exhaustiveness check */
|
||||
|
|
@ -353,14 +393,7 @@ function analyzeChain(context, parserServices, options, operator, chain) {
|
|||
const maybeReportThenReset = (newChainSeed) => {
|
||||
if (subChain.length > 1) {
|
||||
const subChainFlat = subChain.flat();
|
||||
(0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, subChainFlat.slice(0, -1).map(({ node }) => node), {
|
||||
messageId: 'preferOptionalChain',
|
||||
loc: {
|
||||
start: subChainFlat[0].node.loc.start,
|
||||
end: subChainFlat[subChainFlat.length - 1].node.loc.end,
|
||||
},
|
||||
...getFixer(context.sourceCode, parserServices, operator, options, subChainFlat),
|
||||
});
|
||||
(0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, subChainFlat.slice(0, -1).map(({ node }) => node), getReportDescriptor(context.sourceCode, parserServices, node, operator, options, subChainFlat));
|
||||
}
|
||||
// we've reached the end of a chain of logical expressions
|
||||
// i.e. the current operand doesn't belong to the previous chain.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js
generated
vendored
|
|
@ -156,7 +156,7 @@ exports.default = (0, util_1.createRule)({
|
|||
let currentChain = [];
|
||||
for (const operand of operands) {
|
||||
if (operand.type === "Invalid" /* OperandValidity.Invalid */) {
|
||||
(0, analyzeChain_1.analyzeChain)(context, parserServices, options, node.operator, currentChain);
|
||||
(0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain);
|
||||
currentChain = [];
|
||||
}
|
||||
else {
|
||||
|
|
@ -165,7 +165,7 @@ exports.default = (0, util_1.createRule)({
|
|||
}
|
||||
// make sure to check whatever's left
|
||||
if (currentChain.length > 0) {
|
||||
(0, analyzeChain_1.analyzeChain)(context, parserServices, options, node.operator, currentChain);
|
||||
(0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"prefer-optional-chain.js","sourceRoot":"","sources":["../../src/rules/prefer-optional-chain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,+CAAiC;AAEjC,kCAKiB;AACjB,6EAA0E;AAC1E,+FAA4F;AAE5F,+FAG6D;AAM7D,kBAAe,IAAA,iBAAU,EAGvB;IACA,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,yHAAyH;YAC3H,WAAW,EAAE,WAAW;YACxB,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACR,mBAAmB,EACjB,6FAA6F;YAC/F,oBAAoB,EAAE,8BAA8B;SACrD;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,kFAAkF;qBACrF;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,SAAS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ACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
{"version":3,"file":"prefer-optional-chain.js","sourceRoot":"","sources":["../../src/rules/prefer-optional-chain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,+CAAiC;AAEjC,kCAKiB;AACjB,6EAA0E;AAC1E,+FAA4F;AAE5F,+FAG6D;AAM7D,kBAAe,IAAA,iBAAU,EAGvB;IACA,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EACT,yHAAyH;YAC3H,WAAW,EAAE,WAAW;YACxB,oBAAoB,EAAE,IAAI;SAC3B;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACR,mBAAmB,EACjB,6FAA6F;YAC/F,oBAAoB,EAAE,8BAA8B;SACrD;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,KAAK;gBAC3B,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,kFAAkF;qBACrF;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,sFAAsF;qBACzF;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,qFAAqF;qBACxF;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,qFAAqF;qBACxF;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,sFAAsF;qBACzF;oBACD,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,qFAAqF;qBACxF;oBACD,cAAc,EAAE;wBACd,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,2GAA2G;qBAC9G;oBACD,kEAAkE,EAAE;wBAClE,IA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AAE,iBAAiB,EAAE,GAAG,IAAA,6CAAqB,EAC3D,IAAI,EACJ,cAAc,EACd,OAAO,CAAC,UAAU,EAClB,OAAO,CACR,CAAC;gBACF,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;oBACxC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAC5B,CAAC;gBAED,IAAI,YAAY,GAAmB,EAAE,CAAC;gBACtC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;oBAC/B,IAAI,OAAO,CAAC,IAAI,4CAA4B,EAAE,CAAC;wBAC7C,IAAA,2BAAY,EACV,OAAO,EACP,cAAc,EACd,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,QAAQ,EACb,YAAY,CACb,CAAC;wBACF,YAAY,GAAG,EAAE,CAAC;oBACpB,CAAC;yBAAM,CAAC;wBACN,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAC7B,CAAC;gBACH,CAAC;gBAED,qCAAqC;gBACrC,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5B,IAAA,2BAAY,EACV,OAAO,EACP,cAAc,EACd,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,QAAQ,EACb,YAAY,CACb,CAAC;gBACJ,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
7
node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js
generated
vendored
Normal file
7
node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFixOrSuggest = getFixOrSuggest;
|
||||
function getFixOrSuggest({ useFix, suggestion, }) {
|
||||
return useFix ? { fix: suggestion.fix } : { suggest: [suggestion] };
|
||||
}
|
||||
//# sourceMappingURL=getFixOrSuggest.js.map
|
||||
1
node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js.map
generated
vendored
Normal file
1
node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"getFixOrSuggest.js","sourceRoot":"","sources":["../../src/util/getFixOrSuggest.ts"],"names":[],"mappings":";;AAEA,0CAUC;AAVD,SAAgB,eAAe,CAA2B,EACxD,MAAM,EACN,UAAU,GAIX;IAGC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;AACtE,CAAC"}
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js
generated
vendored
|
|
@ -35,7 +35,7 @@ function getWrappingFixer(params) {
|
|||
}
|
||||
}
|
||||
// check if we need to insert semicolon
|
||||
if (/^[`([]/.exec(code) && isMissingSemicolonBefore(node, sourceCode)) {
|
||||
if (/^[`([]/.test(code) && isMissingSemicolonBefore(node, sourceCode)) {
|
||||
code = `;${code}`;
|
||||
}
|
||||
return fixer.replaceText(node, code);
|
||||
|
|
|
|||
1
node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js
generated
vendored
1
node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js
generated
vendored
|
|
@ -34,6 +34,7 @@ __exportStar(require("./objectIterators"), exports);
|
|||
__exportStar(require("./scopeUtils"), exports);
|
||||
__exportStar(require("./types"), exports);
|
||||
__exportStar(require("./isAssignee"), exports);
|
||||
__exportStar(require("./getFixOrSuggest"), exports);
|
||||
// this is done for convenience - saves migrating all of the old rules
|
||||
__exportStar(require("@typescript-eslint/type-utils"), exports);
|
||||
const { applyDefault, deepMerge, isObjectNotArray, getParserServices, nullThrows, NullThrowsReasons, } = utils_1.ESLintUtils;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAuD;AAEvD,6CAA2B;AAC3B,2DAAyC;AACzC,+CAA6B;AAC7B,uDAAqC;AACrC,0DAAwC;AACxC,yDAAuC;AACvC,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,yCAAuB;AACvB,oDAAkC;AAClC,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B;AAE7B,sEAAsE;AACtE,gEAA8C;AAC9C,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GAClB,GAAG,mBAAW,CAAC;AAMd,oCAAY;AACZ,8BAAS;AACT,4CAAgB;AAChB,8CAAiB;AACjB,gCAAU;AAGV,8CAAiB"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAuD;AAEvD,6CAA2B;AAC3B,2DAAyC;AACzC,+CAA6B;AAC7B,uDAAqC;AACrC,0DAAwC;AACxC,yDAAuC;AACvC,oDAAkC;AAClC,2DAAyC;AACzC,sDAAoC;AACpC,qDAAmC;AACnC,gDAA8B;AAC9B,kDAAgC;AAChC,0DAAwC;AACxC,yCAAuB;AACvB,oDAAkC;AAClC,+CAA6B;AAC7B,0CAAwB;AACxB,+CAA6B;AAC7B,oDAAkC;AAElC,sEAAsE;AACtE,gEAA8C;AAC9C,MAAM,EACJ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,GAClB,GAAG,mBAAW,CAAC;AAMd,oCAAY;AACZ,8BAAS;AACT,4CAAgB;AAChB,8CAAiB;AACjB,gCAAU;AAGV,8CAAiB"}
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/util/misc.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAuOD,8CAAiB;AACjB,wCAAc;AAGd,0CAAe;AACf,wCAAc;AACd,oCAAY;AACZ,8DAAyB;AACzB,8CAAiB;AACjB,4CAAgB;AAChB,gEAA0B;AAC1B,4DAAwB;AAGxB,kEAA2B;AAC3B,wCAAc;AACd,sCAAa;AArPf,8DAAgE;AAEhE,oDAA0D;AAC1D,+CAAiC;AAEjC,yCAA6C;AAE7C,MAAM,qBAAqB,GAAG;IAC5B,EAAE,CAAC,SAAS,CAAC,GAAG;IAChB,EAAE,CAAC,SAAS,CAAC,IAAI;IACjB,EAAE,CAAC,SAAS,CAAC,IAAI;CACT,CAAC;AACX;;GAEG;AACH,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC7C,KAAK,MAAM,aAAa,IAAI,qBAAqB,EAAE,CAAC;QAClD,IAAI,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,iBAAiB,CACxB,K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/docs/rules/ban-types.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
The old `ban-types` rule encompassed multiple areas of functionality, and so has been split into several rules.
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/block-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.mdx) rule.
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/key-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-around-comment.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.mdx
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.mdx
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule.
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
151
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx
generated
vendored
151
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx
generated
vendored
|
|
@ -37,10 +37,89 @@ If you don't want to check conditionals, you can configure the rule with `"check
|
|||
|
||||
Doing so prevents the rule from looking at code like `if (somePromise)`.
|
||||
|
||||
Examples of code for this rule with `checksConditionals: true`:
|
||||
### `checksVoidReturn`
|
||||
|
||||
Likewise, if you don't want to check functions that return promises where a void return is
|
||||
expected, your configuration will look like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can disable selective parts of the `checksVoidReturn` option by providing an object that disables specific checks. For example, if you don't mind that passing a `() => Promise<void>` to a `() => void` parameter or JSX attribute can lead to a floating unhandled Promise:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": {
|
||||
"arguments": false,
|
||||
"attributes": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
The following sub-options are supported:
|
||||
|
||||
#### `arguments`
|
||||
|
||||
Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`.
|
||||
|
||||
#### `attributes`
|
||||
|
||||
Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`.
|
||||
|
||||
#### `inheritedMethods`
|
||||
|
||||
Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`.
|
||||
|
||||
:::note
|
||||
For now, `no-misused-promises` only checks _named_ methods against extended/implemented types: that is, call/construct/index signatures are ignored. Call signatures are not required in TypeScript to be consistent with one another, and construct signatures cannot be `async` in the first place. Index signature checking may be implemented in the future.
|
||||
:::
|
||||
|
||||
#### `properties`
|
||||
|
||||
Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`.
|
||||
|
||||
#### `returns`
|
||||
|
||||
Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`.
|
||||
|
||||
#### `variables`
|
||||
|
||||
Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`.
|
||||
|
||||
### `checksSpreads`
|
||||
|
||||
If you don't want to check object spreads, you can add this configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksSpreads": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### `checksConditionals`
|
||||
|
||||
Examples of code for this rule with `checksConditionals: true`:
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="❌ Incorrect">
|
||||
|
||||
|
|
@ -81,45 +160,6 @@ while (await promise) {
|
|||
|
||||
### `checksVoidReturn`
|
||||
|
||||
Likewise, if you don't want to check functions that return promises where a void return is
|
||||
expected, your configuration will look like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can disable selective parts of the `checksVoidReturn` option by providing an object that disables specific checks.
|
||||
The following options are supported:
|
||||
|
||||
- `arguments`: Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`
|
||||
- `attributes`: Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`
|
||||
- `properties`: Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`
|
||||
- `returns`: Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`
|
||||
- `variables`: Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`
|
||||
|
||||
For example, if you don't mind that passing a `() => Promise<void>` to a `() => void` parameter or JSX attribute can lead to a floating unhandled Promise:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksVoidReturn": {
|
||||
"arguments": false,
|
||||
"attributes": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Examples of code for this rule with `checksVoidReturn: true`:
|
||||
|
||||
<Tabs>
|
||||
|
|
@ -140,6 +180,15 @@ document.addEventListener('click', async () => {
|
|||
await fetch('/');
|
||||
console.log('synchronous call');
|
||||
});
|
||||
|
||||
interface MySyncInterface {
|
||||
setThing(): void;
|
||||
}
|
||||
class MyClass implements MySyncInterface {
|
||||
async setThing(): Promise<void> {
|
||||
this.thing = await fetchThing();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
|
@ -182,6 +231,15 @@ document.addEventListener('click', () => {
|
|||
|
||||
handler().catch(handleError);
|
||||
});
|
||||
|
||||
interface MyAsyncInterface {
|
||||
setThing(): Promise<void>;
|
||||
}
|
||||
class MyClass implements MyAsyncInterface {
|
||||
async setThing(): Promise<void> {
|
||||
this.thing = await fetchThing();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
|
@ -189,19 +247,6 @@ document.addEventListener('click', () => {
|
|||
|
||||
### `checksSpreads`
|
||||
|
||||
If you don't want to check object spreads, you can add this configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"@typescript-eslint/no-misused-promises": [
|
||||
"error",
|
||||
{
|
||||
"checksSpreads": false
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Examples of code for this rule with `checksSpreads: true`:
|
||||
|
||||
<Tabs>
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.mdx
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.mdx
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been deprecated in favour of the [`parameter-properties`](https://typescript-eslint.io/rules/parameter-properties/) rule.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
description: 'Disallow type parameters that only appear once.'
|
||||
description: "Disallow type parameters that aren't used multiple times."
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
|
|
@ -9,10 +9,10 @@ import TabItem from '@theme/TabItem';
|
|||
>
|
||||
> See **https://typescript-eslint.io/rules/no-unnecessary-type-parameters** for documentation.
|
||||
|
||||
This rule forbids type parameters that only appear once in a function, method, or class definition.
|
||||
This rule forbids type parameters that aren't used multiple times in a function, method, or class definition.
|
||||
|
||||
Type parameters relate two types.
|
||||
If a type parameter only appears once, then it is not relating anything.
|
||||
If a type parameter is only used once, then it is not relating anything.
|
||||
It can usually be replaced with explicit types such as `unknown`.
|
||||
|
||||
At best unnecessary type parameters make code harder to read.
|
||||
|
|
|
|||
10
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.mdx
generated
vendored
10
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.mdx
generated
vendored
|
|
@ -15,7 +15,7 @@ Using `any` disables many type checking rules and is generally best used only as
|
|||
Despite your best intentions, the `any` type can sometimes leak into your codebase.
|
||||
Returning an an `any`-typed value from a function creates a potential type safety hole and source of bugs in your codebase.
|
||||
|
||||
This rule disallows returning `any` or `any[]` from a function.
|
||||
This rule disallows returning `any` or `any[]` from a function and returning `Promise<any>` from an async function.
|
||||
|
||||
This rule also compares generic type argument types to ensure you don't return an unsafe `any` in a generic position to a function that's expecting a specific type.
|
||||
For example, it will error if you return `Set<any>` from a function declared as returning `Set<string>`.
|
||||
|
|
@ -56,6 +56,10 @@ const foo10 = () => [] as any[];
|
|||
|
||||
const foo11 = (): string[] => [1, 2, 3] as any[];
|
||||
|
||||
async function foo13() {
|
||||
return Promise.resolve({} as any);
|
||||
}
|
||||
|
||||
// generic position examples
|
||||
function assignability1(): Set<string> {
|
||||
return new Set<any>([1]);
|
||||
|
|
@ -78,6 +82,10 @@ function foo2() {
|
|||
const foo3 = () => [];
|
||||
const foo4 = () => ['a'];
|
||||
|
||||
async function foo5() {
|
||||
return Promise.resolve(1);
|
||||
}
|
||||
|
||||
function assignability1(): Set<string> {
|
||||
return new Set<string>(['foo']);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been renamed to [`no-unnecessary-template-expression`](./no-unnecessary-template-expression.mdx). See [#8544](https://github.com/typescript-eslint/typescript-eslint/issues/8544) for more information.
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been renamed to [`sort-type-constituents`](https://typescript-eslint.io/rules/sort-type-constituents).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ The following nodes are considered boolean expressions and their type is checked
|
|||
|
||||
```ts
|
||||
// nullable numbers are considered unsafe by default
|
||||
let num: number | undefined = 0;
|
||||
declare const num: number | undefined;
|
||||
if (num) {
|
||||
console.log('num is defined');
|
||||
}
|
||||
|
||||
// nullable strings are considered unsafe by default
|
||||
let str: string | null = null;
|
||||
declare const str: string | null;
|
||||
if (!str) {
|
||||
console.log('str is empty');
|
||||
}
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md
generated
vendored
|
|
@ -1,3 +1,7 @@
|
|||
---
|
||||
displayed_sidebar: rulesSidebar
|
||||
---
|
||||
|
||||
:::danger Deprecated
|
||||
|
||||
This rule has been moved to the [ESLint stylistic plugin](https://eslint.style).
|
||||
|
|
|
|||
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
14
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/eslint-plugin",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "TypeScript plugin for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -60,10 +60,10 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "8.0.1",
|
||||
"@typescript-eslint/type-utils": "8.0.1",
|
||||
"@typescript-eslint/utils": "8.0.1",
|
||||
"@typescript-eslint/visitor-keys": "8.0.1",
|
||||
"@typescript-eslint/scope-manager": "8.1.0",
|
||||
"@typescript-eslint/type-utils": "8.1.0",
|
||||
"@typescript-eslint/utils": "8.1.0",
|
||||
"@typescript-eslint/visitor-keys": "8.1.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
|
|
@ -74,8 +74,8 @@
|
|||
"@types/marked": "^5.0.2",
|
||||
"@types/mdast": "^4.0.3",
|
||||
"@types/natural-compare": "*",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "8.0.1",
|
||||
"@typescript-eslint/rule-tester": "8.0.1",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "8.1.0",
|
||||
"@typescript-eslint/rule-tester": "8.1.0",
|
||||
"ajv": "^6.12.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"cross-fetch": "*",
|
||||
|
|
|
|||
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
10
node_modules/@typescript-eslint/parser/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/parser",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "An ESLint custom parser which leverages TypeScript ESTree",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -52,10 +52,10 @@
|
|||
"eslint": "^8.57.0 || ^9.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.0.1",
|
||||
"@typescript-eslint/types": "8.0.1",
|
||||
"@typescript-eslint/typescript-estree": "8.0.1",
|
||||
"@typescript-eslint/visitor-keys": "8.0.1",
|
||||
"@typescript-eslint/scope-manager": "8.1.0",
|
||||
"@typescript-eslint/types": "8.1.0",
|
||||
"@typescript-eslint/typescript-estree": "8.1.0",
|
||||
"@typescript-eslint/visitor-keys": "8.1.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
8
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/scope-manager",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "TypeScript scope analyser for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -46,13 +46,13 @@
|
|||
"typecheck": "npx nx typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.0.1",
|
||||
"@typescript-eslint/visitor-keys": "8.0.1"
|
||||
"@typescript-eslint/types": "8.1.0",
|
||||
"@typescript-eslint/visitor-keys": "8.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/types": "29.6.3",
|
||||
"@types/glob": "*",
|
||||
"@typescript-eslint/typescript-estree": "8.0.1",
|
||||
"@typescript-eslint/typescript-estree": "8.1.0",
|
||||
"glob": "*",
|
||||
"jest-specific-snapshot": "*",
|
||||
"make-dir": "*",
|
||||
|
|
|
|||
9
node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts
generated
vendored
9
node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts
generated
vendored
|
|
@ -31,14 +31,15 @@ export declare function isTypeAnyArrayType(type: ts.Type, checker: ts.TypeChecke
|
|||
export declare function isTypeUnknownArrayType(type: ts.Type, checker: ts.TypeChecker): boolean;
|
||||
export declare enum AnyType {
|
||||
Any = 0,
|
||||
AnyArray = 1,
|
||||
Safe = 2
|
||||
PromiseAny = 1,
|
||||
AnyArray = 2,
|
||||
Safe = 3
|
||||
}
|
||||
/**
|
||||
* @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`,
|
||||
* @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, `AnyType.PromiseAny` if the type is `Promise<any>`,
|
||||
* otherwise it returns `AnyType.Safe`.
|
||||
*/
|
||||
export declare function isAnyOrAnyArrayTypeDiscriminated(node: ts.Node, checker: ts.TypeChecker): AnyType;
|
||||
export declare function discriminateAnyType(type: ts.Type, checker: ts.TypeChecker, program: ts.Program, tsNode: ts.Node): AnyType;
|
||||
/**
|
||||
* @returns Whether a type is an instance of the parent type, including for the parent's base types.
|
||||
*/
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAMjC;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAQrD;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAQT;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAExD;AAYD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,aAAa,CAM3E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAQpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAKT;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,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aAAa,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAQpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAKT;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,GACtB,OAAO,CAKT;AAED,oBAAY,OAAO;IACjB,GAAG,IAAA;IACH,UAAU,IAAA;IACV,QAAQ,IAAA;IACR,IAAI,IAAA;CACL;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,OAAO,EAAE,EAAE,CAAC,OAAO,EACnB,MAAM,EAAE,EAAE,CAAC,IAAI,GACd,OAAO,CAyBT;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,EAAE,EAAE,CAAC,IAAI,GAClB,OAAO,CAqBT;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI,EAAE,CAAC,iBAAiB,CAE9B;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,EAAE,CAAC,IAAI,GACZ,IAAI,IAAI,EAAE,CAAC,mBAAmB,CAEhC"}
|
||||
23
node_modules/@typescript-eslint/type-utils/dist/predicates.js
generated
vendored
23
node_modules/@typescript-eslint/type-utils/dist/predicates.js
generated
vendored
|
|
@ -35,7 +35,7 @@ exports.isTypeReferenceType = isTypeReferenceType;
|
|||
exports.isTypeAnyType = isTypeAnyType;
|
||||
exports.isTypeAnyArrayType = isTypeAnyArrayType;
|
||||
exports.isTypeUnknownArrayType = isTypeUnknownArrayType;
|
||||
exports.isAnyOrAnyArrayTypeDiscriminated = isAnyOrAnyArrayTypeDiscriminated;
|
||||
exports.discriminateAnyType = discriminateAnyType;
|
||||
exports.typeIsOrHasBaseType = typeIsOrHasBaseType;
|
||||
exports.isTypeBigIntLiteralType = isTypeBigIntLiteralType;
|
||||
exports.isTypeTemplateLiteralType = isTypeTemplateLiteralType;
|
||||
|
|
@ -122,21 +122,32 @@ function isTypeUnknownArrayType(type, checker) {
|
|||
var AnyType;
|
||||
(function (AnyType) {
|
||||
AnyType[AnyType["Any"] = 0] = "Any";
|
||||
AnyType[AnyType["AnyArray"] = 1] = "AnyArray";
|
||||
AnyType[AnyType["Safe"] = 2] = "Safe";
|
||||
AnyType[AnyType["PromiseAny"] = 1] = "PromiseAny";
|
||||
AnyType[AnyType["AnyArray"] = 2] = "AnyArray";
|
||||
AnyType[AnyType["Safe"] = 3] = "Safe";
|
||||
})(AnyType || (exports.AnyType = AnyType = {}));
|
||||
/**
|
||||
* @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`,
|
||||
* @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, `AnyType.PromiseAny` if the type is `Promise<any>`,
|
||||
* otherwise it returns `AnyType.Safe`.
|
||||
*/
|
||||
function isAnyOrAnyArrayTypeDiscriminated(node, checker) {
|
||||
const type = checker.getTypeAtLocation(node);
|
||||
function discriminateAnyType(type, checker, program, tsNode) {
|
||||
if (isTypeAnyType(type)) {
|
||||
return AnyType.Any;
|
||||
}
|
||||
if (isTypeAnyArrayType(type, checker)) {
|
||||
return AnyType.AnyArray;
|
||||
}
|
||||
for (const part of tsutils.typeParts(type)) {
|
||||
if (tsutils.isThenableType(checker, tsNode, type)) {
|
||||
const awaitedType = checker.getAwaitedType(part);
|
||||
if (awaitedType) {
|
||||
const awaitedAnyType = discriminateAnyType(awaitedType, checker, program, tsNode);
|
||||
if (awaitedAnyType === AnyType.Any) {
|
||||
return AnyType.PromiseAny;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return AnyType.Safe;
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/type-utils/dist/predicates.js.map
generated
vendored
2
node_modules/@typescript-eslint/type-utils/dist/predicates.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../src/predicates.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,wCAQC;AAMD,gFAWC;AAKD,0CAEC;AAKD,8CAEC;AAYD,kDAMC;AAKD,sCAQC;AAKD,gDAQC;AAKD,wDAQC;AAWD,4EAYC;AAKD,kDAwBC;AAED,0DAIC;AAED,8DAIC;AA3KD,kDAA0B;AAC1B,sDAAwC;AACxC,+CAAiC;AAEjC,mDAAgD;AAEhD,MAAM,GAAG,GAAG,IAAA,eAAK,EAAC,6CAA6C,CAAC,CAAC;AAEjE;;GAEG;AACH,SAAgB,cAAc,CAAC,IAAa;IAC1C,OAAO,IAAA,6BAAa,EAClB,IAAI,EACJ,EAAE,CAAC,SAAS,CAAC,GAAG;QACd,EAAE,CAAC,SAAS,CAAC,OAAO;QACpB,EAAE,CAAC,SAAS,CAAC,IAAI;QACjB,EAAE,CAAC,SAAS,CAAC,SAAS,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,kCAAkC,CAChD,IAAa,EACb,OAAuB;IAEvB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAa;IAC3C,OAAO,IAAA,6BAAa,EAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACjD,CAA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CACvC,IAAa;IAEb,OAAO,IAAA,6BAAa,EAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;AAC3D,CAAC"}
|
||||
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
8
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/type-utils",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "Type utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -46,14 +46,14 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "8.0.1",
|
||||
"@typescript-eslint/utils": "8.0.1",
|
||||
"@typescript-eslint/typescript-estree": "8.1.0",
|
||||
"@typescript-eslint/utils": "8.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/types": "29.6.3",
|
||||
"@typescript-eslint/parser": "8.0.1",
|
||||
"@typescript-eslint/parser": "8.1.0",
|
||||
"ajv": "^6.12.6",
|
||||
"downlevel-dts": "*",
|
||||
"jest": "29.7.0",
|
||||
|
|
|
|||
164
node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts
generated
vendored
164
node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts
generated
vendored
|
|
@ -445,6 +445,18 @@ export declare interface ConditionalExpression extends BaseNode {
|
|||
consequent: Expression;
|
||||
alternate: Expression;
|
||||
}
|
||||
export declare interface ConstDeclaration extends LetOrConstOrVarDeclarationBase {
|
||||
kind: 'const';
|
||||
/**
|
||||
* In a `declare const` declaration, the declarators may have initializers, but
|
||||
* not definite assignment assertions. Each declarator cannot have both an
|
||||
* initializer and a type annotation.
|
||||
*
|
||||
* Even if the declaration has no `declare`, it may still be ambient and have
|
||||
* no initializer.
|
||||
*/
|
||||
declarations: VariableDeclaratorMaybeInit[];
|
||||
}
|
||||
export declare interface ContinueStatement extends BaseNode {
|
||||
type: AST_NODE_TYPES.ContinueStatement;
|
||||
label: Identifier | null;
|
||||
|
|
@ -917,11 +929,12 @@ export declare interface LabeledStatement extends BaseNode {
|
|||
body: Statement;
|
||||
}
|
||||
export declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion;
|
||||
export declare interface LetOrConstOrVarDeclaration extends BaseNode {
|
||||
export declare type LetOrConstOrVarDeclaration = ConstDeclaration | LetOrVarDeclaredDeclaration | LetOrVarNonDeclaredDeclaration;
|
||||
declare interface LetOrConstOrVarDeclarationBase extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclaration;
|
||||
/**
|
||||
* The variables declared by this declaration.
|
||||
* Note that there may be 0 declarations (i.e. `const;`).
|
||||
* Always non-empty.
|
||||
* @example
|
||||
* ```ts
|
||||
* let x;
|
||||
|
|
@ -948,11 +961,30 @@ export declare interface LetOrConstOrVarDeclaration extends BaseNode {
|
|||
*/
|
||||
kind: 'const' | 'let' | 'var';
|
||||
}
|
||||
export declare interface LetOrConstOrVarDeclarator extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
id: BindingName;
|
||||
init: Expression | null;
|
||||
definite: boolean;
|
||||
export declare type LetOrConstOrVarDeclarator = VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit | VariableDeclaratorNoInit;
|
||||
export declare interface LetOrVarDeclaredDeclaration extends LetOrConstOrVarDeclarationBase {
|
||||
kind: 'let' | 'var';
|
||||
declare: true;
|
||||
/**
|
||||
* In a `declare let` declaration, the declarators must not have definite assignment
|
||||
* assertions or initializers.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* using x = 1;
|
||||
* using y =1, z = 2;
|
||||
* ```
|
||||
*/
|
||||
declarations: VariableDeclaratorNoInit[];
|
||||
}
|
||||
export declare interface LetOrVarNonDeclaredDeclaration extends LetOrConstOrVarDeclarationBase {
|
||||
kind: 'let' | 'var';
|
||||
declare: false;
|
||||
/**
|
||||
* In a `let`/`var` declaration, the declarators may have definite assignment
|
||||
* assertions or initializers, but not both.
|
||||
*/
|
||||
declarations: (VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit)[];
|
||||
}
|
||||
export declare interface LineComment extends BaseToken {
|
||||
type: AST_TOKEN_TYPES.Line;
|
||||
|
|
@ -1996,57 +2028,8 @@ export declare interface UpdateExpression extends UnaryExpressionBase {
|
|||
operator: '--' | '++';
|
||||
}
|
||||
export declare type UsingDeclaration = UsingInForOfDeclaration | UsingInNormalContextDeclaration;
|
||||
export declare type UsingDeclarator = UsingInForOfDeclarator | UsingInNomalConextDeclarator;
|
||||
export declare interface UsingInForOfDeclaration extends BaseNode {
|
||||
declare interface UsingDeclarationBase extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclaration;
|
||||
/**
|
||||
* The variables declared by this declaration.
|
||||
* Note that there may be 0 declarations (i.e. `const;`).
|
||||
* @example
|
||||
* ```ts
|
||||
* for(using x of y){}
|
||||
* ```
|
||||
*/
|
||||
declarations: UsingInForOfDeclarator[];
|
||||
/**
|
||||
* This value will always be `false`
|
||||
* because 'declare' modifier cannot appear on a 'using' declaration.
|
||||
*/
|
||||
declare: false;
|
||||
/**
|
||||
* The keyword used to declare the variable(s)
|
||||
* @example
|
||||
* ```ts
|
||||
* for(using x of y){}
|
||||
* for(await using x of y){}
|
||||
* ```
|
||||
*/
|
||||
kind: 'await using' | 'using';
|
||||
}
|
||||
export declare interface UsingInForOfDeclarator extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
id: Identifier;
|
||||
init: null;
|
||||
definite: boolean;
|
||||
}
|
||||
export declare interface UsingInNomalConextDeclarator extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
id: Identifier;
|
||||
init: Expression;
|
||||
definite: boolean;
|
||||
}
|
||||
export declare interface UsingInNormalContextDeclaration extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclaration;
|
||||
/**
|
||||
* The variables declared by this declaration.
|
||||
* Note that there may be 0 declarations (i.e. `const;`).
|
||||
* @example
|
||||
* ```ts
|
||||
* using x = 1;
|
||||
* using y =1, z = 2;
|
||||
* ```
|
||||
*/
|
||||
declarations: UsingInNomalConextDeclarator[];
|
||||
/**
|
||||
* This value will always be `false`
|
||||
* because 'declare' modifier cannot appear on a 'using' declaration.
|
||||
|
|
@ -2062,9 +2045,76 @@ export declare interface UsingInNormalContextDeclaration extends BaseNode {
|
|||
*/
|
||||
kind: 'await using' | 'using';
|
||||
}
|
||||
export declare type UsingDeclarator = UsingInForOfDeclarator | UsingInNormalContextDeclarator;
|
||||
export declare interface UsingInForOfDeclaration extends UsingDeclarationBase {
|
||||
/**
|
||||
* The variables declared by this declaration.
|
||||
* Always has exactly one element.
|
||||
* @example
|
||||
* ```ts
|
||||
* for (using x of y) {}
|
||||
* ```
|
||||
*/
|
||||
declarations: [UsingInForOfDeclarator];
|
||||
}
|
||||
export declare interface UsingInForOfDeclarator extends VariableDeclaratorBase {
|
||||
id: Identifier;
|
||||
init: null;
|
||||
definite: false;
|
||||
}
|
||||
export declare interface UsingInNormalContextDeclaration extends UsingDeclarationBase {
|
||||
/**
|
||||
* The variables declared by this declaration.
|
||||
* Always non-empty.
|
||||
* @example
|
||||
* ```ts
|
||||
* using x = 1;
|
||||
* using y = 1, z = 2;
|
||||
* ```
|
||||
*/
|
||||
declarations: UsingInNormalContextDeclarator[];
|
||||
}
|
||||
export declare interface UsingInNormalContextDeclarator extends VariableDeclaratorBase {
|
||||
id: Identifier;
|
||||
init: Expression;
|
||||
definite: false;
|
||||
}
|
||||
declare type ValueOf<T> = T[keyof T];
|
||||
export declare type VariableDeclaration = LetOrConstOrVarDeclaration | UsingDeclaration;
|
||||
export declare type VariableDeclarator = LetOrConstOrVarDeclarator | UsingDeclarator;
|
||||
declare interface VariableDeclaratorBase extends BaseNode {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
/**
|
||||
* The name(s) of the variable(s).
|
||||
*/
|
||||
id: BindingName;
|
||||
/**
|
||||
* The initializer expression of the variable. Must be present for `const` unless
|
||||
* in a `declare const`.
|
||||
*/
|
||||
init: Expression | null;
|
||||
/**
|
||||
* Whether there's definite assignment assertion (`let x!: number`).
|
||||
* If `true`, then: `id` must be an identifier with a type annotation,
|
||||
* `init` must be `null`, and the declarator must be a `var`/`let` declarator.
|
||||
*/
|
||||
definite: boolean;
|
||||
}
|
||||
export declare interface VariableDeclaratorDefiniteAssignment extends VariableDeclaratorBase {
|
||||
/**
|
||||
* The name of the variable. Must have a type annotation.
|
||||
*/
|
||||
id: Identifier;
|
||||
init: null;
|
||||
definite: true;
|
||||
}
|
||||
export declare interface VariableDeclaratorMaybeInit extends VariableDeclaratorBase {
|
||||
definite: false;
|
||||
}
|
||||
export declare interface VariableDeclaratorNoInit extends VariableDeclaratorBase {
|
||||
init: null;
|
||||
definite: false;
|
||||
}
|
||||
export declare interface WhileStatement extends BaseNode {
|
||||
type: AST_NODE_TYPES.WhileStatement;
|
||||
test: Expression;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
15
node_modules/@typescript-eslint/types/dist/ts-estree.d.ts
generated
vendored
15
node_modules/@typescript-eslint/types/dist/ts-estree.d.ts
generated
vendored
|
|
@ -15,6 +15,21 @@ declare module './generated/ast-spec' {
|
|||
interface AccessorPropertyNonComputedName {
|
||||
parent: TSESTree.ClassBody;
|
||||
}
|
||||
interface VariableDeclaratorDefiniteAssignment {
|
||||
parent: TSESTree.VariableDeclaration;
|
||||
}
|
||||
interface VariableDeclaratorMaybeInit {
|
||||
parent: TSESTree.VariableDeclaration;
|
||||
}
|
||||
interface VariableDeclaratorNoInit {
|
||||
parent: TSESTree.VariableDeclaration;
|
||||
}
|
||||
interface UsingInForOfDeclarator {
|
||||
parent: TSESTree.VariableDeclaration;
|
||||
}
|
||||
interface UsingInNormalContextDeclarator {
|
||||
parent: TSESTree.VariableDeclaration;
|
||||
}
|
||||
interface TSAbstractAccessorPropertyComputedName {
|
||||
parent: TSESTree.ClassBody;
|
||||
}
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/types/dist/ts-estree.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"ts-estree.d.ts","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AAGtD,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,QAAQ;QAChB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC;KACvB;IAED,UAAU,OAAO;QACf;;WAEG;QACH,MAAM,CAAC,EAAE,KAAK,CAAC;KAChB;IAED,UAAU,4BAA4B;QACpC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;KAC5B;IACD,UAAU,+BAA+B;QACvC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;KAC5B;IACD,UAAU,sCAAsC;QAC9C,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;KAC5B;IACD,UAAU,yCAAyC;QACjD,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;KAC5B;IAED,UAAU,WAAW;QACnB,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC;KAC/B;IAED,UAAU,SAAS;QACjB,MAAM,EAAE,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,g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G,QAAQ,CAAC,aAAa,CAAC;KAC3D;IAED,UAAU,aAAa;QACrB,MAAM,EAAE,QAAQ,CAAC,mBAAmB,CAAC;KACtC;IAED,UAAU,mBAAmB;QAC3B,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC;KAC/B;IAED,UAAU,+BAA+B;QACvC,MAAM,EAAE,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC;KAC3D;IACD,UAAU,kCAAkC;QAC1C,MAAM,EAAE,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC;KAC3D;IAED,UAAU,eAAe;QACvB,MAAM,EACF,QAAQ,CAAC,WAAW,GACpB,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,YAAY,CAAC;KAC3B;CACF;AAED,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC"}
|
||||
2
node_modules/@typescript-eslint/types/dist/ts-estree.js.map
generated
vendored
2
node_modules/@typescript-eslint/types/dist/ts-estree.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"ts-estree.js","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2MA,iEAAiD"}
|
||||
{"version":3,"file":"ts-estree.js","sourceRoot":"","sources":["../src/ts-estree.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA+NA,iEAAiD"}
|
||||
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
2
node_modules/@typescript-eslint/types/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/types",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "Types for the TypeScript-ESTree AST spec",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.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,iBAAiB;IAgBzB,OAAO,CAAC,sBAAsB;IA4C9B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IA0FlB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,+BAA+B;IAiDvC;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,sBAAsB;IAoC9B,OAAO,CAAC,uBAAuB;IAQ/B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,qBAAqB;IAsB7B;;;;;OAKG;IACH,OAAO,CAAC,WAAW;CAq1FpB"}
|
||||
70
node_modules/@typescript-eslint/typescript-estree/dist/convert.js
generated
vendored
70
node_modules/@typescript-eslint/typescript-estree/dist/convert.js
generated
vendored
|
|
@ -684,14 +684,15 @@ class Converter {
|
|||
body: this.convertChild(node.statement),
|
||||
});
|
||||
case SyntaxKind.ForInStatement:
|
||||
this.#checkForStatementDeclaration(node.initializer);
|
||||
this.#checkForStatementDeclaration(node.initializer, node.kind);
|
||||
return this.createNode(node, {
|
||||
type: ts_estree_1.AST_NODE_TYPES.ForInStatement,
|
||||
left: this.convertPattern(node.initializer),
|
||||
right: this.convertChild(node.expression),
|
||||
body: this.convertChild(node.statement),
|
||||
});
|
||||
case SyntaxKind.ForOfStatement:
|
||||
case SyntaxKind.ForOfStatement: {
|
||||
this.#checkForStatementDeclaration(node.initializer, node.kind);
|
||||
return this.createNode(node, {
|
||||
type: ts_estree_1.AST_NODE_TYPES.ForOfStatement,
|
||||
left: this.convertPattern(node.initializer),
|
||||
|
|
@ -700,6 +701,7 @@ class Converter {
|
|||
await: Boolean(node.awaitModifier &&
|
||||
node.awaitModifier.kind === SyntaxKind.AwaitKeyword),
|
||||
});
|
||||
}
|
||||
// Declarations
|
||||
case SyntaxKind.FunctionDeclaration: {
|
||||
const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node);
|
||||
|
|
@ -738,11 +740,23 @@ class Converter {
|
|||
return this.fixExports(node, result);
|
||||
}
|
||||
case SyntaxKind.VariableDeclaration: {
|
||||
const definite = !!node.exclamationToken;
|
||||
const init = this.convertChild(node.initializer);
|
||||
const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node);
|
||||
if (definite) {
|
||||
if (init) {
|
||||
this.#throwError(node, 'Declarations with initializers cannot also have definite assignment assertions.');
|
||||
}
|
||||
else if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier ||
|
||||
!id.typeAnnotation) {
|
||||
this.#throwError(node, 'Declarations with definite assignment assertions must also have type annotations.');
|
||||
}
|
||||
}
|
||||
return this.createNode(node, {
|
||||
type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator,
|
||||
definite: !!node.exclamationToken,
|
||||
id: this.convertBindingNameWithTypeAnnotation(node.name, node.type, node),
|
||||
init: this.convertChild(node.initializer),
|
||||
definite,
|
||||
id,
|
||||
init,
|
||||
});
|
||||
}
|
||||
case SyntaxKind.VariableStatement: {
|
||||
|
|
@ -765,6 +779,31 @@ class Converter {
|
|||
}
|
||||
});
|
||||
}
|
||||
// Definite assignment only allowed for non-declare let and var
|
||||
if (result.declare ||
|
||||
['using', 'await using', 'const'].includes(result.kind)) {
|
||||
node.declarationList.declarations.forEach((declaration, i) => {
|
||||
if (result.declarations[i].definite) {
|
||||
this.#throwError(declaration, `A definite assignment assertion '!' is not permitted in this context.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (result.declare) {
|
||||
node.declarationList.declarations.forEach((declaration, i) => {
|
||||
if (result.declarations[i].init &&
|
||||
(['let', 'var'].includes(result.kind) ||
|
||||
result.declarations[i].id.typeAnnotation)) {
|
||||
this.#throwError(declaration, `Initializers are not permitted in ambient contexts.`);
|
||||
}
|
||||
});
|
||||
// Theoretically, only certain initializers are allowed for declare const,
|
||||
// (TS1254: A 'const' initializer in an ambient context must be a string
|
||||
// or numeric literal or literal enum reference.) but we just allow
|
||||
// all expressions
|
||||
}
|
||||
// Note! No-declare does not mean the variable is not ambient, because
|
||||
// it can be further nested in other declare contexts. Therefore we cannot
|
||||
// check for const initializers.
|
||||
/**
|
||||
* Semantically, decorators are not allowed on variable declarations,
|
||||
* Pre 4.8 TS would include them in the AST, so we did as well.
|
||||
|
|
@ -2596,12 +2635,29 @@ class Converter {
|
|||
}
|
||||
throw (0, node_utils_1.createError)(message, this.ast, start, end);
|
||||
}
|
||||
#checkForStatementDeclaration(initializer) {
|
||||
#checkForStatementDeclaration(initializer, kind) {
|
||||
const loop = kind === ts.SyntaxKind.ForInStatement ? 'for...in' : 'for...of';
|
||||
if (ts.isVariableDeclarationList(initializer)) {
|
||||
if ((initializer.flags & ts.NodeFlags.Using) !== 0) {
|
||||
if (initializer.declarations.length !== 1) {
|
||||
this.#throwError(initializer, `Only a single variable declaration is allowed in a '${loop}' statement.`);
|
||||
}
|
||||
const declaration = initializer.declarations[0];
|
||||
if (declaration.initializer) {
|
||||
this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have an initializer.`);
|
||||
}
|
||||
else if (declaration.type) {
|
||||
this.#throwError(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`);
|
||||
}
|
||||
if (kind === ts.SyntaxKind.ForInStatement &&
|
||||
initializer.flags & ts.NodeFlags.Using) {
|
||||
this.#throwError(initializer, "The left-hand side of a 'for...in' statement cannot be a 'using' declaration.");
|
||||
}
|
||||
}
|
||||
else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) &&
|
||||
initializer.kind !== ts.SyntaxKind.ObjectLiteralExpression &&
|
||||
initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
|
||||
this.#throwError(initializer, `The left-hand side of a '${loop}' statement must be a variable or a property access.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Converter = Converter;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map
generated
vendored
2
node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map
generated
vendored
File diff suppressed because one or more lines are too long
1
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js
generated
vendored
1
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js
generated
vendored
|
|
@ -765,6 +765,7 @@ function isValidAssignmentTarget(node) {
|
|||
case SyntaxKind.TypeAssertionExpression:
|
||||
case SyntaxKind.AsExpression:
|
||||
case SyntaxKind.SatisfiesExpression:
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
case SyntaxKind.NonNullExpression:
|
||||
return isValidAssignmentTarget(node.expression);
|
||||
default:
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map
generated
vendored
2
node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map
generated
vendored
File diff suppressed because one or more lines are too long
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
6
node_modules/@typescript-eslint/typescript-estree/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/typescript-estree",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -54,8 +54,8 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.0.1",
|
||||
"@typescript-eslint/visitor-keys": "8.0.1",
|
||||
"@typescript-eslint/types": "8.1.0",
|
||||
"@typescript-eslint/visitor-keys": "8.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
|
|
|
|||
11
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
generated
vendored
11
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
generated
vendored
|
|
@ -10,8 +10,9 @@ export declare namespace SharedConfig {
|
|||
type RuleLevelAndOptions = [RuleLevel, ...unknown[]];
|
||||
type RuleEntry = RuleLevel | RuleLevelAndOptions;
|
||||
type RulesRecord = Partial<Record<string, RuleEntry>>;
|
||||
type GlobalVariableOptionBase = 'off' | 'readonly' | 'writable';
|
||||
type GlobalVariableOption = GlobalVariableOptionBase | boolean;
|
||||
type GlobalVariableOptionBase = 'off' | 'readonly' | 'writable' | /** @deprecated use `'writable'` */ 'writeable' | /** @deprecated use `'readonly'` */ 'readable';
|
||||
type GlobalVariableOptionBoolean = /** @deprecated use `'writable'` */ true | /** @deprecated use `'readonly'` */ false;
|
||||
type GlobalVariableOption = GlobalVariableOptionBase | GlobalVariableOptionBoolean;
|
||||
interface GlobalsConfig {
|
||||
[name: string]: GlobalVariableOption;
|
||||
}
|
||||
|
|
@ -181,7 +182,7 @@ export declare namespace FlatConfig {
|
|||
* Set to `"latest"` for the most recent supported version.
|
||||
* @default "latest"
|
||||
*/
|
||||
ecmaVersion?: EcmaVersion;
|
||||
ecmaVersion?: EcmaVersion | undefined;
|
||||
/**
|
||||
* An object specifying additional objects that should be added to the global scope during linting.
|
||||
*/
|
||||
|
|
@ -194,7 +195,7 @@ export declare namespace FlatConfig {
|
|||
* require('espree')
|
||||
* ```
|
||||
*/
|
||||
parser?: Parser;
|
||||
parser?: Parser | undefined;
|
||||
/**
|
||||
* An object specifying additional options that are passed directly to the parser.
|
||||
* The available options are parser-dependent.
|
||||
|
|
@ -211,7 +212,7 @@ export declare namespace FlatConfig {
|
|||
* "commonjs"
|
||||
* ```
|
||||
*/
|
||||
sourceType?: SourceType;
|
||||
sourceType?: SourceType | undefined;
|
||||
}
|
||||
interface Config {
|
||||
/**
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"Config.d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AAW,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;QACtC;;WAEG;QACH,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QACpC;;;;;;;WAOG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B;;;WAGG;QACH,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;QAC1C;;;;;;;;;;WAUG;QACH,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;KACrC;IAID,UAAiB,MAAM;QACrB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;;WAGG;QACH,KAAK,CAAC,EAAE,CACJ,MAAM,GAEN,MAAM,EAAE,CACX,EAAE,CAAC;QACJ;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB;;WAEG;QACH,eAAe,CAAC,EAAE,eAAe,CAAC;QAClC;;WAEG;QACH,aAAa,CAAC,EAAE,aAAa,CAAC;QAC9B;;;WAGG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B;;;WAGG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;QACd;;WAEG;QACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;IACD,KAAY,WAAW,GAAG,MAAM,EAAE,CAAC;IACnC,KAAY,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,KAAY,UAAU,GAAG,WAAW,GAAG,aAAa,CAAC;CACtD"}
|
||||
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"ESLint.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":"AAEA,OAAO;AAEL;;GAEG;AACH,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
|
||||
{"version":3,"file":"ESLint.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":"AAAA,OAAO;AAEL;;GAEG;AACH,YAAY,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
|
||||
1
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
generated
vendored
1
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
generated
vendored
|
|
@ -1,5 +1,4 @@
|
|||
"use strict";
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ESLint = exports.FlatESLint = exports.LegacyESLint = void 0;
|
||||
var LegacyESLint_1 = require("./eslint/LegacyESLint");
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js.map
generated
vendored
2
node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"ESLint.js","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,sDAM+B;AAL7B,mDAAmD;AACnD;;GAEG;AACH,4GAAA,YAAY,OAAA;AAEd,kDAAiD;AAAxC,wGAAA,UAAU,OAAA;AACnB,kDAA2D;AAAlD,oGAAA,UAAU,OAAU"}
|
||||
{"version":3,"file":"ESLint.js","sourceRoot":"","sources":["../../src/ts-eslint/ESLint.ts"],"names":[],"mappings":";;;AAAA,sDAM+B;AAL7B,mDAAmD;AACnD;;GAEG;AACH,4GAAA,YAAY,OAAA;AAEd,kDAAiD;AAAxC,wGAAA,UAAU,OAAA;AACnB,kDAA2D;AAAlD,oGAAA,UAAU,OAAU"}
|
||||
8
node_modules/@typescript-eslint/utils/package.json
generated
vendored
8
node_modules/@typescript-eslint/utils/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/utils",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "Utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -64,9 +64,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@typescript-eslint/scope-manager": "8.0.1",
|
||||
"@typescript-eslint/types": "8.0.1",
|
||||
"@typescript-eslint/typescript-estree": "8.0.1"
|
||||
"@typescript-eslint/scope-manager": "8.1.0",
|
||||
"@typescript-eslint/types": "8.1.0",
|
||||
"@typescript-eslint/typescript-estree": "8.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^8.57.0 || ^9.0.0"
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
4
node_modules/@typescript-eslint/visitor-keys/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/visitor-keys",
|
||||
"version": "8.0.1",
|
||||
"version": "8.1.0",
|
||||
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -47,7 +47,7 @@
|
|||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.0.1",
|
||||
"@typescript-eslint/types": "8.1.0",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue