diff --git a/CHANGELOG.md b/CHANGELOG.md index 3565665f1cb7..aa5ceaaa6bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +## 8.44.0 (2025-09-15) + +### 🚀 Features + +- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267)) + +### 🩹 Fixes + +- **deps:** update dependency @eslint-community/eslint-utils to v4.8.0 ([#11589](https://github.com/typescript-eslint/typescript-eslint/pull/11589)) +- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490)) + +### ❤️ Thank You + +- Moses Odutusin @thebolarin +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/eslint.config.mjs b/eslint.config.mjs index 6f0bc78c5100..391214cb6184 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -380,6 +380,7 @@ export default defineConfig( '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', + 'vitest/hoisted-apis-on-top': 'error', 'vitest/no-alias-methods': 'error', 'vitest/no-disabled-tests': 'error', 'vitest/no-focused-tests': 'error', diff --git a/package.json b/package.json index 3edb1ac900d0..7ab91774e311 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@typescript-eslint/typescript-estree": "workspace:^", "@typescript-eslint/utils": "workspace:^", "@vitest/coverage-v8": "^3.1.3", - "@vitest/eslint-plugin": "^1.1.44", + "@vitest/eslint-plugin": "^1.3.9", "console-fail-test": "^0.5.0", "cross-fetch": "^4.0.0", "cspell": "^9.0.0", diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 7ed7bba831d0..4c7a8ba3e11c 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index dc67c399e45d..e89e369e0bbe 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.43.0", + "version": "8.44.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index ce4b358cad1b..b61c69fe769f 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,20 @@ +## 8.44.0 (2025-09-15) + +### 🚀 Features + +- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267)) + +### 🩹 Fixes + +- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490)) + +### ❤️ Thank You + +- Moses Odutusin @thebolarin +- Ronen Amiel + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index e86d12562509..d78a1182c1ba 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.43.0", + "version": "8.44.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/type-utils": "8.43.0", - "@typescript-eslint/utils": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/type-utils": "8.44.0", + "@typescript-eslint/utils": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.43.0", - "@typescript-eslint/rule-tester": "8.43.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.44.0", + "@typescript-eslint/rule-tester": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.43.0", + "@typescript-eslint/parser": "^8.44.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 2ba4efbd0b06..8c84eacc8788 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -1,10 +1,13 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; +import { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'ts-api-utils'; import { Awaitable, createRule, + getConstrainedTypeAtLocation, getFixOrSuggest, getParserServices, isAwaitKeyword, @@ -14,12 +17,14 @@ import { NullThrowsReasons, } from '../util'; import { getForStatementHeadLoc } from '../util/getForStatementHeadLoc'; +import { isPromiseAggregatorMethod } from '../util/isPromiseAggregatorMethod'; export type MessageId = | 'await' | 'awaitUsingOfNonAsyncDisposable' | 'convertToOrdinaryFor' | 'forAwaitOfNonAsyncIterable' + | 'invalidPromiseAggregatorInput' | 'removeAwait'; export default createRule<[], MessageId>({ @@ -39,6 +44,8 @@ export default createRule<[], MessageId>({ convertToOrdinaryFor: 'Convert to an ordinary `for...of` loop.', forAwaitOfNonAsyncIterable: 'Unexpected `for await...of` of a value that is not async iterable.', + invalidPromiseAggregatorInput: + 'Unexpected iterable of non-Promise (non-"Thenable") values passed to promise aggregator.', removeAwait: 'Remove unnecessary `await`.', }, schema: [], @@ -84,6 +91,53 @@ export default createRule<[], MessageId>({ } }, + CallExpression(node: TSESTree.CallExpression): void { + if (!isPromiseAggregatorMethod(context, services, node)) { + return; + } + + const argument = node.arguments.at(0); + + if (argument == null) { + return; + } + + if (argument.type === TSESTree.AST_NODE_TYPES.ArrayExpression) { + for (const element of argument.elements) { + if (element == null) { + continue; + } + + const type = getConstrainedTypeAtLocation(services, element); + const tsNode = services.esTreeNodeToTSNodeMap.get(element); + + if (containsNonAwaitableType(type, tsNode, checker)) { + context.report({ + node: element, + messageId: 'invalidPromiseAggregatorInput', + }); + } + } + + return; + } + + const type = getConstrainedTypeAtLocation(services, argument); + + if ( + isInvalidPromiseAggregatorInput( + checker, + services.esTreeNodeToTSNodeMap.get(argument), + type, + ) + ) { + context.report({ + node: argument, + messageId: 'invalidPromiseAggregatorInput', + }); + } + }, + 'ForOfStatement[await=true]'(node: TSESTree.ForOfStatement): void { const type = services.getTypeAtLocation(node.right); if (isTypeAnyType(type)) { @@ -176,3 +230,75 @@ export default createRule<[], MessageId>({ }; }, }); + +function isInvalidPromiseAggregatorInput( + checker: ts.TypeChecker, + node: ts.Node, + type: ts.Type, +): boolean { + // non array/tuple/iterable types already show up as a type error + if (!isIterable(type, checker)) { + return false; + } + + for (const part of tsutils.unionConstituents(type)) { + const valueTypes = getValueTypesOfArrayLike(part, checker); + + if (valueTypes != null) { + for (const typeArgument of valueTypes) { + if (containsNonAwaitableType(typeArgument, node, checker)) { + return true; + } + } + } + } + + return false; +} + +function getValueTypesOfArrayLike( + type: ts.Type, + checker: ts.TypeChecker, +): readonly ts.Type[] | null { + if (checker.isTupleType(type)) { + return checker.getTypeArguments(type); + } + + if (checker.isArrayLikeType(type)) { + return [ + nullThrows( + type.getNumberIndexType(), + 'number index type should exist on an array-like', + ), + ]; + } + + // `Iterable<...>` + if (tsutils.isTypeReference(type)) { + return checker.getTypeArguments(type).slice(0, 1); + } + + return null; +} + +function containsNonAwaitableType( + type: ts.Type, + node: ts.Node, + checker: ts.TypeChecker, +): boolean { + return tsutils + .unionConstituents(type) + .some( + typeArgumentPart => + needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never, + ); +} + +function isIterable(type: ts.Type, checker: ts.TypeChecker): boolean { + return tsutils + .unionConstituents(type) + .every( + part => + !!tsutils.getWellKnownSymbolPropertyOfType(part, 'iterator', checker), + ); +} diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts index 088b8768b3af..d18f7617acfc 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts @@ -19,6 +19,18 @@ type MessageIds = | 'suggestSatisfies' | 'unnecessaryTypeConversion'; +function isEnumType(type: ts.Type): boolean { + return (type.getFlags() & ts.TypeFlags.EnumLike) !== 0; +} + +function isEnumMemberType(type: ts.Type): boolean { + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + return (symbol.flags & ts.SymbolFlags.EnumMember) !== 0; +} + export default createRule({ name: 'no-unnecessary-type-conversion', meta: { @@ -294,6 +306,11 @@ export default createRule({ ): void { const memberExpr = node.parent as TSESTree.MemberExpression; const type = getConstrainedTypeAtLocation(services, memberExpr.object); + + if (isEnumType(type) || isEnumMemberType(type)) { + return; + } + if (doesUnderlyingTypeMatchFlag(type, ts.TypeFlags.StringLike)) { const wrappingFixerParams = { node: memberExpr.parent, diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index ee946a4f85a0..39125b9dc891 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -1,4 +1,8 @@ -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { + NodeWithParent, + TSESLint, + TSESTree, +} from '@typescript-eslint/utils'; import { RegExpParser } from '@eslint-community/regexpp'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; @@ -376,13 +380,10 @@ export default createRule({ yield fixer.removeRange([callNode.range[1], node.range[1]]); } - function getParent(node: TSESTree.Node): TSESTree.Node { - return nullThrows( - node.parent?.type === AST_NODE_TYPES.ChainExpression - ? node.parent.parent - : node.parent, - NullThrowsReasons.MissingParent, - ); + function getParent(node: NodeWithParent): TSESTree.Node { + return node.parent.type === AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; } return { diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index 0e3b98ef7657..b9aeb65dbede 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -1,10 +1,6 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { - AST_NODE_TYPES, - ASTUtils, - ESLintUtils, -} from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; import { isConstructor, isSetter, isTypeAssertion } from './astUtils'; import { getFunctionHeadLoc } from './getFunctionHeadLoc'; @@ -210,19 +206,14 @@ export function isTypedFunctionExpression( node: FunctionExpression, options: Options, ): boolean { - const parent = ESLintUtils.nullThrows( - node.parent, - ESLintUtils.NullThrowsReasons.MissingParent, - ); - if (!options.allowTypedFunctionExpressions) { return false; } return ( - isTypedParent(parent, node) || - isPropertyOfObjectWithType(parent) || - isConstructorArgument(parent) + isTypedParent(node.parent, node) || + isPropertyOfObjectWithType(node.parent) || + isConstructorArgument(node.parent) ); } @@ -238,16 +229,12 @@ export function isValidFunctionExpressionReturnType( return true; } - const parent = ESLintUtils.nullThrows( - node.parent, - ESLintUtils.NullThrowsReasons.MissingParent, - ); if ( options.allowExpressions && - parent.type !== AST_NODE_TYPES.VariableDeclarator && - parent.type !== AST_NODE_TYPES.MethodDefinition && - parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration && - parent.type !== AST_NODE_TYPES.PropertyDefinition + node.parent.type !== AST_NODE_TYPES.VariableDeclarator && + node.parent.type !== AST_NODE_TYPES.MethodDefinition && + node.parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration && + node.parent.type !== AST_NODE_TYPES.PropertyDefinition ) { return true; } diff --git a/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts new file mode 100644 index 000000000000..e5f9e67617d6 --- /dev/null +++ b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts @@ -0,0 +1,41 @@ +import type { + ParserServicesWithTypeInformation, + TSESTree, +} from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; + +import { + getConstrainedTypeAtLocation, + isPromiseConstructorLike, +} from '@typescript-eslint/type-utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import { getStaticMemberAccessValue } from './misc'; + +const PROMISE_CONSTRUCTOR_ARRAY_METHODS = new Set([ + 'all', + 'allSettled', + 'race', + 'any', +]); + +export function isPromiseAggregatorMethod( + context: RuleContext, + services: ParserServicesWithTypeInformation, + node: TSESTree.CallExpression, +): boolean { + if (node.callee.type !== AST_NODE_TYPES.MemberExpression) { + return false; + } + + const staticAccessValue = getStaticMemberAccessValue(node.callee, context); + + if (!PROMISE_CONSTRUCTOR_ARRAY_METHODS.has(staticAccessValue)) { + return false; + } + + return isPromiseConstructorLike( + services.program, + getConstrainedTypeAtLocation(services, node.callee.object), + ); +} diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index e64f0a5f1f3c..f1729d908bdb 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -339,6 +339,353 @@ class C { } `, }, + + { + code: ` +// @ts-expect-error +Promise.all(); + `, + }, + { + code: ` +Promise.all([,]); + `, + }, + { + code: ` +declare const x: unknown; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: any; +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array> | Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array | Promise>; +Promise.all(x); + `, + }, + { + code: ` +function f(x: Array>) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: Array) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: Array; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | Array>; + +// @ts-expect-error +Promise.all(x); + `, + }, + + { + code: ` +declare const x: [Promise, Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: [Promise] | [Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: [Promise | Promise]; +Promise.all(x); + `, + }, + { + code: ` +function f(x: [Promise]) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: [T]) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: [unknown, any]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | [Promise]; + +// @ts-expect-error +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable> | Iterable>; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + }, + { + code: ` +function f(x: Iterable>) { + Promise.all(x); +} + `, + }, + { + code: ` +function f>(x: Iterable) { + Promise.all(x); +} + `, + }, + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + }, + { + code: ` +declare const x: number | Iterable>; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +declare const x: Iterable, number>; +Promise.all(x); + `, + }, + + { + code: ` +declare const x: Iterable> | Array>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: + | Iterable> + | [Promise, Promise]; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Array> | [Promise, Promise]; +Promise.all(x); + `, + }, + + { + code: ` +// @ts-expect-error +Promise.all(1); + `, + }, + { + code: ` +declare const x: Promise; + +// @ts-expect-error +Promise.all(x); + `, + }, + { + code: ` +interface MyArray extends Array {} +declare const x: MyArray>; + +Promise.all(x); + `, + }, + { + code: ` +function* x() { + yield Promise.resolve(1); + yield Promise.resolve(2); + yield Promise.resolve(3); +} + +Promise.all(x()); + `, + }, + { + code: ` +function* x() { + yield 1 as unknown; +} + +Promise.all(x()); + `, + }, + { + code: ` +function* x() { + yield 1 as any; +} + +Promise.all(x()); + `, + }, + { + code: ` +declare const x: Generator>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray>; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + }, + { + code: ` +Promise.all([Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)]); + `, + }, + { + code: ` +declare const _unknown_: unknown; + +Promise.all([ + _unknown_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +declare const _any_: any; + +Promise.all([ + _any_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +declare const _promise_: Promise; + +Promise.all([ + _promise_, + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), +]); + `, + }, + { + code: ` +Promise.all([ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ...[Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)], +]); + `, + }, ], invalid: [ @@ -786,5 +1133,309 @@ class C { }, ], }, + + { + code: ` +declare const x: Array; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | Array>; +Promise.race(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | Array; +Promise.allSettled(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array>; +Promise.any(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: [number]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [number] | [Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [number | Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: [Promise, number]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: Iterable; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable | Iterable>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + + { + code: ` +declare const x: Iterable | Array>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Iterable> | [string, Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array | [Promise, Promise]; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Array>>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +interface MyArray extends Array {} +declare const x: MyArray, null>; + +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1; + yield 2; + yield 3; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1 as number; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +function* x() { + yield 1 as number | Promise; +} + +Promise.all(x()); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: Generator; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: ReadonlyArray; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +declare const x: ReadonlyArray>; +Promise.all(x); + `, + errors: [ + { + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([Promise.resolve(1), 2, Promise.resolve(3)]); + `, + errors: [ + { + column: 34, + endColumn: 35, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([1, 2, Promise.resolve(3)]); + `, + errors: [ + { + column: 14, + endColumn: 15, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + { + column: 17, + endColumn: 18, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, + { + code: ` +Promise.all([...[1, 2, 3]]); + `, + errors: [ + { + column: 14, + endColumn: 26, + line: 2, + messageId: 'invalidPromiseAggregatorInput', + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts index e3e5e39ccb90..4f36f96e584a 100644 --- a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts +++ b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts @@ -96,6 +96,16 @@ class Person { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Person { + constructor(name: string) { /* empty */ } +} + `, + }, + ], }, ], }, @@ -113,6 +123,16 @@ class Person { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Person { + otherMethod(name: string) { /* empty */ } +} + `, + }, + ], }, ], }, @@ -130,6 +150,16 @@ class Foo { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + private constructor() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -147,6 +177,16 @@ class Foo { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + protected constructor() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -162,6 +202,14 @@ function foo() {} }, line: 2, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +function foo() { /* empty */ } + `, + }, + ], }, ], }, @@ -180,6 +228,17 @@ class Foo { }, line: 4, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo { + @decorator() + foo() { /* empty */ } +} + `, + }, + ], }, ], }, @@ -197,6 +256,16 @@ class Foo extends Base { }, line: 3, messageId: 'unexpected', + suggestions: [ + { + messageId: 'suggestComment', + output: ` +class Foo extends Base { + override foo() { /* empty */ } +} + `, + }, + ], }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts index 50995fb3a90d..71f5e56e0d1a 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts @@ -97,6 +97,14 @@ ruleTester.run('no-unnecessary-type-conversion', rule, { '~~new Number();', 'Boolean(new Boolean());', '!!new Boolean();', + ` + enum CustomIds { + Id1 = 'id1', + Id2 = 'id2', + } + const customId = 'id1'; + const compareWithToString = customId === CustomIds.Id1.toString(); + `, ], invalid: [ diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index b7a830094823..589e2a8e4fb8 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -163,7 +163,7 @@ declare module 'eslint/lib/rules/no-empty-function' { import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< - 'unexpected', + 'suggestComment' | 'unexpected', [ { allow?: string[]; diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 80efaa535cbf..8d1ea2c3c5a4 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for parser to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index b152070d6d7d..19b621151505 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.43.0", + "version": "8.44.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 1f306a50c759..092a642891f9 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for project-service to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 97b05cd5eed0..da5b76225005 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.43.0", + "version": "8.44.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.43.0", - "@typescript-eslint/types": "^8.43.0", + "@typescript-eslint/tsconfig-utils": "^8.44.0", + "@typescript-eslint/types": "^8.44.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 070d93a9ffa4..7f895b5e5334 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 202c5811ec11..bbcbbfa3615f 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.43.0", + "version": "8.44.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/type-utils": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index d3d95f8f405a..fecac3bc3086 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for rule-tester to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 1f93b49b727a..c30c880998ec 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.43.0", + "version": "8.44.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index b2fc59f25ead..944dd764947f 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index e3416d621b3c..719daddf8f67 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.43.0", + "version": "8.44.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0" + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/typescript-estree": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 91bede7256f5..e758fb5abd16 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index fc5f1f667245..b112bc1bb021 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index f76b267d9ee7..6163c6f95df3 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for type-utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 7f95c6572b5d..997aa43dc724 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/parser": "8.44.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 25d996362475..9ab94998069d 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/types/package.json b/packages/types/package.json index 890b838e2549..824ae019c24b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.43.0", + "version": "8.44.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index 1ffe823277da..92fdc7a6bc41 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index b7ec11091d60..55d767d36490 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.43.0", + "version": "8.44.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.43.0", - "@typescript-eslint/parser": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0", - "@typescript-eslint/utils": "8.43.0" + "@typescript-eslint/eslint-plugin": "8.44.0", + "@typescript-eslint/parser": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0", + "@typescript-eslint/utils": "8.44.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index e0d097bc0f88..bec95ad0397e 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🚀 Features diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 283697eb4486..02d35fb5449e 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.43.0", + "version": "8.44.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.43.0", - "@typescript-eslint/tsconfig-utils": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/visitor-keys": "8.43.0", + "@typescript-eslint/project-service": "8.44.0", + "@typescript-eslint/tsconfig-utils": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/visitor-keys": "8.44.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index e6029c9e5864..6fb0ea01611e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) ### 🩹 Fixes diff --git a/packages/utils/package.json b/packages/utils/package.json index 37c4c66a1aff..92d1f49bda3f 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.43.0", + "version": "8.44.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.43.0", - "@typescript-eslint/types": "8.43.0", - "@typescript-eslint/typescript-estree": "8.43.0" + "@typescript-eslint/scope-manager": "8.44.0", + "@typescript-eslint/types": "8.44.0", + "@typescript-eslint/typescript-estree": "8.44.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 49e461b89934..1a4920a3e79e 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -138,7 +138,7 @@ export interface RuleMetaData< /** * Specifies default options for the rule. If present, any user-provided options in their config will be merged on top of them recursively. * This merging will be applied directly to `context.options`. - * If you want backwards-compatible support for earlier ESLint version; consider using the top-level `defaultOptions` instead. + * If you want backwards-compatible support for earlier ESLint version, consider using the top-level `defaultOptions` instead. * * since ESLint 9.15.0 */ diff --git a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts index 1861200f51b4..db140a033163 100644 --- a/packages/utils/src/ts-eslint/eslint/FlatESLint.ts +++ b/packages/utils/src/ts-eslint/eslint/FlatESLint.ts @@ -49,9 +49,13 @@ export namespace FlatESLint { */ ignorePatterns?: string[] | null; /** - * The path to a configuration file, overrides all configurations used with this instance. + * The path to a configuration file. Overrides all configurations used with this instance. * The options.overrideConfig option is applied after this option is applied. - * Searches for default config file when falsy; doesn't do any config file lookup when `true`; considered to be a config filename when a string. + * + * - When falsy, searches for default config file. + * - When `true`, does not do any config file lookup. + * - When a string, considered to be a config file name. + * * @default false */ overrideConfigFile?: boolean | string; diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 34e4a4bbe64c..561af2e738aa 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.44.0 (2025-09-15) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website. + ## 8.43.0 (2025-09-08) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 69ad03182abe..c48f8b7eba69 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.43.0", + "version": "8.44.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/types": "8.44.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index f041745c50c5..4aa74f3880d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3679,14 +3679,14 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0": - version: 4.7.0 - resolution: "@eslint-community/eslint-utils@npm:4.7.0" +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.5.1, @eslint-community/eslint-utils@npm:^4.7.0, @eslint-community/eslint-utils@npm:^4.8.0": + version: 4.9.0 + resolution: "@eslint-community/eslint-utils@npm:4.9.0" dependencies: eslint-visitor-keys: ^3.4.3 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: b177e3b75c0b8d0e5d71f1c532edb7e40b31313db61f0c879f9bf19c3abb2783c6c372b5deb2396dab4432f2946b9972122ac682e77010376c029dfd0149c681 + checksum: ae9b98eea006d1354368804b0116b8b45017a4e47b486d1b9cfa048a8ed3dc69b9b074eb2b2acb14034e6897c24048fd42b6a6816d9dc8bb9daad79db7d478d2 languageName: node linkType: hard @@ -3762,10 +3762,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:*, @eslint/js@npm:9.34.0, @eslint/js@npm:^9.26.0": - version: 9.34.0 - resolution: "@eslint/js@npm:9.34.0" - checksum: 933d4ba321b1abc83eecde40eb703871ce00f133eedec54cf928b7fedb61706174dd526997c3f151776922412e3d95cb3634f97ef7b5861b4908f9992f403a63 +"@eslint/js@npm:*, @eslint/js@npm:9.35.0, @eslint/js@npm:^9.26.0": + version: 9.35.0 + resolution: "@eslint/js@npm:9.35.0" + checksum: ea644f0b1abb4da49ba0cb61db4d039492e844d959e7127dd7c501aa27a256348496bce43334ecd3ca990c9a49fb3ea93d6729de0a79d216f63869236c153148 languageName: node linkType: hard @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.43.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.44.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.43.0 - "@typescript-eslint/rule-tester": 8.43.0 - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/type-utils": 8.43.0 - "@typescript-eslint/utils": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.44.0 + "@typescript-eslint/rule-tester": 8.44.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/type-utils": 8.44.0 + "@typescript-eslint/utils": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.43.0 + "@typescript-eslint/parser": ^8.44.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.43.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.44.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.43.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.44.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.43.0 - "@typescript-eslint/types": ^8.43.0 + "@typescript-eslint/tsconfig-utils": ^8.44.0 + "@typescript-eslint/types": ^8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.43.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.44.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/type-utils": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.43.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.44.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.44.0, @typescript-eslint/scope-manager@^8.41.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.43.0, @typescript-eslint/tsconfig-utils@^8.43.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.44.0, @typescript-eslint/tsconfig-utils@^8.44.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.43.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.44.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.43.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.43.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.44.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.44.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6049,7 +6049,7 @@ __metadata: "@typescript-eslint/typescript-estree": "workspace:^" "@typescript-eslint/utils": "workspace:^" "@vitest/coverage-v8": ^3.1.3 - "@vitest/eslint-plugin": ^1.1.44 + "@vitest/eslint-plugin": ^1.3.9 console-fail-test: ^0.5.0 cross-fetch: ^4.0.0 cspell: ^9.0.0 @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.43.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.44.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.43.0 - "@typescript-eslint/tsconfig-utils": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/visitor-keys": 8.43.0 + "@typescript-eslint/project-service": 8.44.0 + "@typescript-eslint/tsconfig-utils": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/visitor-keys": 8.44.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.43.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.44.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.43.0 - "@typescript-eslint/types": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/scope-manager": 8.44.0 + "@typescript-eslint/types": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.43.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.44.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/types": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -6206,10 +6206,11 @@ __metadata: languageName: node linkType: hard -"@vitest/eslint-plugin@npm:^1.1.44": - version: 1.3.4 - resolution: "@vitest/eslint-plugin@npm:1.3.4" +"@vitest/eslint-plugin@npm:^1.3.9": + version: 1.3.9 + resolution: "@vitest/eslint-plugin@npm:1.3.9" dependencies: + "@typescript-eslint/scope-manager": ^8.41.0 "@typescript-eslint/utils": ^8.24.1 peerDependencies: eslint: ">= 8.57.0" @@ -6220,7 +6221,7 @@ __metadata: optional: true vitest: optional: true - checksum: 9cd8afc3a27ee247e3ebe9455f7c9df334824115459d640f38086121fd67142ee0523d9b30e55ce8dda7504d9c5cabaf80f351238fc64f33fc53ef92a59bba68 + checksum: 8d54a2026715c5966f9ff285b11ed3aad4873870ea9d3bc9a3d87b69cbf1725fdade2ddae489c20662f436c0de48019d79b5346391c642ecb3335470e9034448 languageName: node linkType: hard @@ -9971,16 +9972,16 @@ __metadata: linkType: hard "eslint@npm:*, eslint@npm:^9.15.0, eslint@npm:^9.26.0": - version: 9.34.0 - resolution: "eslint@npm:9.34.0" + version: 9.35.0 + resolution: "eslint@npm:9.35.0" dependencies: - "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/eslint-utils": ^4.8.0 "@eslint-community/regexpp": ^4.12.1 "@eslint/config-array": ^0.21.0 "@eslint/config-helpers": ^0.3.1 "@eslint/core": ^0.15.2 "@eslint/eslintrc": ^3.3.1 - "@eslint/js": 9.34.0 + "@eslint/js": 9.35.0 "@eslint/plugin-kit": ^0.3.5 "@humanfs/node": ^0.16.6 "@humanwhocodes/module-importer": ^1.0.1 @@ -10016,7 +10017,7 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 6de97f6197774821a086783e1bd73b9518c4eb8896165e448a8bb2359142c63cad40faa5dc79bcdc28fab20b57e1376ccbb76a6ae081da5e94baa18d2d3b92fe + checksum: 45b12539f84d7ae474920f279b4a0f1e1074eaff152f6d2b6a5fb112174914853f18071876da6421c11d678319fd78745ea03ed56b6808d77f76397e488cde28 languageName: node linkType: hard @@ -10434,7 +10435,7 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^10.1.3": +"file-entry-cache@npm:^10.1.4": version: 10.1.4 resolution: "file-entry-cache@npm:10.1.4" dependencies: @@ -18774,8 +18775,8 @@ __metadata: linkType: hard "stylelint@npm:^16.3.1": - version: 16.23.1 - resolution: "stylelint@npm:16.23.1" + version: 16.24.0 + resolution: "stylelint@npm:16.24.0" dependencies: "@csstools/css-parser-algorithms": ^3.0.5 "@csstools/css-tokenizer": ^3.0.4 @@ -18790,7 +18791,7 @@ __metadata: debug: ^4.4.1 fast-glob: ^3.3.3 fastest-levenshtein: ^1.0.16 - file-entry-cache: ^10.1.3 + file-entry-cache: ^10.1.4 global-modules: ^2.0.0 globby: ^11.1.0 globjoin: ^0.1.4 @@ -18817,7 +18818,7 @@ __metadata: write-file-atomic: ^5.0.1 bin: stylelint: bin/stylelint.mjs - checksum: e86bd662f3fa6b77c4fa6c72a8ba9fa0dcf46937dedd86a9fbc0e1193f55c4f26d4ae595990fa1e288d96f112859158094fa8566681ce6282e2bab33ec60c676 + checksum: b9a2926b4f1635c050d13c266cd017a3f7994b4b76aa22532b896ec600143a37d17d6d629c0a27b50a97ee0c62c2fad8b5796c643bbe612c5a473ed1b79deaa3 languageName: node linkType: hard @@ -19359,10 +19360,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.43.0 - "@typescript-eslint/parser": 8.43.0 - "@typescript-eslint/typescript-estree": 8.43.0 - "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/eslint-plugin": 8.44.0 + "@typescript-eslint/parser": 8.44.0 + "@typescript-eslint/typescript-estree": 8.44.0 + "@typescript-eslint/utils": 8.44.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*"