diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b597fe630d..711f3451a829 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## 8.19.1 (2025-01-06) + +### 🩹 Fixes + +- **eslint-plugin:** [no-base-to-string] check array generic type ([#10437](https://github.com/typescript-eslint/typescript-eslint/pull/10437)) +- **eslint-plugin:** [no-shadow] report correctly on parameters of functions declared with the `declare` keyword ([#10543](https://github.com/typescript-eslint/typescript-eslint/pull/10543)) +- **eslint-plugin:** [strict-boolean-expressions] remove remaining (unsafe) autofixes ([#10548](https://github.com/typescript-eslint/typescript-eslint/pull/10548)) +- **eslint-plugin:** [no-deprecated] doesn't report on shorthand property in an object expression ([#10550](https://github.com/typescript-eslint/typescript-eslint/pull/10550)) +- **eslint-plugin:** [no-unnecessary-type-assertion] handle literal types ([#10523](https://github.com/typescript-eslint/typescript-eslint/pull/10523)) + +### ❤️ Thank You + +- Kirk Waiblinger +- mdm317 +- Ronen Amiel +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) ### 🚀 Features diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 320972f4ea31..22d1cf486c40 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for ast-spec to align it with other projects, there were no code changes. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 30af8caa6b5d..f61f101d1076 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.19.0", + "version": "8.19.1", "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 d2fb9d877008..5f09576dd2b0 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,22 @@ +## 8.19.1 (2025-01-06) + +### 🩹 Fixes + +- **eslint-plugin:** [no-unnecessary-type-assertion] handle literal types ([#10523](https://github.com/typescript-eslint/typescript-eslint/pull/10523)) +- **eslint-plugin:** [no-deprecated] doesn't report on shorthand property in an object expression ([#10550](https://github.com/typescript-eslint/typescript-eslint/pull/10550)) +- **eslint-plugin:** [strict-boolean-expressions] remove remaining (unsafe) autofixes ([#10548](https://github.com/typescript-eslint/typescript-eslint/pull/10548)) +- **eslint-plugin:** [no-shadow] report correctly on parameters of functions declared with the `declare` keyword ([#10543](https://github.com/typescript-eslint/typescript-eslint/pull/10543)) +- **eslint-plugin:** [no-base-to-string] check array generic type ([#10437](https://github.com/typescript-eslint/typescript-eslint/pull/10437)) + +### ❤️ Thank You + +- Kirk Waiblinger +- mdm317 +- Ronen Amiel +- Yukihiro Hasegawa @y-hsgw + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) ### 🚀 Features diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx index 06cfc9eb33fe..c03d369cf069 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx @@ -62,7 +62,7 @@ function head(items: T[]) { } function foo(arg: string) { - // Necessary, since foo might be ''. + // Necessary, since arg might be ''. if (arg) { } } diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx index f1c156578084..d5742e1a8730 100644 --- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx +++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.mdx @@ -198,13 +198,13 @@ const x = Boolean(a ?? b); ### `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing` -{/* insert option description */} - :::danger Deprecated -> This option will be removed in the next major version of typescript-eslint. -> ::: -> Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`. +This option will be removed in the next major version of typescript-eslint. + +::: + +{/* insert option description */} Without `strictNullChecks`, TypeScript essentially erases `undefined` and `null` from the types. This means when this rule inspects the types from a variable, **it will not be able to tell that the variable might be `null` or `undefined`**, which essentially makes this rule useless. diff --git a/packages/eslint-plugin/docs/rules/return-await.mdx b/packages/eslint-plugin/docs/rules/return-await.mdx index 34173fae9265..db4f2f5fe5b7 100644 --- a/packages/eslint-plugin/docs/rules/return-await.mdx +++ b/packages/eslint-plugin/docs/rules/return-await.mdx @@ -9,15 +9,24 @@ import TabItem from '@theme/TabItem'; > > See **https://typescript-eslint.io/rules/return-await** for documentation. -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: +In `async` functions, it is valid to return a promise-wrapped value or a value directly, both of which ultimately produce a promise with the same fulfillment value. Returning a value rather than a promise-wrapped value can have several subtle benefits: - 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. +- When the `return` statement is in `try...catch`, awaiting the promise 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). +This rule enforces consistent handling of whether to await promises before returning them. + +:::info + +This rule used to be considered an extension of the (now-deprecated) ESLint core rule [`no-return-await`](https://eslint.org/docs/latest/rules/no-return-await#options). +Without type information, the only situations that could be flagged by `no-return-await` were of neutral-to-negative value, which eventually led to its deprecation. +In contrast, with access to type information, `@typescript-eslint/return-await` delivers enough positive value to earn it a spot in our strict preset. + +If you previously used `no-return-await`, this rule's `in-try-catch` option has the closest behavior to the `no-return-await` rule. + +::: + ## Options ```ts @@ -326,3 +335,5 @@ async function validNever3() { + +{/* Intentionally Omitted: When Not To Use It */} diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.mdx b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.mdx index c0e71ec42c95..a827ca7005cd 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.mdx +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.mdx @@ -172,38 +172,6 @@ You should be using `strictNullChecks` to ensure complete type-safety in your co If for some reason you cannot turn on `strictNullChecks`, but still want to use this rule - you can use this option to allow it - but know that the behavior of this rule is _undefined_ with the compiler option turned off. We will not accept bug reports if you are using this option. -## Fixes and Suggestions - -This rule provides following fixes and suggestions for particular types in boolean context: - -- `boolean` - Always allowed - no fix needed. -- `string` - (when `allowString` is `false`) - Provides following suggestions: - - Change condition to check string's length (`str` → `str.length > 0`) - - Change condition to check for empty string (`str` → `str !== ""`) - - Explicitly convert value to a boolean (`str` → `Boolean(str)`) -- `number` - (when `allowNumber` is `false`): - - For `array.length` - Provides **autofix**: - - Change condition to check for 0 (`array.length` → `array.length > 0`) - - For other number values - Provides following suggestions: - - Change condition to check for 0 (`num` → `num !== 0`) - - Change condition to check for NaN (`num` → `!Number.isNaN(num)`) - - Explicitly convert value to a boolean (`num` → `Boolean(num)`) -- `object | null | undefined` - (when `allowNullableObject` is `false`) - Provides **autofix**: - - Change condition to check for null/undefined (`maybeObj` → `maybeObj != null`) -- `boolean | null | undefined` - Provides following suggestions: - - Explicitly treat nullish value the same as false (`maybeBool` → `maybeBool ?? false`) - - Change condition to check for true/false (`maybeBool` → `maybeBool === true`) -- `string | null | undefined` - Provides following suggestions: - - Change condition to check for null/undefined (`maybeStr` → `maybeStr != null`) - - Explicitly treat nullish value the same as an empty string (`maybeStr` → `maybeStr ?? ""`) - - Explicitly convert value to a boolean (`maybeStr` → `Boolean(maybeStr)`) -- `number | null | undefined` - Provides following suggestions: - - Change condition to check for null/undefined (`maybeNum` → `maybeNum != null`) - - Explicitly treat nullish value the same as 0 (`maybeNum` → `maybeNum ?? 0`) - - Explicitly convert value to a boolean (`maybeNum` → `Boolean(maybeNum)`) -- `any` and `unknown` - Provides following suggestions: - - Explicitly convert value to a boolean (`value` → `Boolean(value)`) - ## When Not To Use It If your project isn't likely to experience bugs from falsy non-boolean values being used in logical conditions, you can skip enabling this rule. diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index ab47506850f2..e095420fd0d6 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.19.0", + "version": "8.19.1", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -61,22 +61,22 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.19.0", - "@typescript-eslint/type-utils": "8.19.0", - "@typescript-eslint/utils": "8.19.0", - "@typescript-eslint/visitor-keys": "8.19.0", + "@typescript-eslint/scope-manager": "8.19.1", + "@typescript-eslint/type-utils": "8.19.1", + "@typescript-eslint/utils": "8.19.1", + "@typescript-eslint/visitor-keys": "8.19.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "devDependencies": { "@jest/types": "29.6.3", "@types/marked": "^5.0.2", "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.19.0", - "@typescript-eslint/rule-tester": "8.19.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.19.1", + "@typescript-eslint/rule-tester": "8.19.1", "ajv": "^6.12.6", "cross-env": "^7.0.3", "cross-fetch": "*", diff --git a/packages/eslint-plugin/src/configs/disable-type-checked.ts b/packages/eslint-plugin/src/configs/disable-type-checked.ts index 061df20cdd65..95efeca0cd5b 100644 --- a/packages/eslint-plugin/src/configs/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/disable-type-checked.ts @@ -8,7 +8,7 @@ import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; export = { - parserOptions: { project: false, program: null, projectService: false }, + parserOptions: { program: null, project: false, projectService: false }, rules: { '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/consistent-return': 'off', diff --git a/packages/eslint-plugin/src/configs/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/strict-type-checked-only.ts index c235c02e7b81..e5be4357f195 100644 --- a/packages/eslint-plugin/src/configs/strict-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/strict-type-checked-only.ts @@ -61,10 +61,10 @@ export = { { allowAny: false, allowBoolean: false, + allowNever: false, allowNullish: false, allowNumber: false, allowRegExp: false, - allowNever: false, }, ], 'no-return-await': 'off', diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index b681f820a3b0..f7afc31d1ecd 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -18,12 +18,12 @@ enum Usefulness { Sometimes = 'may', } -type Options = [ +export type Options = [ { ignoredTypeNames?: string[]; }, ]; -type MessageIds = 'baseArrayJoin' | 'baseToString'; +export type MessageIds = 'baseArrayJoin' | 'baseToString'; export default createRule({ name: 'no-base-to-string', @@ -140,6 +140,28 @@ export default createRule({ return Usefulness.Never; } + function collectTupleCertainty(type: ts.TypeReference): Usefulness { + const typeArgs = checker.getTypeArguments(type); + const certainties = typeArgs.map(t => collectToStringCertainty(t)); + if (certainties.some(certainty => certainty === Usefulness.Never)) { + return Usefulness.Never; + } + + if (certainties.some(certainty => certainty === Usefulness.Sometimes)) { + return Usefulness.Sometimes; + } + + return Usefulness.Always; + } + + function collectArrayCertainty(type: ts.Type): Usefulness { + const elemType = nullThrows( + type.getNumberIndexType(), + 'array should have number index type', + ); + return collectToStringCertainty(elemType); + } + function collectJoinCertainty(type: ts.Type): Usefulness { if (tsutils.isUnionType(type)) { return collectUnionTypeCertainty(type, collectJoinCertainty); @@ -150,33 +172,18 @@ export default createRule({ } if (checker.isTupleType(type)) { - const typeArgs = checker.getTypeArguments(type); - const certainties = typeArgs.map(t => collectToStringCertainty(t)); - if (certainties.some(certainty => certainty === Usefulness.Never)) { - return Usefulness.Never; - } - - if (certainties.some(certainty => certainty === Usefulness.Sometimes)) { - return Usefulness.Sometimes; - } - - return Usefulness.Always; + return collectTupleCertainty(type); } if (checker.isArrayType(type)) { - const elemType = nullThrows( - type.getNumberIndexType(), - 'array should have number index type', - ); - return collectToStringCertainty(elemType); + return collectArrayCertainty(type); } return Usefulness.Always; } function collectToStringCertainty(type: ts.Type): Usefulness { - // https://github.com/JoshuaKGoldberg/ts-api-utils/issues/382 - if ((tsutils.isTypeParameter as (t: ts.Type) => boolean)(type)) { + if (tsutils.isTypeParameter(type)) { const constraint = type.getConstraint(); if (constraint) { return collectToStringCertainty(constraint); @@ -205,6 +212,14 @@ export default createRule({ return collectUnionTypeCertainty(type, collectToStringCertainty); } + if (checker.isTupleType(type)) { + return collectTupleCertainty(type); + } + + if (checker.isArrayType(type)) { + return collectArrayCertainty(type); + } + const toString = checker.getPropertyOfType(type, 'toString') ?? checker.getPropertyOfType(type, 'toLocaleString'); diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts index 7fb966a249b0..5812bec7ed9d 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -312,9 +312,17 @@ export default createRule({ const property = services .getTypeAtLocation(node.parent.parent) .getProperty(node.name); - const symbol = services.getSymbolAtLocation(node); - return getJsDocDeprecation(property) ?? getJsDocDeprecation(symbol); + const propertySymbol = services.getSymbolAtLocation(node); + const valueSymbol = checker.getShorthandAssignmentValueSymbol( + propertySymbol?.valueDeclaration, + ); + return ( + getJsDocDeprecation(property) ?? + getJsDocDeprecation(propertySymbol) ?? + getJsDocDeprecation(valueSymbol) + ); } + return searchForDeprecationInAliasesChain( services.getSymbolAtLocation(node), true, diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index 6a3605e79b8e..0e1f87149608 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -22,6 +22,10 @@ const allowedFunctionVariableDefTypes = new Set([ AST_NODE_TYPES.TSCallSignatureDeclaration, AST_NODE_TYPES.TSFunctionType, AST_NODE_TYPES.TSMethodSignature, + AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + AST_NODE_TYPES.TSDeclareFunction, + AST_NODE_TYPES.TSConstructSignatureDeclaration, + AST_NODE_TYPES.TSConstructorType, ]); export default createRule({ diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 08249fe19e19..97664597ef6d 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -42,13 +42,6 @@ const getValueOfLiteralType = ( return type.value; }; -const isFalsyBigInt = (type: ts.Type): boolean => { - return ( - tsutils.isLiteralType(type) && - valueIsPseudoBigInt(type.value) && - !getValueOfLiteralType(type) - ); -}; const isTruthyLiteral = (type: ts.Type): boolean => tsutils.isTrueLiteralType(type) || (type.isLiteral() && !!getValueOfLiteralType(type)); @@ -71,13 +64,7 @@ const isPossiblyTruthy = (type: ts.Type): boolean => .some(intersectionParts => // It is possible to define intersections that are always falsy, // like `"" & { __brand: string }`. - intersectionParts.every( - type => - !tsutils.isFalsyType(type) && - // below is a workaround for ts-api-utils bug - // see https://github.com/JoshuaKGoldberg/ts-api-utils/issues/544 - !isFalsyBigInt(type), - ), + intersectionParts.every(type => !tsutils.isFalsyType(type)), ); // Nullish utilities @@ -98,10 +85,7 @@ function toStaticValue( | undefined { // type.isLiteral() only covers numbers/bigints and strings, hence the rest of the branches. if (tsutils.isBooleanLiteralType(type)) { - // Using `type.intrinsicName` instead of `type.value` because `type.value` - // is `undefined`, contrary to what the type guard tells us. - // See https://github.com/JoshuaKGoldberg/ts-api-utils/issues/528 - return { value: type.intrinsicName === 'true' }; + return { value: tsutils.isTrueLiteralType(type) }; } if (type.flags === ts.TypeFlags.Undefined) { return { value: undefined }; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts index 90ad42fb0169..8556c51191dc 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts @@ -5,7 +5,7 @@ import * as ts from 'typescript'; import { createRule, - getConstrainedTypeAtLocation, + getConstraintInfo, getMovedNodeCode, getParserServices, isTypeFlagSet, @@ -51,21 +51,29 @@ export default createRule<[], MessageId>({ function isUnderlyingTypeString( expression: TSESTree.Expression, ): expression is TSESTree.Identifier | TSESTree.StringLiteral { - const type = getConstrainedTypeAtLocation(services, expression); + const checker = services.program.getTypeChecker(); + const { constraintType } = getConstraintInfo( + checker, + services.getTypeAtLocation(expression), + ); + + if (constraintType == null) { + return false; + } const isString = (t: ts.Type): boolean => { return isTypeFlagSet(t, ts.TypeFlags.StringLike); }; - if (type.isUnion()) { - return type.types.every(isString); + if (constraintType.isUnion()) { + return constraintType.types.every(isString); } - if (type.isIntersection()) { - return type.types.some(isString); + if (constraintType.isIntersection()) { + return constraintType.types.some(isString); } - return isString(type); + return isString(constraintType); } function isLiteral( diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-parameters.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-parameters.ts index 3e9930128cab..97692770fa70 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-parameters.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-parameters.ts @@ -334,8 +334,7 @@ function collectTypeParameterUsageCounts( return; } - // https://github.com/JoshuaKGoldberg/ts-api-utils/issues/382 - if ((tsutils.isTypeParameter as (type: ts.Type) => boolean)(type)) { + if (tsutils.isTypeParameter(type)) { const declaration = type.getSymbol()?.getDeclarations()?.[0] as | ts.TypeParameterDeclaration | undefined; diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 18cc6e9e420a..a040bbb9463e 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -37,7 +37,6 @@ export default createRule({ type: 'problem', docs: { description: 'Enforce consistent awaiting of returned promises', - extendsBaseRule: 'no-return-await', recommended: { strict: ['error-handling-correctness-only'], }, diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 216929d62630..ab736c0eec4a 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -46,6 +46,8 @@ export type MessageId = | 'conditionErrorOther' | 'conditionErrorString' | 'conditionFixCastBoolean' + | 'conditionFixCompareArrayLengthNonzero' + | 'conditionFixCompareArrayLengthZero' | 'conditionFixCompareEmptyString' | 'conditionFixCompareFalse' | 'conditionFixCompareNaN' @@ -69,7 +71,6 @@ export default createRule({ description: 'Disallow certain types in boolean expressions', requiresTypeChecking: true, }, - fixable: 'code', hasSuggestions: true, messages: { conditionErrorAny: @@ -108,6 +109,10 @@ export default createRule({ conditionFixCastBoolean: 'Explicitly convert value to a boolean (`Boolean(value)`)', + conditionFixCompareArrayLengthNonzero: + "Change condition to check array's length (`value.length > 0`)", + conditionFixCompareArrayLengthZero: + "Change condition to check array's length (`value.length === 0`)", conditionFixCompareEmptyString: 'Change condition to check for empty string (`value !== ""`)', conditionFixCompareFalse: @@ -680,23 +685,33 @@ export default createRule({ context.report({ node, messageId: 'conditionErrorNumber', - fix: getWrappingFixer({ - node: node.parent, - innerNode: node, - sourceCode: context.sourceCode, - wrap: code => `${code} === 0`, - }), + suggest: [ + { + messageId: 'conditionFixCompareArrayLengthZero', + fix: getWrappingFixer({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === 0`, + }), + }, + ], }); } else { // if (array.length) context.report({ node, messageId: 'conditionErrorNumber', - fix: getWrappingFixer({ - node, - sourceCode: context.sourceCode, - wrap: code => `${code} > 0`, - }), + suggest: [ + { + messageId: 'conditionFixCompareArrayLengthNonzero', + fix: getWrappingFixer({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} > 0`, + }), + }, + ], }); } } else if (isLogicalNegationExpression(node.parent)) { @@ -912,22 +927,32 @@ export default createRule({ context.report({ node, messageId: 'conditionErrorNullableEnum', - fix: getWrappingFixer({ - node: node.parent, - innerNode: node, - sourceCode: context.sourceCode, - wrap: code => `${code} == null`, - }), + suggest: [ + { + messageId: 'conditionFixCompareNullish', + fix: getWrappingFixer({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + ], }); } else { context.report({ node, messageId: 'conditionErrorNullableEnum', - fix: getWrappingFixer({ - node, - sourceCode: context.sourceCode, - wrap: code => `${code} != null`, - }), + suggest: [ + { + messageId: 'conditionFixCompareNullish', + fix: getWrappingFixer({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + ], }); } } diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 5b73b1e371e5..6ac4b14bd345 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -165,7 +165,7 @@ String({}); `, ` -([{}, 'bar'] as string[]).join(''); +([{ foo: 'foo' }, 'bar'] as string[]).join(''); `, ` function foo(array: T[]) { @@ -192,33 +192,257 @@ declare const array: string[]; array.join(''); `, ` -class Foo {} +class Foo { + foo: string; +} declare const array: (string & Foo)[]; array.join(''); `, ` -class Foo {} -class Bar {} +class Foo { + foo: string; +} +class Bar { + bar: string; +} declare const array: (string & Foo)[] | (string & Bar)[]; array.join(''); `, ` -class Foo {} -class Bar {} +class Foo { + foo: string; +} +class Bar { + bar: string; +} declare const array: (string & Foo)[] & (string & Bar)[]; array.join(''); `, ` -class Foo {} -class Bar {} +class Foo { + foo: string; +} +class Bar { + bar: string; +} declare const tuple: [string & Foo, string & Bar]; tuple.join(''); `, ` -class Foo {} +class Foo { + foo: string; +} declare const tuple: [string] & [Foo]; tuple.join(''); `, + + ` +String(['foo', 'bar']); + `, + + ` +String([{ foo: 'foo' }, 'bar'] as string[]); + `, + ` +function foo(array: T[]) { + return String(array); +} + `, + ` +class Foo { + toString() { + return ''; + } +} +String([new Foo()]); + `, + ` +declare const array: string[]; +String(array); + `, + ` +class Foo { + foo: string; +} +declare const array: (string & Foo)[]; +String(array); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] | (string & Bar)[]; +String(array); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] & (string & Bar)[]; +String(array); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const tuple: [string & Foo, string & Bar]; +String(tuple); + `, + ` +class Foo { + foo: string; +} +declare const tuple: [string] & [Foo]; +String(tuple); + `, + + ` +['foo', 'bar'].toString(); + `, + + ` +([{ foo: 'foo' }, 'bar'] as string[]).toString(); + `, + ` +function foo(array: T[]) { + return array.toString(); +} + `, + ` +class Foo { + toString() { + return ''; + } +} +[new Foo()].toString(); + `, + ` +declare const array: string[]; +array.toString(); + `, + ` +class Foo { + foo: string; +} +declare const array: (string & Foo)[]; +array.toString(); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] | (string & Bar)[]; +array.toString(); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] & (string & Bar)[]; +array.toString(); + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const tuple: [string & Foo, string & Bar]; +tuple.toString(); + `, + ` +class Foo { + foo: string; +} +declare const tuple: [string] & [Foo]; +tuple.toString(); + `, + + ` +\`\${['foo', 'bar']}\`; + `, + + ` +\`\${[{ foo: 'foo' }, 'bar'] as string[]}\`; + `, + ` +function foo(array: T[]) { + return \`\${array}\`; +} + `, + ` +class Foo { + toString() { + return ''; + } +} +\`\${[new Foo()]}\`; + `, + ` +declare const array: string[]; +\`\${array}\`; + `, + ` +class Foo { + foo: string; +} +declare const array: (string & Foo)[]; +\`\${array}\`; + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] | (string & Bar)[]; +\`\${array}\`; + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const array: (string & Foo)[] & (string & Bar)[]; +\`\${array}\`; + `, + ` +class Foo { + foo: string; +} +class Bar { + bar: string; +} +declare const tuple: [string & Foo, string & Bar]; +\`\${tuple}\`; + `, + ` +class Foo { + foo: string; +} +declare const tuple: [string] & [Foo]; +\`\${tuple}\`; + `, + // don't bother trying to interpret spread args. ` let objects = [{}, {}]; @@ -443,7 +667,9 @@ String(u); }, { code: ` -class Foo {} +class Foo { + foo: string; +} declare const foo: string | Foo; \`\${foo}\`; `, @@ -459,8 +685,12 @@ declare const foo: string | Foo; }, { code: ` -class Foo {} -class Bar {} +class Foo { + foo: string; +} +class Bar { + bar: string; +} declare const foo: Bar | Foo; \`\${foo}\`; `, @@ -476,8 +706,12 @@ declare const foo: Bar | Foo; }, { code: ` -class Foo {} -class Bar {} +class Foo { + foo: string; +} +class Bar { + bar: string; +} declare const foo: Bar & Foo; \`\${foo}\`; `, @@ -522,13 +756,15 @@ declare const foo: Bar & Foo; }, { code: ` - class A {} + class A { + a: string; + } [new A(), 'str'].join(''); `, errors: [ { data: { - certainty: 'will', + certainty: 'may', name: "[new A(), 'str']", }, messageId: 'baseArrayJoin', @@ -537,7 +773,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const array: (string | Foo)[]; array.join(''); `, @@ -553,7 +791,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const array: (string & Foo) | (string | Foo)[]; array.join(''); `, @@ -569,8 +809,12 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} - class Bar {} + class Foo { + foo: string; + } + class Bar { + bar: string; + } declare const array: Foo[] & Bar[]; array.join(''); `, @@ -586,7 +830,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const array: string[] | Foo[]; array.join(''); `, @@ -602,7 +848,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const tuple: [string, Foo]; tuple.join(''); `, @@ -618,7 +866,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const tuple: [Foo, Foo]; tuple.join(''); `, @@ -634,7 +884,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const tuple: [Foo | string, string]; tuple.join(''); `, @@ -650,7 +902,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const tuple: [string, string] | [Foo, Foo]; tuple.join(''); `, @@ -666,7 +920,9 @@ declare const foo: Bar & Foo; }, { code: ` - class Foo {} + class Foo { + foo: string; + } declare const tuple: [Foo, string] & [Foo, Foo]; tuple.join(''); `, @@ -718,6 +974,757 @@ declare const foo: Bar & Foo; }, ], }, + + { + code: ` + String([{}, {}]); + `, + errors: [ + { + data: { + certainty: 'will', + name: '[{}, {}]', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = [{}, {}]; + String(array); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class A { + a: string; + } + String([new A(), 'str']); + `, + errors: [ + { + data: { + certainty: 'may', + name: "[new A(), 'str']", + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string | Foo)[]; + String(array); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string & Foo) | (string | Foo)[]; + String(array); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + class Bar { + bar: string; + } + declare const array: Foo[] & Bar[]; + String(array); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: string[] | Foo[]; + String(array); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, Foo]; + String(tuple); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, Foo]; + String(tuple); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo | string, string]; + String(tuple); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, string] | [Foo, Foo]; + String(tuple); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, string] & [Foo, Foo]; + String(tuple); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = ['string', { foo: 'bar' }]; + String(array); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + languageOptions: { + parserOptions: { + project: './tsconfig.noUncheckedIndexedAccess.json', + tsconfigRootDir: rootDir, + }, + }, + }, + { + code: ` + type Bar = Record; + function foo(array: T[]) { + return String(array); + } + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + + { + code: ` + [{}, {}].toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: '[{}, {}]', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = [{}, {}]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class A { + a: string; + } + [new A(), 'str'].toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: "[new A(), 'str']", + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string | Foo)[]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string & Foo) | (string | Foo)[]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + class Bar { + bar: string; + } + declare const array: Foo[] & Bar[]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: string[] | Foo[]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, Foo]; + tuple.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, Foo]; + tuple.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo | string, string]; + tuple.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, string] | [Foo, Foo]; + tuple.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, string] & [Foo, Foo]; + tuple.toString(); + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = ['string', { foo: 'bar' }]; + array.toString(); + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + languageOptions: { + parserOptions: { + project: './tsconfig.noUncheckedIndexedAccess.json', + tsconfigRootDir: rootDir, + }, + }, + }, + { + code: ` + type Bar = Record; + function foo(array: T[]) { + return array.toString(); + } + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + + { + code: ` + \`\${[{}, {}]}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: '[{}, {}]', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = [{}, {}]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class A { + a: string; + } + \`\${[new A(), 'str']}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: "[new A(), 'str']", + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string | Foo)[]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: (string & Foo) | (string | Foo)[]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + class Bar { + bar: string; + } + declare const array: Foo[] & Bar[]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const array: string[] | Foo[]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, Foo]; + \`\${tuple}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, Foo]; + \`\${tuple}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo | string, string]; + \`\${tuple}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [string, string] | [Foo, Foo]; + \`\${tuple}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + class Foo { + foo: string; + } + declare const tuple: [Foo, string] & [Foo, Foo]; + \`\${tuple}\`; + `, + errors: [ + { + data: { + certainty: 'will', + name: 'tuple', + }, + messageId: 'baseToString', + }, + ], + }, + { + code: ` + const array = ['string', { foo: 'bar' }]; + \`\${array}\`; + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + languageOptions: { + parserOptions: { + project: './tsconfig.noUncheckedIndexedAccess.json', + tsconfigRootDir: rootDir, + }, + }, + }, + { + code: ` + type Bar = Record; + function foo(array: T[]) { + return \`\${array}\`; + } + `, + errors: [ + { + data: { + certainty: 'may', + name: 'array', + }, + messageId: 'baseToString', + }, + ], + }, + { code: ` type Bar = Record; diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index 39f3947891ef..764177e56cf9 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -312,6 +312,10 @@ ruleTester.run('no-deprecated', rule, { } ; `, + ` + declare const test: string; + const bar = { test }; + `, ], invalid: [ { @@ -711,6 +715,25 @@ ruleTester.run('no-deprecated', rule, { }, ], }, + { + code: ` + /** @deprecated */ + declare const test: string; + const bar = { + test, + }; + `, + errors: [ + { + column: 11, + data: { name: 'test' }, + endColumn: 15, + endLine: 5, + line: 5, + messageId: 'deprecated', + }, + ], + }, { code: ` /** @deprecated */ const a = { b: 1 }; diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts index 8b68d4dd08f4..6dd82ef35747 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts @@ -203,6 +203,120 @@ interface Test { }, { code: ` +const arg = 0; + +declare function test(arg: string): typeof arg; + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` +const arg = 0; + +declare const test: (arg: string) => typeof arg; + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` +const arg = 0; + +declare class Test { + p1(arg: string): typeof arg; +} + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` +const arg = 0; + +declare const Test: { + new (arg: string): typeof arg; +}; + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` +const arg = 0; + +type Bar = new (arg: number) => typeof arg; + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` +const arg = 0; + +declare namespace Lib { + function test(arg: string): typeof arg; +} + `, + errors: [ + { + data: { + name: 'arg', + shadowedColumn: 7, + shadowedLine: 2, + }, + messageId: 'noShadow', + }, + ], + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + }, + { + code: ` import type { foo } from './foo'; function doThing(foo: number) {} `, @@ -617,6 +731,60 @@ const arg = 0; interface Test { p1(arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +declare function test(arg: string): typeof arg; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +declare const test: (arg: string) => typeof arg; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +declare class Test { + p1(arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +declare const Test: { + new (arg: string): typeof arg; +}; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +type Bar = new (arg: number) => typeof arg; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +declare namespace Lib { + function test(arg: string): typeof arg; } `, options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts index 6043b2b8b50d..eb87d7f3755d 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts @@ -1142,6 +1142,11 @@ this code has trailing whitespace: \${' '} // intentional comment after }\`; `, + ` + function getTpl(input: T) { + return \`\${input}\`; + } + `, ], invalid: [ diff --git a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts index 4b7d772c8cc8..8e57798cc248 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1625,24 +1625,74 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } }), // number (array.length) in boolean context - ...batchedSingleLineTests({ - code: noFormat` - if (![].length) {} - (a: number[]) => a.length && "..." - (...a: T) => a.length || "empty"; + + { + code: ` +if (![].length) { +} `, errors: [ - { column: 6, line: 2, messageId: 'conditionErrorNumber' }, - { column: 26, line: 3, messageId: 'conditionErrorNumber' }, - { column: 43, line: 4, messageId: 'conditionErrorNumber' }, + { + column: 6, + line: 2, + messageId: 'conditionErrorNumber', + suggestions: [ + { + messageId: 'conditionFixCompareArrayLengthZero', + output: ` +if ([].length === 0) { +} + `, + }, + ], + }, ], options: [{ allowNumber: false }], - output: ` - if ([].length === 0) {} - (a: number[]) => (a.length > 0) && "..." - (...a: T) => (a.length > 0) || "empty"; + }, + { + code: ` +(a: number[]) => a.length && '...'; `, - }), + errors: [ + { + column: 18, + line: 2, + messageId: 'conditionErrorNumber', + suggestions: [ + { + messageId: 'conditionFixCompareArrayLengthNonzero', + // not technically the same; changes from returning (nonzero) number to returning true + output: ` +(a: number[]) => (a.length > 0) && '...'; + `, + }, + ], + }, + ], + options: [{ allowNumber: false }], + }, + { + code: ` +(...a: T) => a.length || 'empty'; + `, + errors: [ + { + column: 35, + line: 2, + messageId: 'conditionErrorNumber', + suggestions: [ + { + messageId: 'conditionFixCompareArrayLengthNonzero', + // not technically the same; changes from returning (nonzero) number to returning true + output: ` +(...a: T) => (a.length > 0) || 'empty'; + `, + }, + ], + }, + ], + options: [{ allowNumber: false }], + }, // mixed `string | number` value in boolean context ...batchedSingleLineTests({ @@ -1967,10 +2017,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 0, That = 1, @@ -1979,6 +2029,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum != null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -1997,10 +2052,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 0, That = 1, @@ -2009,6 +2064,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -2027,10 +2087,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This, That, @@ -2039,6 +2099,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -2057,10 +2122,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = '', That = 'a', @@ -2069,6 +2134,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -2087,10 +2157,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = '', That = 0, @@ -2099,6 +2169,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -2117,10 +2192,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 'one', That = 'two', @@ -2129,6 +2204,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { code: ` @@ -2147,10 +2227,10 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 7, line: 7, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 1, That = 2, @@ -2159,6 +2239,11 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } if (theEnum == null) { } `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, // nullable mixed enum in boolean context @@ -2178,16 +2263,21 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 6, line: 6, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 0, That = 'one', } (value?: ExampleEnum) => ((value != null) ? 1 : 0); `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { // falsy string and truthy number @@ -2205,16 +2295,21 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 6, line: 6, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = '', That = 1, } (value?: ExampleEnum) => ((value == null) ? 1 : 0); `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { // truthy string and truthy number @@ -2232,16 +2327,21 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 6, line: 6, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = 'this', That = 1, } (value?: ExampleEnum) => ((value == null) ? 1 : 0); `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, { // falsy string and falsy number @@ -2259,16 +2359,21 @@ if (((Boolean('')) && {}) || (foo && void 0)) { } endLine: 6, line: 6, messageId: 'conditionErrorNullableEnum', - }, - ], - options: [{ allowNullableEnum: false }], - output: ` + suggestions: [ + { + messageId: 'conditionFixCompareNullish', + output: ` enum ExampleEnum { This = '', That = 0, } (value?: ExampleEnum) => ((value == null) ? 1 : 0); `, + }, + ], + }, + ], + options: [{ allowNullableEnum: false }], }, // any in boolean context diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index b43d62f20bb4..31ec5e177b3b 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) 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 b5be2259dd1f..89dec74c8378 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.19.0", + "version": "8.19.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -53,10 +53,10 @@ "typescript": ">=4.8.4 <5.8.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.19.0", - "@typescript-eslint/types": "8.19.0", - "@typescript-eslint/typescript-estree": "8.19.0", - "@typescript-eslint/visitor-keys": "8.19.0", + "@typescript-eslint/scope-manager": "8.19.1", + "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/typescript-estree": "8.19.1", + "@typescript-eslint/visitor-keys": "8.19.1", "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 e6beabd739ee..ebb2a07ca3dd 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) 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 6847da23df10..e5e2c93dd5c6 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.19.0", + "version": "8.19.1", "private": true, "type": "commonjs", "exports": { @@ -34,8 +34,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/type-utils": "8.19.0", - "@typescript-eslint/utils": "8.19.0", + "@typescript-eslint/type-utils": "8.19.1", + "@typescript-eslint/utils": "8.19.1", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 8f5bc6c4e26a..0e796797ad38 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 72fc6f8c972a..9403c7bc1c4c 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.19.0", + "version": "8.19.1", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -48,8 +48,8 @@ }, "//": "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/typescript-estree": "8.19.0", - "@typescript-eslint/utils": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.1", + "@typescript-eslint/utils": "8.19.1", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -62,7 +62,7 @@ "@jest/types": "29.6.3", "@types/json-stable-stringify-without-jsonify": "^1.0.2", "@types/lodash.merge": "4.6.9", - "@typescript-eslint/parser": "8.19.0", + "@typescript-eslint/parser": "8.19.1", "chai": "^4.4.1", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 3b0e892245f0..1ffd6752a146 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 76652585660c..0391635a287b 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.19.0", + "version": "8.19.1", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -46,13 +46,13 @@ "typecheck": "npx nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.19.0", - "@typescript-eslint/visitor-keys": "8.19.0" + "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/visitor-keys": "8.19.1" }, "devDependencies": { "@jest/types": "29.6.3", "@types/glob": "*", - "@typescript-eslint/typescript-estree": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.1", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index e918affdd9d2..89bef8885980 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) ### 🩹 Fixes diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 667910689ccb..d38e7dd1cb2e 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.19.0", + "version": "8.19.1", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -46,10 +46,10 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/typescript-estree": "8.19.0", - "@typescript-eslint/utils": "8.19.0", + "@typescript-eslint/typescript-estree": "8.19.1", + "@typescript-eslint/utils": "8.19.1", "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", @@ -57,7 +57,7 @@ }, "devDependencies": { "@jest/types": "29.6.3", - "@typescript-eslint/parser": "8.19.0", + "@typescript-eslint/parser": "8.19.1", "ajv": "^6.12.6", "downlevel-dts": "*", "jest": "29.7.0", diff --git a/packages/type-utils/src/builtinSymbolLikes.ts b/packages/type-utils/src/builtinSymbolLikes.ts index d1833e3ada84..42d6792d0ebe 100644 --- a/packages/type-utils/src/builtinSymbolLikes.ts +++ b/packages/type-utils/src/builtinSymbolLikes.ts @@ -159,8 +159,7 @@ export function isBuiltinSymbolLikeRecurser( isBuiltinSymbolLikeRecurser(program, t, predicate), ); } - // https://github.com/JoshuaKGoldberg/ts-api-utils/issues/382 - if ((tsutils.isTypeParameter as (type: ts.Type) => boolean)(type)) { + if (tsutils.isTypeParameter(type)) { const t = type.getConstraint(); if (t) { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index a1383728eebf..ece794f7fcad 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 50ed2e2b8d5b..348b5bca2de2 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.19.0", + "version": "8.19.1", "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 4ab4d31e126a..bb2ba2ab1d3e 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for typescript-eslint to align it with other projects, there were no code changes. diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 21558c3d6327..00a15475650d 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.19.0", + "version": "8.19.1", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -52,9 +52,9 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.19.0", - "@typescript-eslint/parser": "8.19.0", - "@typescript-eslint/utils": "8.19.0" + "@typescript-eslint/eslint-plugin": "8.19.1", + "@typescript-eslint/parser": "8.19.1", + "@typescript-eslint/utils": "8.19.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-eslint/src/configs/disable-type-checked.ts b/packages/typescript-eslint/src/configs/disable-type-checked.ts index eeb80399882c..8ab7a8df71f6 100644 --- a/packages/typescript-eslint/src/configs/disable-type-checked.ts +++ b/packages/typescript-eslint/src/configs/disable-type-checked.ts @@ -76,6 +76,6 @@ export default ( '@typescript-eslint/use-unknown-in-catch-callback-variable': 'off', }, languageOptions: { - parserOptions: { project: false, program: null, projectService: false }, + parserOptions: { program: null, project: false, projectService: false }, }, }); diff --git a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts index c9efc88da6c3..ef29e1006bc4 100644 --- a/packages/typescript-eslint/src/configs/strict-type-checked-only.ts +++ b/packages/typescript-eslint/src/configs/strict-type-checked-only.ts @@ -74,10 +74,10 @@ export default ( { allowAny: false, allowBoolean: false, + allowNever: false, allowNullish: false, allowNumber: false, allowRegExp: false, - allowNever: false, }, ], 'no-return-await': 'off', diff --git a/packages/typescript-eslint/src/configs/strict-type-checked.ts b/packages/typescript-eslint/src/configs/strict-type-checked.ts index 4f354baf7e40..e5c7c4c22062 100644 --- a/packages/typescript-eslint/src/configs/strict-type-checked.ts +++ b/packages/typescript-eslint/src/configs/strict-type-checked.ts @@ -107,10 +107,10 @@ export default ( { allowAny: false, allowBoolean: false, + allowNever: false, allowNullish: false, allowNumber: false, allowRegExp: false, - allowNever: false, }, ], 'no-return-await': 'off', diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 1368e99a52f4..da9dfd5107cf 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) This was a version bump only for typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index a9b75afc0474..63c26b647364 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.19.0", + "version": "8.19.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -54,14 +54,14 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/types": "8.19.0", - "@typescript-eslint/visitor-keys": "8.19.0", + "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/visitor-keys": "8.19.1", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "ts-api-utils": "^2.0.0" }, "devDependencies": { "@jest/types": "29.6.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index f7376279ca7b..e330bb3c23d4 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) ### 🩹 Fixes diff --git a/packages/utils/package.json b/packages/utils/package.json index 603265f73c00..4c004adef467 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.19.0", + "version": "8.19.1", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -64,9 +64,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.19.0", - "@typescript-eslint/types": "8.19.0", - "@typescript-eslint/typescript-estree": "8.19.0" + "@typescript-eslint/scope-manager": "8.19.1", + "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/typescript-estree": "8.19.1" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 77add2d6a102..72fa89abcdd6 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.19.1 (2025-01-06) + +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://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 8.19.0 (2024-12-30) 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 7d7edd0ccf61..0f2fd2519b8d 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.19.0", + "version": "8.19.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": "8.19.0", + "@typescript-eslint/types": "8.19.1", "eslint-visitor-keys": "^4.2.0" }, "devDependencies": { diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 6b5358cb89b5..07835b007f9e 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -3,7 +3,7 @@ "id": "ESLint", "image": "https://images.opencollective.com/eslint/48a2e5d/logo.png", "name": "ESLint", - "totalDonations": 3180000, + "totalDonations": 3210000, "website": "https://eslint.org/" }, { @@ -17,9 +17,16 @@ "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", - "totalDonations": 1125000, + "totalDonations": 1150000, "website": "https://nx.dev" }, + { + "id": "JetBrains", + "image": "https://images.opencollective.com/jetbrains/fe76f99/logo.png", + "name": "JetBrains", + "totalDonations": 650000, + "website": "https://www.jetbrains.com/" + }, { "id": "Hugging Face", "image": "https://images.opencollective.com/huggingface/5c934ee/logo.png", @@ -27,32 +34,25 @@ "totalDonations": 600000, "website": "https://huggingface.co" }, - { - "id": "JetBrains", - "image": "https://images.opencollective.com/jetbrains/fe76f99/logo.png", - "name": "JetBrains", - "totalDonations": 600000, - "website": "https://www.jetbrains.com/" - }, { "id": "Cybozu", "image": "https://images.opencollective.com/cybozu/933e46d/logo.png", "name": "Cybozu", - "totalDonations": 560000, + "totalDonations": 585000, "website": "https://cybozu.co.jp/" }, { "id": "Codecademy", "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", "name": "Codecademy", - "totalDonations": 350000, + "totalDonations": 360000, "website": "https://codecademy.com" }, { "id": "Sourcegraph", "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", "name": "Sourcegraph", - "totalDonations": 300000, + "totalDonations": 310000, "website": "https://about.sourcegraph.com" }, { @@ -62,6 +62,13 @@ "totalDonations": 300000, "website": "https://www.canva.com" }, + { + "id": "Airbnb", + "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", + "name": "Airbnb", + "totalDonations": 270800, + "website": "https://www.airbnb.com/" + }, { "id": "THANKS.DEV", "image": "https://images.opencollective.com/thanks-dev/ed78b39/logo.png", @@ -69,13 +76,6 @@ "totalDonations": 267479, "website": "https://thanks.dev" }, - { - "id": "Airbnb", - "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", - "name": "Airbnb", - "totalDonations": 265800, - "website": "https://www.airbnb.com/" - }, { "id": "GitBook", "image": "https://images.opencollective.com/gitbook/820419f/logo.png", @@ -115,7 +115,7 @@ "id": "STORIS", "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", "name": "STORIS", - "totalDonations": 88500, + "totalDonations": 92000, "website": "https://www.storis.com/" }, { @@ -136,7 +136,7 @@ "id": "frontendmasters", "image": "https://avatars.githubusercontent.com/u/5613852?v=4", "name": "Frontend Masters", - "totalDonations": 68564, + "totalDonations": 60225, "website": "https://FrontendMasters.com" }, { @@ -174,20 +174,27 @@ "totalDonations": 48000, "website": "https://joealden.com" }, - { - "id": "syntaxfm", - "image": "https://avatars.githubusercontent.com/u/130389858?v=4", - "name": "Syntax", - "totalDonations": 47864, - "website": "https://syntax.fm" - }, { "id": "CryptoNewsZ", "image": "https://images.opencollective.com/cryptonewsz/f50c823/logo.png", "name": "CryptoNewsZ", - "totalDonations": 45000, + "totalDonations": 47500, "website": "https://www.cryptonewsz.com/" }, + { + "id": "WebdriverIO", + "image": "https://images.opencollective.com/webdriverio/bbdd5c3/logo.png", + "name": "WebdriverIO", + "totalDonations": 42000, + "website": "https://webdriver.io/" + }, + { + "id": "syntaxfm", + "image": "https://avatars.githubusercontent.com/u/130389858?v=4", + "name": "Syntax", + "totalDonations": 40741, + "website": "https://syntax.fm" + }, { "id": "Whitebox", "image": "https://images.opencollective.com/whiteboxinc/ef0d11d/logo.png", @@ -195,25 +202,18 @@ "totalDonations": 40000, "website": "https://whitebox.com" }, - { - "id": "WebdriverIO", - "image": "https://images.opencollective.com/webdriverio/bbdd5c3/logo.png", - "name": "WebdriverIO", - "totalDonations": 38500, - "website": "https://webdriver.io/" - }, { "id": "Quicko", "image": "https://images.opencollective.com/quicko/7bd1dc9/logo.png", "name": "Quicko", - "totalDonations": 36000, + "totalDonations": 38000, "website": "https://quicko.com" }, { "id": "Defined Networking", "image": "https://images.opencollective.com/defined-networking/072920e/logo.png", "name": "Defined Networking", - "totalDonations": 35000, + "totalDonations": 37500, "website": "https://www.defined.net" }, { @@ -241,16 +241,23 @@ "id": "Torutek", "image": "https://images.opencollective.com/torutek/logo.png", "name": "Torutek", - "totalDonations": 25000, + "totalDonations": 30000, "website": "https://torutek.com" }, { "id": "0+X", "image": "https://images.opencollective.com/0-x/707287f/logo.png", "name": "0+X", - "totalDonations": 24000, + "totalDonations": 25000, "website": "https://www.0x.se" }, + { + "id": "Trevor Burnham", + "image": "https://images.opencollective.com/trevorburnham/016f6da/avatar.png", + "name": "Trevor Burnham", + "totalDonations": 24000, + "website": "https://trevorburnham.com" + }, { "id": "revo.js", "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", @@ -258,25 +265,18 @@ "totalDonations": 23000, "website": "https://revojs.ro" }, - { - "id": "Trevor Burnham", - "image": "https://images.opencollective.com/trevorburnham/016f6da/avatar.png", - "name": "Trevor Burnham", - "totalDonations": 23000, - "website": "https://trevorburnham.com" - }, { "id": "Evil Martians", "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", "name": "Evil Martians", - "totalDonations": 22500, + "totalDonations": 23000, "website": "https://evilmartians.com/" }, { "id": "Corellium", "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", "name": "Corellium", - "totalDonations": 22200, + "totalDonations": 22800, "website": "https://www.corellium.com" }, { @@ -321,13 +321,6 @@ "totalDonations": 15000, "website": "https://paddn.com/" }, - { - "id": "getsentry", - "image": "https://avatars.githubusercontent.com/u/1396951?v=4", - "name": "Sentry", - "totalDonations": 14586, - "website": "https://sentry.io" - }, { "id": "Now4real", "image": "https://images.opencollective.com/now4real/54ca7d9/logo.png", @@ -335,11 +328,18 @@ "totalDonations": 14500, "website": "https://now4real.com/" }, + { + "id": "getsentry", + "image": "https://avatars.githubusercontent.com/u/1396951?v=4", + "name": "Sentry", + "totalDonations": 13202, + "website": "https://sentry.io" + }, { "id": "codecov", "image": "https://avatars.githubusercontent.com/u/8226205?v=4", "name": "Codecov", - "totalDonations": 14369, + "totalDonations": 13084, "website": "https://codecov.io/" }, { diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 40920215f86a..c8fffb1ee069 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -184,7 +184,7 @@ const themeConfig: AlgoliaThemeConfig & ThemeCommonConfig = { title: 'typescript-eslint', }, prism: { - additionalLanguages: ['ignore'], + additionalLanguages: ['bash', 'diff', 'ignore'], magicComments: [ { block: { end: 'highlight-end', start: 'highlight-start' }, diff --git a/tools/scripts/generate-configs.mts b/tools/scripts/generate-configs.mts index f7887774df0b..010227cefc92 100644 --- a/tools/scripts/generate-configs.mts +++ b/tools/scripts/generate-configs.mts @@ -89,6 +89,10 @@ async function main(): Promise { ), ); + // special case - return-await used to be an extension, but no longer is. + // See https://github.com/typescript-eslint/typescript-eslint/issues/9517 + BASE_RULES_TO_BE_OVERRIDDEN.set('return-await', 'no-return-await'); + type RuleEntry = [string, ESLintPluginRuleModule]; const allRuleEntries: RuleEntry[] = Object.entries(eslintPlugin.rules).sort( diff --git a/yarn.lock b/yarn.lock index 3442370cc24a..4e90a862da66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5691,7 +5691,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.19.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.19.1, @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: @@ -5700,12 +5700,12 @@ __metadata: "@types/marked": ^5.0.2 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.19.0 - "@typescript-eslint/rule-tester": 8.19.0 - "@typescript-eslint/scope-manager": 8.19.0 - "@typescript-eslint/type-utils": 8.19.0 - "@typescript-eslint/utils": 8.19.0 - "@typescript-eslint/visitor-keys": 8.19.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.19.1 + "@typescript-eslint/rule-tester": 8.19.1 + "@typescript-eslint/scope-manager": 8.19.1 + "@typescript-eslint/type-utils": 8.19.1 + "@typescript-eslint/utils": 8.19.1 + "@typescript-eslint/visitor-keys": 8.19.1 ajv: ^6.12.6 cross-env: ^7.0.3 cross-fetch: "*" @@ -5724,7 +5724,7 @@ __metadata: prettier: ^3.2.5 rimraf: "*" title-case: ^3.0.3 - ts-api-utils: ^1.3.0 + ts-api-utils: ^2.0.0 tsx: "*" typescript: "*" unist-util-visit: ^5.0.0 @@ -5747,16 +5747,16 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.19.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.19.1, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: "@jest/types": 29.6.3 "@types/glob": "*" - "@typescript-eslint/scope-manager": 8.19.0 - "@typescript-eslint/types": 8.19.0 - "@typescript-eslint/typescript-estree": 8.19.0 - "@typescript-eslint/visitor-keys": 8.19.0 + "@typescript-eslint/scope-manager": 8.19.1 + "@typescript-eslint/types": 8.19.1 + "@typescript-eslint/typescript-estree": 8.19.1 + "@typescript-eslint/visitor-keys": 8.19.1 debug: ^4.3.4 downlevel-dts: "*" glob: "*" @@ -5770,29 +5770,29 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.19.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.19.1, @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: "@jest/types": 29.6.3 - "@typescript-eslint/type-utils": 8.19.0 - "@typescript-eslint/utils": 8.19.0 + "@typescript-eslint/type-utils": 8.19.1 + "@typescript-eslint/utils": 8.19.1 natural-compare: ^1.4.0 prettier: ^3.2.5 typescript: "*" languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.19.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.19.1, @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: "@jest/types": 29.6.3 "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.19.0 - "@typescript-eslint/typescript-estree": 8.19.0 - "@typescript-eslint/utils": 8.19.0 + "@typescript-eslint/parser": 8.19.1 + "@typescript-eslint/typescript-estree": 8.19.1 + "@typescript-eslint/utils": 8.19.1 ajv: ^6.12.6 chai: ^4.4.1 eslint-visitor-keys: ^4.2.0 @@ -5810,15 +5810,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.19.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.19.1, @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: "@jest/types": 29.6.3 "@types/glob": "*" - "@typescript-eslint/types": 8.19.0 - "@typescript-eslint/typescript-estree": 8.19.0 - "@typescript-eslint/visitor-keys": 8.19.0 + "@typescript-eslint/types": 8.19.1 + "@typescript-eslint/typescript-estree": 8.19.1 + "@typescript-eslint/visitor-keys": 8.19.1 glob: "*" jest-specific-snapshot: "*" make-dir: "*" @@ -5828,21 +5828,21 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.19.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.19.1, @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: "@jest/types": 29.6.3 - "@typescript-eslint/parser": 8.19.0 - "@typescript-eslint/typescript-estree": 8.19.0 - "@typescript-eslint/utils": 8.19.0 + "@typescript-eslint/parser": 8.19.1 + "@typescript-eslint/typescript-estree": 8.19.1 + "@typescript-eslint/utils": 8.19.1 ajv: ^6.12.6 debug: ^4.3.4 downlevel-dts: "*" jest: 29.7.0 prettier: ^3.2.5 rimraf: "*" - ts-api-utils: ^1.3.0 + ts-api-utils: ^2.0.0 typescript: "*" peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -5850,7 +5850,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.19.0, @typescript-eslint/types@^8.9.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.19.1, @typescript-eslint/types@^8.9.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: @@ -5942,13 +5942,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.19.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.19.1, @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: "@jest/types": 29.6.3 - "@typescript-eslint/types": 8.19.0 - "@typescript-eslint/visitor-keys": 8.19.0 + "@typescript-eslint/types": 8.19.1 + "@typescript-eslint/visitor-keys": 8.19.1 debug: ^4.3.4 fast-glob: ^3.3.2 glob: "*" @@ -5959,21 +5959,21 @@ __metadata: rimraf: "*" semver: ^7.6.0 tmp: "*" - ts-api-utils: ^1.3.0 + ts-api-utils: ^2.0.0 typescript: "*" peerDependencies: typescript: ">=4.8.4 <5.8.0" languageName: unknown linkType: soft -"@typescript-eslint/utils@8.19.0, @typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@^8.9.0, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.19.1, @typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@^8.9.0, @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.4.0 - "@typescript-eslint/scope-manager": 8.19.0 - "@typescript-eslint/types": 8.19.0 - "@typescript-eslint/typescript-estree": 8.19.0 + "@typescript-eslint/scope-manager": 8.19.1 + "@typescript-eslint/types": 8.19.1 + "@typescript-eslint/typescript-estree": 8.19.1 downlevel-dts: "*" jest: 29.7.0 prettier: ^3.2.5 @@ -5985,13 +5985,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.19.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.19.1, @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: "@jest/types": 29.6.3 "@types/eslint-visitor-keys": "*" - "@typescript-eslint/types": 8.19.0 + "@typescript-eslint/types": 8.19.1 downlevel-dts: "*" eslint-visitor-keys: ^4.2.0 jest: 29.7.0 @@ -6465,12 +6465,12 @@ __metadata: languageName: node linkType: hard -"ansi-escapes@npm:^6.2.0": - version: 6.2.0 - resolution: "ansi-escapes@npm:6.2.0" +"ansi-escapes@npm:^7.0.0": + version: 7.0.0 + resolution: "ansi-escapes@npm:7.0.0" dependencies: - type-fest: ^3.0.0 - checksum: f0bc667d5f1ededc3ea89b73c34f0cba95473525b07e1290ddfd3fc868c94614e95f3549f5c4fd0c05424af7d3fd298101fb3d9a52a597d3782508b340783bd7 + environment: ^1.0.0 + checksum: 19baa61e68d1998c03b3b8bd023653a6c2667f0ed6caa9a00780ffd6f0a14f4a6563c57a38b3c0aba71bd704cd49c4c8df41be60bd81c957409f91e9dd49051f languageName: node linkType: hard @@ -7391,10 +7391,10 @@ __metadata: languageName: node linkType: hard -"chalk@npm:^5.0.1, chalk@npm:^5.2.0, chalk@npm:^5.3.0, chalk@npm:~5.3.0": - version: 5.3.0 - resolution: "chalk@npm:5.3.0" - checksum: 623922e077b7d1e9dedaea6f8b9e9352921f8ae3afe739132e0e00c275971bdd331268183b2628cf4ab1727c45ea1f28d7e24ac23ce1db1eb653c414ca8a5a80 +"chalk@npm:^5.0.1, chalk@npm:^5.2.0, chalk@npm:^5.3.0, chalk@npm:~5.4.1": + version: 5.4.1 + resolution: "chalk@npm:5.4.1" + checksum: 0c656f30b782fed4d99198825c0860158901f449a6b12b818b0aabad27ec970389e7e8767d0e00762175b23620c812e70c4fd92c0210e55fc2d993638b74e86e languageName: node linkType: hard @@ -7576,12 +7576,12 @@ __metadata: languageName: node linkType: hard -"cli-cursor@npm:^4.0.0": - version: 4.0.0 - resolution: "cli-cursor@npm:4.0.0" +"cli-cursor@npm:^5.0.0": + version: 5.0.0 + resolution: "cli-cursor@npm:5.0.0" dependencies: - restore-cursor: ^4.0.0 - checksum: ab3f3ea2076e2176a1da29f9d64f72ec3efad51c0960898b56c8a17671365c26e67b735920530eaf7328d61f8bd41c27f46b9cf6e4e10fe2fa44b5e8c0e392cc + restore-cursor: ^5.0.0 + checksum: 1eb9a3f878b31addfe8d82c6d915ec2330cec8447ab1f117f4aa34f0137fbb3137ec3466e1c9a65bcb7557f6e486d343f2da57f253a2f668d691372dfa15c090 languageName: node linkType: hard @@ -8605,7 +8605,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.3.7": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:^4.3.7, debug@npm:~4.4.0": version: 4.4.0 resolution: "debug@npm:4.4.0" dependencies: @@ -8626,18 +8626,6 @@ __metadata: languageName: node linkType: hard -"debug@npm:~4.3.4": - version: 4.3.7 - resolution: "debug@npm:4.3.7" - dependencies: - ms: ^2.1.3 - peerDependenciesMeta: - supports-color: - optional: true - checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 - languageName: node - linkType: hard - "decamelize@npm:^4.0.0": version: 4.0.0 resolution: "decamelize@npm:4.0.0" @@ -9243,6 +9231,13 @@ __metadata: languageName: node linkType: hard +"environment@npm:^1.0.0": + version: 1.1.0 + resolution: "environment@npm:1.1.0" + checksum: dd3c1b9825e7f71f1e72b03c2344799ac73f2e9ef81b78ea8b373e55db021786c6b9f3858ea43a436a2c4611052670ec0afe85bc029c384cc71165feee2f4ba6 + languageName: node + linkType: hard + "err-code@npm:^2.0.2": version: 2.0.3 resolution: "err-code@npm:2.0.3" @@ -13418,10 +13413,10 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.1.1, lilconfig@npm:~3.1.1": - version: 3.1.1 - resolution: "lilconfig@npm:3.1.1" - checksum: dc8a4f4afde3f0fac6bd36163cc4777a577a90759b8ef1d0d766b19ccf121f723aa79924f32af5b954f3965268215e046d0f237c41c76e5ef01d4e6d1208a15e +"lilconfig@npm:^3.1.1, lilconfig@npm:~3.1.3": + version: 3.1.3 + resolution: "lilconfig@npm:3.1.3" + checksum: 644eb10830350f9cdc88610f71a921f510574ed02424b57b0b3abb66ea725d7a082559552524a842f4e0272c196b88dfe1ff7d35ffcc6f45736777185cd67c9a languageName: node linkType: hard @@ -13449,36 +13444,36 @@ __metadata: linkType: hard "lint-staged@npm:^15.2.2": - version: 15.2.7 - resolution: "lint-staged@npm:15.2.7" + version: 15.3.0 + resolution: "lint-staged@npm:15.3.0" dependencies: - chalk: ~5.3.0 + chalk: ~5.4.1 commander: ~12.1.0 - debug: ~4.3.4 + debug: ~4.4.0 execa: ~8.0.1 - lilconfig: ~3.1.1 - listr2: ~8.2.1 - micromatch: ~4.0.7 + lilconfig: ~3.1.3 + listr2: ~8.2.5 + micromatch: ~4.0.8 pidtree: ~0.6.0 string-argv: ~0.3.2 - yaml: ~2.4.2 + yaml: ~2.6.1 bin: lint-staged: bin/lint-staged.js - checksum: 0f21d1b44c046fcfc0388dab66d45d244818afdb24bdf57e7593640c7ca82cc55be7d75e086708e453fac0c0d9ab8760b2cde053944f7b2121c2dd65f6367ffe + checksum: 9917a13c946cd812e4986a724602dfacf09baa4ddbbb4f08f7e59760181a7bf38459fcef54a396cc80b2af1655edae3e45410b23cfe1f70cf431662b2bf45624 languageName: node linkType: hard -"listr2@npm:~8.2.1": - version: 8.2.1 - resolution: "listr2@npm:8.2.1" +"listr2@npm:~8.2.5": + version: 8.2.5 + resolution: "listr2@npm:8.2.5" dependencies: cli-truncate: ^4.0.0 colorette: ^2.0.20 eventemitter3: ^5.0.1 - log-update: ^6.0.0 - rfdc: ^1.3.1 + log-update: ^6.1.0 + rfdc: ^1.4.1 wrap-ansi: ^9.0.0 - checksum: a37c032850fc01f45cf6144f2b66d0c56a596b708de1acbd52e7c396a2eb188d027ad132c93a0ad946d7932a581dfcfc2e4318bb301926b01877cb4903d09fbd + checksum: 0ca2387b067eb11bbe91863f36903f3a5a040790422a499cc1a15806d8497979e7d1990bd129061c0510906b2971eaa97a74a9635e3ec5abd5830c9749b655b9 languageName: node linkType: hard @@ -13610,16 +13605,16 @@ __metadata: languageName: node linkType: hard -"log-update@npm:^6.0.0": - version: 6.0.0 - resolution: "log-update@npm:6.0.0" +"log-update@npm:^6.1.0": + version: 6.1.0 + resolution: "log-update@npm:6.1.0" dependencies: - ansi-escapes: ^6.2.0 - cli-cursor: ^4.0.0 - slice-ansi: ^7.0.0 + ansi-escapes: ^7.0.0 + cli-cursor: ^5.0.0 + slice-ansi: ^7.1.0 strip-ansi: ^7.1.0 wrap-ansi: ^9.0.0 - checksum: 8803ceba2fb28626951b85de598c8d5a4f5e39f1f767cc54fd925412cc7780ba89ce1dbec24dc96fa46f89d226e1ae984534aa729dc9c9b734e36bb805428ffa + checksum: 817a9ba6c5cbc19e94d6359418df8cfe8b3244a2903f6d53354e175e243a85b782dc6a98db8b5e457ee2f09542ca8916c39641b9cd3b0e6ef45e9481d50c918a languageName: node linkType: hard @@ -14707,7 +14702,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8, micromatch@npm:~4.0.7": +"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8, micromatch@npm:~4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -14772,6 +14767,13 @@ __metadata: languageName: node linkType: hard +"mimic-function@npm:^5.0.0": + version: 5.0.1 + resolution: "mimic-function@npm:5.0.1" + checksum: eb5893c99e902ccebbc267c6c6b83092966af84682957f79313311edb95e8bb5f39fb048d77132b700474d1c86d90ccc211e99bae0935447a4834eb4c882982c + languageName: node + linkType: hard + "mimic-response@npm:^3.1.0": version: 3.1.0 resolution: "mimic-response@npm:3.1.0" @@ -15622,6 +15624,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^7.0.0": + version: 7.0.0 + resolution: "onetime@npm:7.0.0" + dependencies: + mimic-function: ^5.0.0 + checksum: eb08d2da9339819e2f9d52cab9caf2557d80e9af8c7d1ae86e1a0fef027d00a88e9f5bd67494d350df360f7c559fbb44e800b32f310fb989c860214eacbb561c + languageName: node + linkType: hard + "open@npm:^8.0.9, open@npm:^8.4.0": version: 8.4.2 resolution: "open@npm:8.4.2" @@ -17606,13 +17617,13 @@ __metadata: languageName: node linkType: hard -"restore-cursor@npm:^4.0.0": - version: 4.0.0 - resolution: "restore-cursor@npm:4.0.0" +"restore-cursor@npm:^5.0.0": + version: 5.1.0 + resolution: "restore-cursor@npm:5.1.0" dependencies: - onetime: ^5.1.0 - signal-exit: ^3.0.2 - checksum: 5b675c5a59763bf26e604289eab35711525f11388d77f409453904e1e69c0d37ae5889295706b2c81d23bd780165084d040f9b68fffc32cc921519031c4fa4af + onetime: ^7.0.0 + signal-exit: ^4.1.0 + checksum: 838dd54e458d89cfbc1a923b343c1b0f170a04100b4ce1733e97531842d7b440463967e521216e8ab6c6f8e89df877acc7b7f4c18ec76e99fb9bf5a60d358d2c languageName: node linkType: hard @@ -17637,10 +17648,10 @@ __metadata: languageName: node linkType: hard -"rfdc@npm:^1.3.1": - version: 1.3.1 - resolution: "rfdc@npm:1.3.1" - checksum: d5d1e930aeac7e0e0a485f97db1356e388bdbeff34906d206fe524dd5ada76e95f186944d2e68307183fdc39a54928d4426bbb6734851692cfe9195efba58b79 +"rfdc@npm:^1.4.1": + version: 1.4.1 + resolution: "rfdc@npm:1.4.1" + checksum: 3b05bd55062c1d78aaabfcea43840cdf7e12099968f368e9a4c3936beb744adb41cbdb315eac6d4d8c6623005d6f87fdf16d8a10e1ff3722e84afea7281c8d13 languageName: node linkType: hard @@ -18236,7 +18247,7 @@ __metadata: languageName: node linkType: hard -"slice-ansi@npm:^7.0.0": +"slice-ansi@npm:^7.1.0": version: 7.1.0 resolution: "slice-ansi@npm:7.1.0" dependencies: @@ -19190,12 +19201,12 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^1.3.0": - version: 1.4.0 - resolution: "ts-api-utils@npm:1.4.0" +"ts-api-utils@npm:^2.0.0": + version: 2.0.0 + resolution: "ts-api-utils@npm:2.0.0" peerDependencies: - typescript: ">=4.2.0" - checksum: 477601317dc8a6d961788663ee76984005ed20c70689bd6f807eed2cad258d3731edcc4162d438ce04782ca62a05373ba51e484180fc2a081d8dab2bf693a5af + typescript: ">=4.8.4" + checksum: f16f3e4e3308e7ad7ccf0bec3e0cb2e06b46c2d6919c40b6439e37912409c72f14340d231343b2b1b8cc17c2b8b01c5f2418690ea788312db6ca4e72cf2df6d8 languageName: node linkType: hard @@ -19355,13 +19366,6 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^3.0.0": - version: 3.13.1 - resolution: "type-fest@npm:3.13.1" - checksum: c06b0901d54391dc46de3802375f5579868949d71f93b425ce564e19a428a0d411ae8d8cb0e300d330071d86152c3ea86e744c3f2860a42a79585b6ec2fdae8e - languageName: node - linkType: hard - "type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -19464,9 +19468,9 @@ __metadata: resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: "@jest/types": 29.6.3 - "@typescript-eslint/eslint-plugin": 8.19.0 - "@typescript-eslint/parser": 8.19.0 - "@typescript-eslint/utils": 8.19.0 + "@typescript-eslint/eslint-plugin": 8.19.1 + "@typescript-eslint/parser": 8.19.1 + "@typescript-eslint/utils": 8.19.1 downlevel-dts: "*" jest: 29.7.0 prettier: ^3.2.5 @@ -20700,7 +20704,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.6.0, yaml@npm:^2.6.1": +"yaml@npm:^2.6.0, yaml@npm:^2.6.1, yaml@npm:~2.6.1": version: 2.6.1 resolution: "yaml@npm:2.6.1" bin: @@ -20709,15 +20713,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:~2.4.2": - version: 2.4.5 - resolution: "yaml@npm:2.4.5" - bin: - yaml: bin.mjs - checksum: f8efd407c07e095f00f3031108c9960b2b12971d10162b1ec19007200f6c987d2e28f73283f4731119aa610f177a3ea03d4a8fcf640600a25de1b74d00c69b3d - languageName: node - linkType: hard - "yargs-parser@npm:21.1.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1"