Merge pull request #2345 from github/dependabot/npm_and_yarn/npm-5c2f2cbc05

Bump the npm group with 2 updates
This commit is contained in:
Angela P Wen 2024-06-18 14:07:21 +04:00 committed by GitHub
commit c8f2e2ddaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 294 additions and 197 deletions

84
node_modules/.package-lock.json generated vendored
View file

@ -960,16 +960,16 @@
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz",
"integrity": "sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.1.tgz",
"integrity": "sha512-kZqi+WZQaZfPKnsflLJQCz6Ze9FFSMfXrrIOcyargekQxG37ES7DJNpJUE9Q/X5n3yTIP/WPutVNzgknQ7biLg==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/type-utils": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/type-utils": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@ -993,15 +993,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.0.tgz",
"integrity": "sha512-EjMfl69KOS9awXXe83iRN7oIEXy9yYdqWfqdrFAYAAr6syP8eLEFI7ZE4939antx2mNgPRW/o1ybm2SFYkbTVA==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.1.tgz",
"integrity": "sha512-1ELDPlnLvDQ5ybTSrMhRTFDfOQEOXNM+eP+3HT/Yq7ruWpciQw+Avi73pdEbA4SooCawEWo3dtYbF68gN7Ed1A==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4"
},
"engines": {
@ -1021,13 +1021,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.0.tgz",
"integrity": "sha512-ZrMCe1R6a01T94ilV13egvcnvVJ1pxShkE0+NDjDzH4nvG1wXpwsVI5bZCvE7AEDH1mXEx5tJSVR68bLgG7Dng==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.1.tgz",
"integrity": "sha512-adbXNVEs6GmbzaCpymHQ0MB6E4TqoiVbC0iqG3uijR8ZYfpAXMGttouQzF4Oat3P2GxDVIrg7bMI/P65LiQZdg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0"
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1038,13 +1038,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.0.tgz",
"integrity": "sha512-xMEtMzxq9eRkZy48XuxlBFzpVMDurUAfDu5Rz16GouAtXm0TaAoTFzqWUFPPuQYXI/CDaH/Bgx/fk/84t/Bc9A==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.1.tgz",
"integrity": "sha512-aWDbLu1s9bmgPGXSzNCxELu+0+HQOapV/y+60gPXafR8e2g1Bifxzevaa+4L2ytCWm+CHqpELq4CSoN9ELiwCg==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
@ -1065,9 +1065,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.0.tgz",
"integrity": "sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz",
"integrity": "sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1078,13 +1078,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.0.tgz",
"integrity": "sha512-cAvBvUoobaoIcoqox1YatXOnSl3gx92rCZoMRPzMNisDiM12siGilSM4+dJAekuuHTibI2hVC2fYK79iSFvWjw==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.1.tgz",
"integrity": "sha512-uxNr51CMV7npU1BxZzYjoVz9iyjckBduFBP0S5sLlh1tXYzHzgZ3BR9SVsNed+LmwKrmnqN3Kdl5t7eZ5TS1Yw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1130,15 +1130,15 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.0.tgz",
"integrity": "sha512-jceD8RgdKORVnB4Y6BqasfIkFhl4pajB1wVxrF4akxD2QPM8GNYjgGwEzYS+437ewlqqrg7Dw+6dhdpjMpeBFQ==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.1.tgz",
"integrity": "sha512-h5MzFBD5a/Gh/fvNdp9pTfqJAbuQC4sCN2WzuXme71lqFJsZtLbjxfSk4r3p02WIArOF9N94pdsLiGutpDbrXQ==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0"
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1152,12 +1152,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.0.tgz",
"integrity": "sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.1.tgz",
"integrity": "sha512-k/Bfne7lrP7hcb7m9zSsgcBmo+8eicqqfNAJ7uUY+jkTFpKeH2FSkWpFRtimBxgkyvqfu9jTPRbYOvud6isdXA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {

View file

@ -2,6 +2,7 @@
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getMemberHeadLoc_1 = require("../util/getMemberHeadLoc");
exports.default = (0, util_1.createRule)({
name: 'explicit-member-accessibility',
meta: {
@ -119,7 +120,7 @@ exports.default = (0, util_1.createRule)({
}
else if (check === 'explicit' && !methodDefinition.accessibility) {
context.report({
loc: getMissingAccessibilityReportLoc(methodDefinition),
loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, methodDefinition),
messageId: 'missingAccessibility',
data: {
type: nodeType,
@ -163,57 +164,6 @@ exports.default = (0, util_1.createRule)({
}
return { range: keywordRange, rangeToRemove };
}
/**
* For missing accessibility modifiers, we want to report any keywords
* out in front of the key, and the key itself, but not anything afterwards,
* i.e. parens, type annotations, method bodies, or `?`.
*/
function getMissingAccessibilityReportLoc(node) {
let start;
if (node.decorators.length === 0) {
start = node.loc.start;
}
else {
const lastDecorator = node.decorators[node.decorators.length - 1];
const nextToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(lastDecorator), util_1.NullThrowsReasons.MissingToken('token', 'last decorator'));
start = nextToken.loc.start;
}
let end;
if (!node.computed) {
end = node.key.loc.end;
}
else {
const closingBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.key, token => token.value === ']'), util_1.NullThrowsReasons.MissingToken(']', node.type));
end = closingBracket.loc.end;
}
return {
start: structuredClone(start),
end: structuredClone(end),
};
}
/**
* For missing accessibility modifiers, we want to report any keywords
* out in front of the key, and the key itself, but not anything afterwards,
* i.e. parens, type annotations, method bodies, or `?`.
*/
function getMissingAccessibilityReportLocForParameterProperty(node, nodeName) {
// Parameter properties have a weirdly different AST structure
// than other class members.
let start;
if (node.decorators.length === 0) {
start = structuredClone(node.loc.start);
}
else {
const lastDecorator = node.decorators[node.decorators.length - 1];
const nextToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(lastDecorator), util_1.NullThrowsReasons.MissingToken('token', 'last decorator'));
start = structuredClone(nextToken.loc.start);
}
const end = context.sourceCode.getLocFromIndex(node.parameter.range[0] + nodeName.length);
return {
start,
end,
};
}
/**
* Creates a fixer that adds an accessibility modifier keyword
*/
@ -270,7 +220,7 @@ exports.default = (0, util_1.createRule)({
else if (propCheck === 'explicit' &&
!propertyDefinition.accessibility) {
context.report({
loc: getMissingAccessibilityReportLoc(propertyDefinition),
loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, propertyDefinition),
messageId: 'missingAccessibility',
data: {
type: nodeType,
@ -299,7 +249,7 @@ exports.default = (0, util_1.createRule)({
case 'explicit': {
if (!node.accessibility) {
context.report({
loc: getMissingAccessibilityReportLocForParameterProperty(node, nodeName),
loc: (0, getMemberHeadLoc_1.getParameterPropertyHeadLoc)(context.sourceCode, node, nodeName),
messageId: 'missingAccessibility',
data: {
type: nodeType,

File diff suppressed because one or more lines are too long

View file

@ -26,6 +26,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
function createDataType(type) {
const isErrorType = tsutils.isIntrinsicErrorType(type);
return isErrorType ? '`error` typed' : '`any`';
}
exports.default = (0, util_1.createRule)({
name: 'no-unsafe-member-access',
meta: {
@ -36,12 +40,12 @@ exports.default = (0, util_1.createRule)({
requiresTypeChecking: true,
},
messages: {
unsafeMemberExpression: 'Unsafe member access {{property}} on an `any` value.',
unsafeMemberExpression: 'Unsafe member access {{property}} on an {{type}} value.',
unsafeThisMemberExpression: [
'Unsafe member access {{property}} on an `any` value. `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'),
unsafeComputedMemberAccess: 'Computed name {{property}} resolves to an any value.',
unsafeComputedMemberAccess: 'Computed name {{property}} resolves to an {{type}} value.',
},
schema: [],
},
@ -84,6 +88,7 @@ exports.default = (0, util_1.createRule)({
messageId,
data: {
property: node.computed ? `[${propertyName}]` : `.${propertyName}`,
type: createDataType(type),
},
});
}
@ -111,6 +116,7 @@ exports.default = (0, util_1.createRule)({
messageId: 'unsafeComputedMemberAccess',
data: {
property: `[${propertyName}]`,
type: createDataType(type),
},
});
}

View file

@ -1 +1 @@
{"version":3,"file":"no-unsafe-member-access.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-member-access.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,sDAAwC;AAExC,kCAMiB;AAOjB,kBAAe,IAAA,iBAAU,EAAC;IACxB,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,WAAW,EAAE,aAAa;YAC1B,oBAAoB,EAAE,IAAI;SAC3B;QACD,QAAQ,EAAE;YACR,sBAAsB,EACpB,sDAAsD;YACxD,0BAA0B,EAAE;gBAC1B,gFAAgF;gBAChF,2HAA2H;aAC5H,CAAC,IAAI,CAAC,IAAI,CAAC;YACZ,0BAA0B,EACxB,sDAAsD;SACzD;QACD,MAAM,EAAE,EAAE;KACX;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC9D,MAA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E,cAAc,CAAC,CACvD,EACD,CAAC;wBACD,SAAS,GAAG,4BAA4B,CAAC;oBAC3C,CAAC;gBACH,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE,IAAI,CAAC,QAAQ;oBACnB,SAAS;oBACT,IAAI,EAAE;wBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE;qBACnE;iBACF,CAAC,CAAC;YACL,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO;YACL,qFAAqF;YACrF,iEAAiE,EAC/D,qBAAqB;YACvB,gDAAgD,CAC9C,IAAyB;gBAEzB;gBACE,OAAO;gBACP,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,OAAO;oBACpC,oBAAoB;oBACpB,+FAA+F;oBAC/F,uEAAuE;oBACvE,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,gBAAgB,EAC7C,CAAC;oBACD,6DAA6D;oBAC7D,OAAO;gBACT,CAAC;gBAED,MAAM,IAAI,GAAG,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBAE9C,IAAI,IAAA,oBAAa,EAAC,IAAI,CAAC,EAAE,CAAC;oBACxB,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACtD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,4BAA4B;wBACvC,IAAI,EAAE;4BACJ,QAAQ,EAAE,IAAI,YAAY,GAAG;yBAC9B;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
{"version":3,"file":"no-unsafe-member-access.js","sourceRoot":"","sources":["../../src/rules/no-unsafe-member-access.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;A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AAO;YACL,qFAAqF;YACrF,iEAAiE,EAC/D,qBAAqB;YACvB,gDAAgD,CAC9C,IAAyB;gBAEzB;gBACE,OAAO;gBACP,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,OAAO;oBACpC,oBAAoB;oBACpB,+FAA+F;oBAC/F,uEAAuE;oBACvE,IAAI,CAAC,IAAI,KAAK,sBAAc,CAAC,gBAAgB,EAC7C,CAAC;oBACD,6DAA6D;oBAC7D,OAAO;gBACT,CAAC;gBAED,MAAM,IAAI,GAAG,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBAE9C,IAAI,IAAA,oBAAa,EAAC,IAAI,CAAC,EAAE,CAAC;oBACxB,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBACtD,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAE,4BAA4B;wBACvC,IAAI,EAAE;4BACJ,QAAQ,EAAE,IAAI,YAAY,GAAG;4BAC7B,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;yBAC3B;qBACF,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}

View file

@ -27,6 +27,7 @@ const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const getMemberHeadLoc_1 = require("../util/getMemberHeadLoc");
const functionScopeBoundaries = [
utils_1.AST_NODE_TYPES.ArrowFunctionExpression,
utils_1.AST_NODE_TYPES.FunctionDeclaration,
@ -121,12 +122,6 @@ exports.default = (0, util_1.createRule)({
return tsutils.isFunctionScopeBoundary(tsNode);
}
function getEsNodesFromViolatingNode(violatingNode) {
if (ts.isParameterPropertyDeclaration(violatingNode, violatingNode.parent)) {
return {
esNode: services.tsNodeToESTreeNodeMap.get(violatingNode.name),
nameNode: services.tsNodeToESTreeNodeMap.get(violatingNode.name),
};
}
return {
esNode: services.tsNodeToESTreeNodeMap.get(violatingNode),
nameNode: services.tsNodeToESTreeNodeMap.get(violatingNode.name),
@ -140,13 +135,27 @@ exports.default = (0, util_1.createRule)({
const finalizedClassScope = (0, util_1.nullThrows)(classScopeStack.pop(), 'Stack should exist on class exit');
for (const violatingNode of finalizedClassScope.finalizeUnmodifiedPrivateNonReadonlys()) {
const { esNode, nameNode } = getEsNodesFromViolatingNode(violatingNode);
const reportNodeOrLoc = (() => {
switch (esNode.type) {
case utils_1.AST_NODE_TYPES.MethodDefinition:
case utils_1.AST_NODE_TYPES.PropertyDefinition:
case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:
return { loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, esNode) };
case utils_1.AST_NODE_TYPES.TSParameterProperty:
return {
loc: (0, getMemberHeadLoc_1.getParameterPropertyHeadLoc)(context.sourceCode, esNode, nameNode.name),
};
default:
return { node: esNode };
}
})();
context.report({
...reportNodeOrLoc,
data: {
name: context.sourceCode.getText(nameNode),
},
fix: fixer => fixer.insertTextBefore(nameNode, 'readonly '),
messageId: 'preferReadonly',
node: esNode,
});
}
},

File diff suppressed because one or more lines are too long

View file

@ -32,7 +32,7 @@ exports.default = (0, util_1.createRule)({
name: 'return-await',
meta: {
docs: {
description: 'Enforce consistent returning of awaited values',
description: 'Enforce consistent awaiting of returned promises',
requiresTypeChecking: true,
extendsBaseRule: 'no-return-await',
},
@ -67,6 +67,39 @@ exports.default = (0, util_1.createRule)({
function exitFunction() {
scopeInfoStack.pop();
}
function affectsExplicitResourceManagement(node) {
// just need to determine if there is a `using` declaration in scope.
let scope = context.sourceCode.getScope(node);
const functionScope = scope.variableScope;
while (true) {
for (const variable of scope.variables) {
if (variable.defs.length !== 1) {
// This can't be the case for `using` or `await using` since it's
// an error to redeclare those more than once in the same scope,
// unlike, say, `var` declarations.
continue;
}
const declaration = variable.defs[0];
const declaratorNode = declaration.node;
const declarationNode = declaratorNode.parent;
// if it's a using/await using declaration, and it comes _before_ the
// node we're checking, it affects control flow for that node.
if (['using', 'await using'].includes(declarationNode.kind) &&
declaratorNode.range[1] < node.range[0]) {
return true;
}
}
if (scope === functionScope) {
// We've checked all the relevant scopes
break;
}
// This should always exist, since the rule should only be checking
// contexts in which `return` statements are legal, which should always
// be inside a function.
scope = (0, util_1.nullThrows)(scope.upper, 'Expected parent scope to exist. return-await should only operate on return statements within functions');
}
return false;
}
/**
* Tests whether a node is inside of an explicit error handling context
* (try/catch/finally) in a way that throwing an exception will have an
@ -201,7 +234,8 @@ exports.default = (0, util_1.createRule)({
});
return;
}
const affectsErrorHandling = affectsExplicitErrorHandling(expression);
const affectsErrorHandling = affectsExplicitErrorHandling(expression) ||
affectsExplicitResourceManagement(node);
const useAutoFix = !affectsErrorHandling;
if (option === 'always') {
if (!isAwait && isThenable) {

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,81 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getParameterPropertyHeadLoc = exports.getMemberHeadLoc = void 0;
const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils");
/**
* Generates report loc suitable for reporting on how a class member is
* declared, rather than how it's implemented.
*
* ```ts
* class A {
* abstract method(): void;
* ~~~~~~~~~~~~~~~
*
* concreteMethod(): void {
* ~~~~~~~~~~~~~~
* // code
* }
*
* abstract private property?: string;
* ~~~~~~~~~~~~~~~~~~~~~~~~~
*
* @decorator override concreteProperty = 'value';
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* }
* ```
*/
function getMemberHeadLoc(sourceCode, node) {
let start;
if (node.decorators.length === 0) {
start = node.loc.start;
}
else {
const lastDecorator = node.decorators[node.decorators.length - 1];
const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator'));
start = nextToken.loc.start;
}
let end;
if (!node.computed) {
end = node.key.loc.end;
}
else {
const closingBracket = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(node.key, token => token.value === ']'), eslint_utils_1.NullThrowsReasons.MissingToken(']', node.type));
end = closingBracket.loc.end;
}
return {
start: structuredClone(start),
end: structuredClone(end),
};
}
exports.getMemberHeadLoc = getMemberHeadLoc;
/**
* Generates report loc suitable for reporting on how a parameter property is
* declared.
*
* ```ts
* class A {
* constructor(private property: string = 'value') {
* ~~~~~~~~~~~~~~~~
* }
* ```
*/
function getParameterPropertyHeadLoc(sourceCode, node, nodeName) {
// Parameter properties have a weirdly different AST structure
// than other class members.
let start;
if (node.decorators.length === 0) {
start = structuredClone(node.loc.start);
}
else {
const lastDecorator = node.decorators[node.decorators.length - 1];
const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator'));
start = structuredClone(nextToken.loc.start);
}
const end = sourceCode.getLocFromIndex(node.parameter.range[0] + nodeName.length);
return {
start,
end,
};
}
exports.getParameterPropertyHeadLoc = getParameterPropertyHeadLoc;
//# sourceMappingURL=getMemberHeadLoc.js.map

View file

@ -0,0 +1 @@
{"version":3,"file":"getMemberHeadLoc.js","sourceRoot":"","sources":["../../src/util/getMemberHeadLoc.ts"],"names":[],"mappings":";;;AACA,wEAG+C;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,gBAAgB,CAC9B,UAAyC,EACzC,IAIyC;IAEzC,IAAI,KAAwB,CAAC;IAE7B,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IACzB,CAAC;SAAM,CAAC;QACN,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,IAAA,yBAAU,EAC1B,UAAU,CAAC,aAAa,CAAC,aAAa,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vC,gCAAiB,CAAC,YAAY,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAC1D,CAAC;QACF,KAAK,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,CAAC,eAAe,CACpC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAC1C,CAAC;IAEF,OAAO;QACL,KAAK;QACL,GAAG;KACJ,CAAC;AACJ,CAAC;AA7BD,kEA6BC"}

View file

@ -1,5 +1,5 @@
---
description: 'Enforce consistent returning of awaited values.'
description: 'Enforce consistent awaiting of returned promises.'
---
import Tabs from '@theme/Tabs';
@ -9,12 +9,14 @@ import TabItem from '@theme/TabItem';
>
> See **https://typescript-eslint.io/rules/return-await** for documentation.
Returning an awaited promise can make sense for better stack trace information as well as for consistent error handling (returned promises will not be caught in an async function try/catch).
This rule builds on top of the [`eslint/no-return-await`](https://eslint.org/docs/rules/no-return-await) rule.
It expands upon the base rule to add support for optionally requiring `return await` in certain cases.
The extended rule is named `return-await` instead of `no-return-await` because the extended rule can enforce the positive or the negative. Additionally, while the core rule is now deprecated, the extended rule is still useful in many contexts.
The extended rule is named `return-await` instead of `no-return-await` because the extended rule can enforce the positive or the negative. Additionally, while the core rule is now deprecated, the extended rule is still useful in many contexts:
- Returning an awaited promise [improves stack trace information](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#improving_stack_trace).
- When the `return` statement is in `try...catch`, awaiting the promise also allows the promise's rejection to be caught instead of leaving the error to the caller.
- Contrary to popular belief, `return await promise;` is [at least as fast as directly returning the promise](https://github.com/tc39/proposal-faster-promise-adoption).
## Options
@ -35,8 +37,7 @@ Listing the error-handling cases exhaustively:
- if you `return` a promise within a `catch`, and there is _no_ `finally`, then it must _not_ be `await`ed.
- if you `return` a promise within a `catch`, and there _is_ a `finally`, then it _must_ be `await`ed.
- if you `return` a promise within a `finally`, then it must not be `await`ed.
Examples of code with `in-try-catch`:
- if you `return` a promise between a `using` or `await using` declaration and the end of its scope, it must be `await`ed, since it behaves equivalently to code wrapped in a `try` block.
<Tabs>
<TabItem value="❌ Incorrect">
@ -95,6 +96,11 @@ async function invalidInTryCatch5() {
async function invalidInTryCatch6() {
return await 'value';
}
async function invalidInTryCatch7() {
using x = createDisposable();
return Promise.reject('using in scope');
}
```
</TabItem>
@ -151,6 +157,11 @@ async function validInTryCatch5() {
async function validInTryCatch6() {
return 'value';
}
async function validInTryCatch7() {
using x = createDisposable();
return await Promise.reject('using in scope');
}
```
</TabItem>

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "7.13.0",
"version": "7.13.1",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
@ -60,10 +60,10 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/type-utils": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/type-utils": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"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": "7.13.0",
"@typescript-eslint/rule-tester": "7.13.0",
"@typescript-eslint/rule-schema-to-typescript-types": "7.13.1",
"@typescript-eslint/rule-tester": "7.13.1",
"ajv": "^6.12.6",
"cross-env": "^7.0.3",
"cross-fetch": "*",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
"version": "7.13.0",
"version": "7.13.1",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"files": [
"dist",
@ -52,10 +52,10 @@
"eslint": "^8.56.0"
},
"dependencies": {
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
"version": "7.13.0",
"version": "7.13.1",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@ -46,13 +46,13 @@
"typecheck": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0"
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@types/glob": "*",
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.1",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",

View file

@ -12,5 +12,7 @@ export declare function getTypeFlags(type: ts.Type): ts.TypeFlags;
* parts and get the flags of every union constituent. If this is not desired,
* use the `isTypeFlag` function from tsutils.
*/
export declare function isTypeFlagSet(type: ts.Type, flagsToCheck: ts.TypeFlags, isReceiver?: boolean): boolean;
export declare function isTypeFlagSet(type: ts.Type, flagsToCheck: ts.TypeFlags,
/** @deprecated This params is not used and will be removed in the future.*/
isReceiver?: boolean): boolean;
//# sourceMappingURL=typeFlagUtils.d.ts.map

View file

@ -1 +1 @@
{"version":3,"file":"typeFlagUtils.d.ts","sourceRoot":"","sources":["../src/typeFlagUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,SAAS,CAOxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,YAAY,EAAE,EAAE,CAAC,SAAS,EAC1B,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAQT"}
{"version":3,"file":"typeFlagUtils.d.ts","sourceRoot":"","sources":["../src/typeFlagUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAIjC;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,SAAS,CAOxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,YAAY,EAAE,EAAE,CAAC,SAAS;AAC1B,4EAA4E;AAC5E,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAST"}

View file

@ -48,8 +48,11 @@ exports.getTypeFlags = getTypeFlags;
* parts and get the flags of every union constituent. If this is not desired,
* use the `isTypeFlag` function from tsutils.
*/
function isTypeFlagSet(type, flagsToCheck, isReceiver) {
function isTypeFlagSet(type, flagsToCheck,
/** @deprecated This params is not used and will be removed in the future.*/
isReceiver) {
const flags = getTypeFlags(type);
// eslint-disable-next-line deprecation/deprecation -- not used
if (isReceiver && flags & ANY_OR_UNKNOWN) {
return true;
}

View file

@ -1 +1 @@
{"version":3,"file":"typeFlagUtils.js","sourceRoot":"","sources":["../src/typeFlagUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AACxC,+CAAiC;AAEjC,MAAM,cAAc,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;AAE/D;;GAEG;AACH,SAAgB,YAAY,CAAC,IAAa;IACxC,wGAAwG;IACxG,IAAI,KAAK,GAAiB,CAAC,CAAC;IAC5B,KAAK,MAAM,CAAC,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OAAO,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;AACtC,CAAC;AAdD,sCAcC"}

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/type-utils",
"version": "7.13.0",
"version": "7.13.1",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@ -46,14 +46,14 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/parser": "7.13.0",
"@typescript-eslint/parser": "7.13.1",
"ajv": "^6.12.6",
"downlevel-dts": "*",
"jest": "29.7.0",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/types",
"version": "7.13.0",
"version": "7.13.1",
"description": "Types for the TypeScript-ESTree AST spec",
"files": [
"dist",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
"version": "7.13.0",
"version": "7.13.1",
"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": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
"version": "7.13.0",
"version": "7.13.1",
"description": "Utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@ -68,9 +68,9 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0"
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1"
},
"peerDependencies": {
"eslint": "^8.56.0"

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
"version": "7.13.0",
"version": "7.13.1",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@ -47,7 +47,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"eslint-visitor-keys": "^3.4.3"
},
"devDependencies": {

88
package-lock.json generated
View file

@ -46,8 +46,8 @@
"@types/node": "20.9.0",
"@types/semver": "^7.5.8",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"ava": "^5.3.1",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
@ -1018,16 +1018,16 @@
"integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA=="
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz",
"integrity": "sha512-FX1X6AF0w8MdVFLSdqwqN/me2hyhuQg4ykN6ZpVhh1ij/80pTvDKclX1sZB9iqex8SjQfVhwMKs3JtnnMLzG9w==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.1.tgz",
"integrity": "sha512-kZqi+WZQaZfPKnsflLJQCz6Ze9FFSMfXrrIOcyargekQxG37ES7DJNpJUE9Q/X5n3yTIP/WPutVNzgknQ7biLg==",
"dev": true,
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/type-utils": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/type-utils": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@ -1051,15 +1051,15 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.0.tgz",
"integrity": "sha512-EjMfl69KOS9awXXe83iRN7oIEXy9yYdqWfqdrFAYAAr6syP8eLEFI7ZE4939antx2mNgPRW/o1ybm2SFYkbTVA==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.13.1.tgz",
"integrity": "sha512-1ELDPlnLvDQ5ybTSrMhRTFDfOQEOXNM+eP+3HT/Yq7ruWpciQw+Avi73pdEbA4SooCawEWo3dtYbF68gN7Ed1A==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4"
},
"engines": {
@ -1079,13 +1079,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.0.tgz",
"integrity": "sha512-ZrMCe1R6a01T94ilV13egvcnvVJ1pxShkE0+NDjDzH4nvG1wXpwsVI5bZCvE7AEDH1mXEx5tJSVR68bLgG7Dng==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.13.1.tgz",
"integrity": "sha512-adbXNVEs6GmbzaCpymHQ0MB6E4TqoiVbC0iqG3uijR8ZYfpAXMGttouQzF4Oat3P2GxDVIrg7bMI/P65LiQZdg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0"
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1096,13 +1096,13 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.0.tgz",
"integrity": "sha512-xMEtMzxq9eRkZy48XuxlBFzpVMDurUAfDu5Rz16GouAtXm0TaAoTFzqWUFPPuQYXI/CDaH/Bgx/fk/84t/Bc9A==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.13.1.tgz",
"integrity": "sha512-aWDbLu1s9bmgPGXSzNCxELu+0+HQOapV/y+60gPXafR8e2g1Bifxzevaa+4L2ytCWm+CHqpELq4CSoN9ELiwCg==",
"dev": true,
"dependencies": {
"@typescript-eslint/typescript-estree": "7.13.0",
"@typescript-eslint/utils": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.1",
"@typescript-eslint/utils": "7.13.1",
"debug": "^4.3.4",
"ts-api-utils": "^1.3.0"
},
@ -1123,9 +1123,9 @@
}
},
"node_modules/@typescript-eslint/types": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.0.tgz",
"integrity": "sha512-QWuwm9wcGMAuTsxP+qz6LBBd3Uq8I5Nv8xb0mk54jmNoCyDspnMvVsOxI6IsMmway5d1S9Su2+sCKv1st2l6eA==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.13.1.tgz",
"integrity": "sha512-7K7HMcSQIAND6RBL4kDl24sG/xKM13cA85dc7JnmQXw2cBDngg7c19B++JzvJHRG3zG36n9j1i451GBzRuHchw==",
"dev": true,
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1136,13 +1136,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.0.tgz",
"integrity": "sha512-cAvBvUoobaoIcoqox1YatXOnSl3gx92rCZoMRPzMNisDiM12siGilSM4+dJAekuuHTibI2hVC2fYK79iSFvWjw==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.13.1.tgz",
"integrity": "sha512-uxNr51CMV7npU1BxZzYjoVz9iyjckBduFBP0S5sLlh1tXYzHzgZ3BR9SVsNed+LmwKrmnqN3Kdl5t7eZ5TS1Yw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/visitor-keys": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/visitor-keys": "7.13.1",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
@ -1188,15 +1188,15 @@
}
},
"node_modules/@typescript-eslint/utils": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.0.tgz",
"integrity": "sha512-jceD8RgdKORVnB4Y6BqasfIkFhl4pajB1wVxrF4akxD2QPM8GNYjgGwEzYS+437ewlqqrg7Dw+6dhdpjMpeBFQ==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.13.1.tgz",
"integrity": "sha512-h5MzFBD5a/Gh/fvNdp9pTfqJAbuQC4sCN2WzuXme71lqFJsZtLbjxfSk4r3p02WIArOF9N94pdsLiGutpDbrXQ==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.13.0",
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/typescript-estree": "7.13.0"
"@typescript-eslint/scope-manager": "7.13.1",
"@typescript-eslint/types": "7.13.1",
"@typescript-eslint/typescript-estree": "7.13.1"
},
"engines": {
"node": "^18.18.0 || >=20.0.0"
@ -1210,12 +1210,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.0.tgz",
"integrity": "sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw==",
"version": "7.13.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.13.1.tgz",
"integrity": "sha512-k/Bfne7lrP7hcb7m9zSsgcBmo+8eicqqfNAJ7uUY+jkTFpKeH2FSkWpFRtimBxgkyvqfu9jTPRbYOvud6isdXA==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "7.13.0",
"@typescript-eslint/types": "7.13.1",
"eslint-visitor-keys": "^3.4.3"
},
"engines": {

View file

@ -61,8 +61,8 @@
"@types/node": "20.9.0",
"@types/semver": "^7.5.8",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"ava": "^5.3.1",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",