Update checked-in dependencies

This commit is contained in:
github-actions[bot] 2025-04-02 12:43:14 +00:00
parent 4b72bef651
commit dbb232a3d8
1389 changed files with 209949 additions and 542 deletions

View file

@ -1 +1 @@
{"version":3,"file":"eslint-recommended-raw.d.ts","sourceRoot":"","sources":["../../src/configs/eslint-recommended-raw.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,QAAA,MAAM,MAAM,GACV,OAAO,MAAM,GAAG,WAAW,KAC1B;IACD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAiChD,CAAC;AAEH,SAAS,MAAM,CAAC"}
{"version":3,"file":"eslint-recommended-raw.d.ts","sourceRoot":"","sources":["../../src/configs/eslint-recommended-raw.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,QAAA,MAAM,MAAM,GACV,OAAO,MAAM,GAAG,WAAW,KAC1B;IACD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;CAkChD,CAAC;AAEH,SAAS,MAAM,CAAC"}

View file

@ -37,6 +37,7 @@ const config = (style) => ({
'prefer-const': 'error', // ts provides better types with const
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
'no-with': 'off', // ts(1101) & ts(2410)
},
});
module.exports = config;

View file

@ -1 +1 @@
{"version":3,"file":"no-array-constructor.d.ts","sourceRoot":"","sources":["../../src/rules/no-array-constructor.ts"],"names":[],"mappings":";AAMA,wBAuDG"}
{"version":3,"file":"no-array-constructor.d.ts","sourceRoot":"","sources":["../../src/rules/no-array-constructor.ts"],"names":[],"mappings":";AAUA,wBAsEG"}

View file

@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const ast_utils_1 = require("@typescript-eslint/utils/ast-utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-array-constructor',
@ -19,6 +20,21 @@ exports.default = (0, util_1.createRule)({
},
defaultOptions: [],
create(context) {
const sourceCode = context.sourceCode;
function getArgumentsText(node) {
const lastToken = sourceCode.getLastToken(node);
if (lastToken == null || !(0, ast_utils_1.isClosingParenToken)(lastToken)) {
return '';
}
let firstToken = node.callee;
do {
firstToken = sourceCode.getTokenAfter(firstToken);
if (!firstToken || firstToken === lastToken) {
return '';
}
} while (!(0, ast_utils_1.isOpeningParenToken)(firstToken));
return sourceCode.text.slice(firstToken.range[1], lastToken.range[0]);
}
/**
* Disallow construction of dense arrays using the Array constructor
* @param node node to evaluate
@ -27,18 +43,13 @@ exports.default = (0, util_1.createRule)({
if (node.arguments.length !== 1 &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
node.callee.name === 'Array' &&
!node.typeArguments &&
!(0, util_1.isOptionalCallExpression)(node)) {
!node.typeArguments) {
context.report({
node,
messageId: 'useLiteral',
fix(fixer) {
if (node.arguments.length === 0) {
return fixer.replaceText(node, '[]');
}
const fullText = context.sourceCode.getText(node);
const preambleLength = node.callee.range[1] - node.range[0];
return fixer.replaceText(node, `[${fullText.slice(preambleLength + 1, -1)}]`);
const argsText = getArgumentsText(node);
return fixer.replaceText(node, `[${argsText}]`);
},
});
}

View file

@ -1 +1 @@
{"version":3,"file":"no-unnecessary-condition.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-condition.ts"],"names":[],"mappings":"AAyHA,KAAK,iCAAiC,GAAG,OAAO,CAAC;AAEjD,KAAK,2BAA2B,GAAG,QAAQ,GAAG,OAAO,GAAG,uBAAuB,CAAC;AAShF,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,2BAA2B,CAAC,EACxB,2BAA2B,GAC3B,iCAAiC,CAAC;QACtC,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,+BAA+B,GAC/B,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,4BAA4B,GAC5B,mBAAmB,GACnB,wBAAwB,CAAC;;AAE7B,wBAgwBG"}
{"version":3,"file":"no-unnecessary-condition.d.ts","sourceRoot":"","sources":["../../src/rules/no-unnecessary-condition.ts"],"names":[],"mappings":"AAyHA,KAAK,iCAAiC,GAAG,OAAO,CAAC;AAEjD,KAAK,2BAA2B,GAAG,QAAQ,GAAG,OAAO,GAAG,uBAAuB,CAAC;AAShF,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,2BAA2B,CAAC,EACxB,2BAA2B,GAC3B,iCAAiC,CAAC;QACtC,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,+BAA+B,GAC/B,OAAO,GACP,cAAc,GACd,oBAAoB,GACpB,4BAA4B,GAC5B,mBAAmB,GACnB,wBAAwB,CAAC;;AAE7B,wBAowBG"}

View file

@ -258,7 +258,7 @@ exports.default = (0, util_1.createRule)({
// Since typescript array index signature types don't represent the
// possibility of out-of-bounds access, if we're indexing into an array
// just skip the check, to avoid false positives
if (isArrayIndexExpression(expression)) {
if (!isNoUncheckedIndexedAccess && isArrayIndexExpression(expression)) {
return;
}
// When checking logical expressions, only check the right side
@ -308,10 +308,11 @@ exports.default = (0, util_1.createRule)({
// Since typescript array index signature types don't represent the
// possibility of out-of-bounds access, if we're indexing into an array
// just skip the check, to avoid false positives
if (!isArrayIndexExpression(node) &&
!(node.type === utils_1.AST_NODE_TYPES.ChainExpression &&
node.expression.type !== utils_1.AST_NODE_TYPES.TSNonNullExpression &&
optionChainContainsOptionArrayIndex(node.expression))) {
if (isNoUncheckedIndexedAccess ||
(!isArrayIndexExpression(node) &&
!(node.type === utils_1.AST_NODE_TYPES.ChainExpression &&
node.expression.type !== utils_1.AST_NODE_TYPES.TSNonNullExpression &&
optionChainContainsOptionArrayIndex(node.expression)))) {
messageId = 'neverNullish';
}
}
@ -598,7 +599,8 @@ exports.default = (0, util_1.createRule)({
// Since typescript array index signature types don't represent the
// possibility of out-of-bounds access, if we're indexing into an array
// just skip the check, to avoid false positives
if (optionChainContainsOptionArrayIndex(node)) {
if (!isNoUncheckedIndexedAccess &&
optionChainContainsOptionArrayIndex(node)) {
return;
}
const nodeToCheck = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object;

View file

@ -4,6 +4,7 @@ export type Options = [
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
ignoreBooleanCoercion?: boolean;
ignoreConditionalTests?: boolean;
ignoreIfStatements?: boolean;
ignoreMixedLogicalExpressions?: boolean;
ignorePrimitives?: {
bigint?: boolean;

View file

@ -1 +1 @@
{"version":3,"file":"prefer-nullish-coalescing.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-nullish-coalescing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAqCnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,gBAAgB,CAAC,EACb;YACE,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,MAAM,CAAC,EAAE,OAAO,CAAC;SAClB,GACD,IAAI,CAAC;QACT,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,mBAAmB,GACnB,6BAA6B,GAC7B,qBAAqB,GACrB,0BAA0B,GAC1B,gBAAgB,CAAC;;AAErB,wBAujBG"}
{"version":3,"file":"prefer-nullish-coalescing.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-nullish-coalescing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAqCnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,sDAAsD,CAAC,EAAE,OAAO,CAAC;QACjE,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,6BAA6B,CAAC,EAAE,OAAO,CAAC;QACxC,gBAAgB,CAAC,EACb;YACE,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,OAAO,CAAC,EAAE,OAAO,CAAC;YAClB,MAAM,CAAC,EAAE,OAAO,CAAC;YACjB,MAAM,CAAC,EAAE,OAAO,CAAC;SAClB,GACD,IAAI,CAAC;QACT,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B;CACF,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB,mBAAmB,GACnB,6BAA6B,GAC7B,qBAAqB,GACrB,0BAA0B,GAC1B,gBAAgB,CAAC;;AAErB,wBA8jBG"}

View file

@ -79,6 +79,10 @@ exports.default = (0, util_1.createRule)({
type: 'boolean',
description: 'Whether to ignore cases that are located within a conditional test.',
},
ignoreIfStatements: {
type: 'boolean',
description: 'Whether to ignore any if statements that could be simplified by using the nullish coalescing operator.',
},
ignoreMixedLogicalExpressions: {
type: 'boolean',
description: 'Whether to ignore any logical or expressions that are part of a mixed logical expression (with `&&`).',
@ -128,6 +132,7 @@ exports.default = (0, util_1.createRule)({
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
ignoreBooleanCoercion: false,
ignoreConditionalTests: true,
ignoreIfStatements: false,
ignoreMixedLogicalExpressions: false,
ignorePrimitives: {
bigint: false,
@ -138,7 +143,7 @@ exports.default = (0, util_1.createRule)({
ignoreTernaryTests: false,
},
],
create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, ignoreBooleanCoercion, ignoreConditionalTests, ignoreMixedLogicalExpressions, ignorePrimitives, ignoreTernaryTests, },]) {
create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, ignoreBooleanCoercion, ignoreConditionalTests, ignoreIfStatements, ignoreMixedLogicalExpressions, ignorePrimitives, ignoreTernaryTests, },]) {
const parserServices = (0, util_1.getParserServices)(context);
const compilerOptions = parserServices.program.getCompilerOptions();
const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks');
@ -369,7 +374,7 @@ exports.default = (0, util_1.createRule)({
}
},
IfStatement(node) {
if (node.alternate != null) {
if (ignoreIfStatements || node.alternate != null) {
return;
}
let assignmentExpression;

View file

@ -1 +1 @@
{"version":3,"file":"use-unknown-in-catch-callback-variable.d.ts","sourceRoot":"","sources":["../../src/rules/use-unknown-in-catch-callback-variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,MAAM,MAAM,UAAU,GAClB,wCAAwC,GACxC,oCAAoC,GACpC,YAAY,GACZ,qCAAqC,GACrC,sCAAsC,GACtC,mCAAmC,GACnC,+BAA+B,CAAC;;AAKpC,wBAmSG"}
{"version":3,"file":"use-unknown-in-catch-callback-variable.d.ts","sourceRoot":"","sources":["../../src/rules/use-unknown-in-catch-callback-variable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAgBnE,MAAM,MAAM,UAAU,GAClB,wCAAwC,GACxC,oCAAoC,GACpC,YAAY,GACZ,qCAAqC,GACrC,sCAAsC,GACtC,mCAAmC,GACnC,+BAA+B,CAAC;;AAKpC,wBAkSG"}

View file

@ -46,7 +46,6 @@ exports.default = (0, util_1.createRule)({
recommended: 'strict',
requiresTypeChecking: true,
},
fixable: 'code',
hasSuggestions: true,
messages: {
addUnknownRestTypeAnnotationSuggestion: 'Add an explicit `: [unknown]` type annotation to the rejection callback rest variable.',

View file

@ -1 +1 @@
{"version":3,"file":"isAssignee.d.ts","sourceRoot":"","sources":["../../src/util/isAssignee.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAoDvD"}
{"version":3,"file":"isAssignee.d.ts","sourceRoot":"","sources":["../../src/util/isAssignee.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CA+DvD"}

View file

@ -38,5 +38,13 @@ function isAssignee(node) {
isAssignee(parent.parent)) {
return true;
}
// (a[i] as number)++, [...a[i]!] = [0], etc.
if ((parent.type === utils_1.AST_NODE_TYPES.TSNonNullExpression ||
parent.type === utils_1.AST_NODE_TYPES.TSAsExpression ||
parent.type === utils_1.AST_NODE_TYPES.TSTypeAssertion ||
parent.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression) &&
isAssignee(parent)) {
return true;
}
return false;
}

View file

@ -1 +1 @@
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/util/misc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAItE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC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OAAO,CAIT;AAED,MAAM,MAAM,WAAW,GACnB,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,gBAAgB,GACzB,QAAQ,CAAC,QAAQ,GACjB,QAAQ,CAAC,kBAAkB,GAC3B,QAAQ,CAAC,0BAA0B,GACnC,QAAQ,CAAC,4BAA4B,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,WAAW,EACjB,EAAE,UAAU,EAAE,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAC7C,MAAM,GAAG,MAAM,GAAG,SAAS,CAiB7B;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GACtC,kBAAkB,WAAW,EAC7B,SAAS,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EACvC,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAC7B,OAGA,CAAC"}

View file

@ -67,7 +67,7 @@ function isDefinitionFile(fileName) {
return true;
}
}
return false;
return /\.d\.(ts|cts|mts|.*\.ts)$/.test(lowerFileName);
}
/**
* Upper cases the first character or the string

View file

@ -45,10 +45,10 @@ foo('a', ...tuple2, anyTyped);
declare function bar(arg1: string, arg2: number, ...rest: string[]): void;
const x = [1, 2] as [number, ...number[]];
foo('a', ...x, anyTyped);
bar('a', ...x, anyTyped);
declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
foo(new Set<any>(), new Map<any, string>());
baz(new Set<any>(), new Map<any, string>());
```
</TabItem>
@ -67,7 +67,7 @@ const array: string[] = ['a'];
bar('a', 1, ...array);
declare function baz(arg1: Set<string>, arg2: Map<string, string>): void;
foo(new Set<string>(), new Map<string, string>());
baz(new Set<string>(), new Map<string, string>());
```
</TabItem>

View file

@ -118,6 +118,49 @@ c ?? 'a string';
</TabItem>
</Tabs>
### `ignoreIfStatements`
{/* insert option description */}
Examples of code for this rule with `{ ignoreIfStatements: false }`:
<Tabs>
<TabItem value="❌ Incorrect">
```ts option='{ "ignoreIfStatements": false }'
declare let foo: { a: string } | null;
declare function makeFoo(): { a: string };
function lazyInitializeFoo1() {
if (!foo) {
foo = makeFoo();
}
}
function lazyInitializeFoo2() {
if (!foo) foo = makeFoo();
}
```
</TabItem>
<TabItem value="✅ Correct">
```ts option='{ "ignoreIfStatements": false }'
declare let foo: { a: string } | null;
declare function makeFoo(): { a: string };
function lazyInitializeFoo1() {
foo ??= makeFoo();
}
function lazyInitializeFoo2() {
foo ??= makeFoo();
}
```
</TabItem>
</Tabs>
### `ignoreConditionalTests`
{/* insert option description */}

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
"version": "8.28.0",
"version": "8.29.0",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@ -47,12 +47,12 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0"
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/typescript-estree": "8.28.0",
"@typescript-eslint/typescript-estree": "8.29.0",
"glob": "*",
"jest": "29.7.0",
"jest-specific-snapshot": "*",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
"version": "8.28.0",
"version": "8.29.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"files": [
"dist",
@ -55,8 +55,8 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
"version": "8.28.0",
"version": "8.29.0",
"description": "Utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@ -65,9 +65,9 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "8.28.0",
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/typescript-estree": "8.28.0"
"@typescript-eslint/scope-manager": "8.29.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/typescript-estree": "8.29.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
"version": "8.28.0",
"version": "8.29.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@ -48,7 +48,7 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"eslint-visitor-keys": "^4.2.0"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
"version": "8.28.0",
"version": "8.29.0",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
@ -62,10 +62,10 @@
},
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
"@typescript-eslint/scope-manager": "8.28.0",
"@typescript-eslint/type-utils": "8.28.0",
"@typescript-eslint/utils": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0",
"@typescript-eslint/scope-manager": "8.29.0",
"@typescript-eslint/type-utils": "8.29.0",
"@typescript-eslint/utils": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0",
"graphemer": "^1.4.0",
"ignore": "^5.3.1",
"natural-compare": "^1.4.0",
@ -76,8 +76,8 @@
"@types/marked": "^5.0.2",
"@types/mdast": "^4.0.3",
"@types/natural-compare": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "8.28.0",
"@typescript-eslint/rule-tester": "8.28.0",
"@typescript-eslint/rule-schema-to-typescript-types": "8.29.0",
"@typescript-eslint/rule-tester": "8.29.0",
"ajv": "^6.12.6",
"cross-env": "^7.0.3",
"cross-fetch": "*",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
"version": "8.28.0",
"version": "8.29.0",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@ -47,12 +47,12 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0"
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/typescript-estree": "8.28.0",
"@typescript-eslint/typescript-estree": "8.29.0",
"glob": "*",
"jest": "29.7.0",
"jest-specific-snapshot": "*",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
"version": "8.28.0",
"version": "8.29.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"files": [
"dist",
@ -55,8 +55,8 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
"version": "8.28.0",
"version": "8.29.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@ -48,7 +48,7 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"eslint-visitor-keys": "^4.2.0"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
"version": "8.28.0",
"version": "8.29.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"files": [
"dist",
@ -54,10 +54,10 @@
"typescript": ">=4.8.4 <5.9.0"
},
"dependencies": {
"@typescript-eslint/scope-manager": "8.28.0",
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/typescript-estree": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0",
"@typescript-eslint/scope-manager": "8.29.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/typescript-estree": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0",
"debug": "^4.3.4"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
"version": "8.28.0",
"version": "8.29.0",
"description": "TypeScript scope analyser for ESLint",
"files": [
"dist",
@ -47,12 +47,12 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0"
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/typescript-estree": "8.28.0",
"@typescript-eslint/typescript-estree": "8.29.0",
"glob": "*",
"jest": "29.7.0",
"jest-specific-snapshot": "*",

View file

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

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
"version": "8.28.0",
"version": "8.29.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"files": [
"dist",
@ -55,8 +55,8 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/visitor-keys": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/visitor-keys": "8.29.0",
"debug": "^4.3.4",
"fast-glob": "^3.3.2",
"is-glob": "^4.0.3",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
"version": "8.28.0",
"version": "8.29.0",
"description": "Utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@ -65,9 +65,9 @@
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "8.28.0",
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/typescript-estree": "8.28.0"
"@typescript-eslint/scope-manager": "8.29.0",
"@typescript-eslint/types": "8.29.0",
"@typescript-eslint/typescript-estree": "8.29.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
"version": "8.28.0",
"version": "8.29.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"files": [
"dist",
@ -48,7 +48,7 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.28.0",
"@typescript-eslint/types": "8.29.0",
"eslint-visitor-keys": "^4.2.0"
},
"devDependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/type-utils",
"version": "8.28.0",
"version": "8.29.0",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
@ -47,8 +47,8 @@
"check-types": "npx nx typecheck"
},
"dependencies": {
"@typescript-eslint/typescript-estree": "8.28.0",
"@typescript-eslint/utils": "8.28.0",
"@typescript-eslint/typescript-estree": "8.29.0",
"@typescript-eslint/utils": "8.29.0",
"debug": "^4.3.4",
"ts-api-utils": "^2.0.1"
},
@ -58,7 +58,7 @@
},
"devDependencies": {
"@jest/types": "29.6.3",
"@typescript-eslint/parser": "8.28.0",
"@typescript-eslint/parser": "8.29.0",
"ajv": "^6.12.6",
"downlevel-dts": "*",
"jest": "29.7.0",