From 3447143ccb8991b6ef5fbe5b2e68f905a7631750 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 00:01:44 +0900 Subject: [PATCH 01/11] feat: mark these rule as frozen --- packages/eslint-plugin/src/rules/default-param-last.ts | 3 +++ packages/eslint-plugin/src/rules/dot-notation.ts | 3 +++ packages/eslint-plugin/src/rules/init-declarations.ts | 3 +++ packages/eslint-plugin/src/rules/member-ordering.ts | 3 +++ packages/eslint-plugin/src/rules/naming-convention.ts | 3 +++ packages/eslint-plugin/src/rules/no-magic-numbers.ts | 3 +++ packages/eslint-plugin/src/rules/prefer-destructuring.ts | 3 +++ 7 files changed, 21 insertions(+) diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index 1d120720d26c..01afb9dfa156 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -8,6 +8,9 @@ export default createRule({ name: 'default-param-last', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, docs: { description: 'Enforce default parameters to be last', extendsBaseRule: true, diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 69d53170c70e..39bbab09a939 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -32,6 +32,9 @@ export default createRule({ meta: { type: 'suggestion', defaultOptions, + deprecated: { + availableUntil: null, + }, docs: { description: 'Enforce dot notation whenever possible', extendsBaseRule: true, diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index 16b3f87e713c..926b47adea6a 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -19,6 +19,9 @@ export default createRule({ name: 'init-declarations', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 7ae9ec7627cf..d84d5d9fe0f5 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -726,6 +726,9 @@ export default createRule({ name: 'member-ordering', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, docs: { description: 'Require a consistent member declaration order', }, diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 03500d825163..f8df03cfcfa8 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -66,6 +66,9 @@ export default createRule({ name: 'naming-convention', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, docs: { description: 'Enforce naming conventions for everything across a codebase', diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 6ecddefd0645..7b9e20ab2ab7 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -49,6 +49,9 @@ export default createRule({ name: 'no-magic-numbers', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: 'Disallow magic numbers', diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index a3afb125a301..fb884dba1402 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -72,6 +72,9 @@ export default createRule({ name: 'prefer-destructuring', meta: { type: 'suggestion', + deprecated: { + availableUntil: null, + }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: 'Require destructuring from arrays and/or objects', From 8f4558be15c86992a8b3345e1bb6325b158f14f4 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 01:27:11 +0900 Subject: [PATCH 02/11] docs: add section for frozen --- packages/eslint-plugin/docs/rules/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 75c5723d748a..1cb9c5435fa1 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -55,3 +55,16 @@ module.exports = { ``` [Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules. + +## Frozen Rules + +When rules are feature complete, they are marked as frozen (indicated with ❄️ in the documentation). This applies to standalone rules that are complete, as well as [extension rules](#extension-rules) whose underlying core ESLint rules are frozen. After that point, we expect users to use [disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) when they find an edge case that isn’t covered. + +When a rule is frozen, it means: + +- **Bug fixes**: We will still fix confirmed bugs. +- **New ECMAScript features**: We will ensure compatibility with new ECMAScript features, meaning the rule will not break on new syntax. +- **TypeScript support**: We will ensure compatibility with TypeScript syntax, meaning the rule will not break on TypeScript syntax and violations are appropriate for TypeScript. +- **New options**: We will not add any new options unless an option is the only way to fix a bug or support a newly-added ECMAScript feature. + +If you find that a frozen rule would work better for you with a change, we recommend copying the rule source code and modifying it to fit your needs. From cf9707afa8db76ddc1afdcb0cea99e65109a2142 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 01:27:54 +0900 Subject: [PATCH 03/11] docs: show snowflake for frozen rule in rule table --- .../src/components/RulesTable/index.tsx | 34 +++++++++++++++---- .../components/RulesTable/styles.module.css | 6 ++++ .../src/components/lib/isRuleFrozen.ts | 11 ++++++ 3 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 packages/website/src/components/lib/isRuleFrozen.ts diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 6f25e27e951d..4ecea89afb4b 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -1,5 +1,8 @@ import type { RulesMeta } from '@site/rulesMeta'; -import type { RuleRecommendation } from '@typescript-eslint/utils/ts-eslint'; +import type { + DeprecatedInfo, + RuleRecommendation, +} from '@typescript-eslint/utils/ts-eslint'; import Link from '@docusaurus/Link'; import { useHistory } from '@docusaurus/router'; @@ -22,6 +25,7 @@ import { SUGGESTIONS_EMOJI, TYPE_INFORMATION_EMOJI, } from '../constants'; +import { isRuleFrozen } from '../lib/isRuleFrozen'; import styles from './styles.module.css'; function interpolateCode( @@ -41,6 +45,18 @@ function getActualRecommended({ return recommended ? getRecommendationWithEmoji(recommended) : ['', '']; } +function isRealDeprecated( + deprecated: boolean | DeprecatedInfo | undefined, +): boolean { + if (typeof deprecated === 'boolean') { + return deprecated; + } + if (isRuleFrozen(deprecated)) { + return false; + } + return !!deprecated; +} + function RuleRow({ rule, }: { @@ -50,14 +66,18 @@ function RuleRow({ return null; } const { deprecated, fixable, hasSuggestions } = rule; + const isDeprecated = isRealDeprecated(deprecated); const { extendsBaseRule, requiresTypeChecking } = rule.docs; const [emoji, actualRecommended] = getActualRecommended(rule); return ( - - @typescript-eslint/{rule.name} - +
+ + @typescript-eslint/{rule.name} + + {isRuleFrozen(rule.deprecated) && ❄️} +

{interpolateCode(rule.docs.description)} @@ -94,9 +114,9 @@ function RuleRow({ - {deprecated ? DEPRECATED_RULE_EMOJI : ''} + {isDeprecated ? DEPRECATED_RULE_EMOJI : ''} ); @@ -173,7 +193,7 @@ export default function RulesTable(): React.JSX.Element { match(filters.suggestions, !!r.hasSuggestions), match(filters.typeInformation, !!r.docs.requiresTypeChecking), match(filters.extension, !!r.docs.extendsBaseRule), - match(filters.deprecated, !!r.deprecated), + match(filters.deprecated, isRealDeprecated(r.deprecated)), ].filter( (o): o is boolean => // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css index 3ffcec037609..7c6c7cfca093 100644 --- a/packages/website/src/components/RulesTable/styles.module.css +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -145,3 +145,9 @@ text-align: center; cursor: default; } + +.ruleNameWrapper { + display: flex; + align-items: center; + gap: 0.5rem; +} diff --git a/packages/website/src/components/lib/isRuleFrozen.ts b/packages/website/src/components/lib/isRuleFrozen.ts new file mode 100644 index 000000000000..34ec211e8a7f --- /dev/null +++ b/packages/website/src/components/lib/isRuleFrozen.ts @@ -0,0 +1,11 @@ +import type { DeprecatedInfo } from '@typescript-eslint/utils/ts-eslint'; + +export function isRuleFrozen( + deprecated: boolean | DeprecatedInfo | undefined, +): boolean { + return ( + typeof deprecated === 'object' && + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish, eqeqeq + deprecated.availableUntil === null + ); +} From e0b14238cd549145f09c79cdea177e978cbd0d0f Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 01:28:23 +0900 Subject: [PATCH 04/11] docs: section for frozen info in the rule --- .../src/theme/MDXComponents/RuleAttributes.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 0465e126aaad..af8a710bee4a 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -17,6 +17,7 @@ import { STYLISTIC_CONFIG_EMOJI, SUGGESTIONS_EMOJI, } from '../../components/constants'; +import { isRuleFrozen } from '../../components/lib/isRuleFrozen'; import { Feature } from './Feature'; import styles from './RuleAttributes.module.css'; @@ -155,6 +156,18 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { }); } + if (isRuleFrozen(rule.deprecated)) { + features.push({ + children: ( + <> + This rule is currently frozen{' '} + and is not accepting feature requests. + + ), + emoji: '❄️', + }); + } + return (
{features.map(feature => ( From 081c034df75f29ff0259d59d91c682bae8341b01 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 15:57:51 +0900 Subject: [PATCH 05/11] chore: generate config --- packages/eslint-plugin/src/configs/eslintrc/all.ts | 12 ------------ .../src/configs/eslintrc/disable-type-checked.ts | 3 --- .../configs/eslintrc/stylistic-type-checked-only.ts | 2 -- .../src/configs/eslintrc/stylistic-type-checked.ts | 2 -- packages/eslint-plugin/src/configs/flat/all.ts | 12 ------------ .../src/configs/flat/disable-type-checked.ts | 3 --- .../src/configs/flat/stylistic-type-checked-only.ts | 2 -- .../src/configs/flat/stylistic-type-checked.ts | 2 -- tools/scripts/generate-configs.mts | 8 +++++++- 9 files changed, 7 insertions(+), 39 deletions(-) diff --git a/packages/eslint-plugin/src/configs/eslintrc/all.ts b/packages/eslint-plugin/src/configs/eslintrc/all.ts index 34f7fd540450..60b5034646fb 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/all.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/all.ts @@ -26,20 +26,12 @@ export = { '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', - 'default-param-last': 'off', - '@typescript-eslint/default-param-last': 'error', - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/explicit-member-accessibility': 'error', '@typescript-eslint/explicit-module-boundary-types': 'error', - 'init-declarations': 'off', - '@typescript-eslint/init-declarations': 'error', 'max-params': 'off', '@typescript-eslint/max-params': 'error', - '@typescript-eslint/member-ordering': 'error', '@typescript-eslint/method-signature-style': 'error', - '@typescript-eslint/naming-convention': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-delete': 'error', @@ -69,8 +61,6 @@ export = { '@typescript-eslint/no-invalid-void-type': 'error', 'no-loop-func': 'off', '@typescript-eslint/no-loop-func': 'error', - 'no-magic-numbers': 'off', - '@typescript-eslint/no-magic-numbers': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-promises': 'error', @@ -125,8 +115,6 @@ export = { '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/parameter-properties': 'error', '@typescript-eslint/prefer-as-const': 'error', - 'prefer-destructuring': 'off', - '@typescript-eslint/prefer-destructuring': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts index 6853a151722d..cdd78658347b 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts @@ -13,8 +13,6 @@ export = { '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/consistent-return': 'off', '@typescript-eslint/consistent-type-exports': 'off', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-array-delete': 'off', '@typescript-eslint/no-base-to-string': 'off', '@typescript-eslint/no-confusing-void-expression': 'off', @@ -46,7 +44,6 @@ export = { '@typescript-eslint/no-unsafe-unary-minus': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'off', '@typescript-eslint/only-throw-error': 'off', - '@typescript-eslint/prefer-destructuring': 'off', '@typescript-eslint/prefer-find': 'off', '@typescript-eslint/prefer-includes': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts index eb4765a87b3a..670ead763412 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts @@ -10,8 +10,6 @@ import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; export = { extends: ['./configs/eslintrc/base', './configs/eslintrc/eslint-recommended'], rules: { - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-includes': 'error', diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts index 7a6759d8032d..94b62e510f54 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts @@ -18,8 +18,6 @@ export = { '@typescript-eslint/consistent-indexed-object-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/no-confusing-non-null-assertion': 'error', 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/all.ts b/packages/eslint-plugin/src/configs/flat/all.ts index 777028d8580c..842169448d16 100644 --- a/packages/eslint-plugin/src/configs/flat/all.ts +++ b/packages/eslint-plugin/src/configs/flat/all.ts @@ -39,20 +39,12 @@ export default ( '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', - 'default-param-last': 'off', - '@typescript-eslint/default-param-last': 'error', - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/explicit-member-accessibility': 'error', '@typescript-eslint/explicit-module-boundary-types': 'error', - 'init-declarations': 'off', - '@typescript-eslint/init-declarations': 'error', 'max-params': 'off', '@typescript-eslint/max-params': 'error', - '@typescript-eslint/member-ordering': 'error', '@typescript-eslint/method-signature-style': 'error', - '@typescript-eslint/naming-convention': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-delete': 'error', @@ -82,8 +74,6 @@ export default ( '@typescript-eslint/no-invalid-void-type': 'error', 'no-loop-func': 'off', '@typescript-eslint/no-loop-func': 'error', - 'no-magic-numbers': 'off', - '@typescript-eslint/no-magic-numbers': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-promises': 'error', @@ -139,8 +129,6 @@ export default ( '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/parameter-properties': 'error', '@typescript-eslint/prefer-as-const': 'error', - 'prefer-destructuring': 'off', - '@typescript-eslint/prefer-destructuring': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts index 5a48e1722775..8e45627e7a6e 100644 --- a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts @@ -20,8 +20,6 @@ export default ( '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/consistent-return': 'off', '@typescript-eslint/consistent-type-exports': 'off', - '@typescript-eslint/dot-notation': 'off', - '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-array-delete': 'off', '@typescript-eslint/no-base-to-string': 'off', '@typescript-eslint/no-confusing-void-expression': 'off', @@ -53,7 +51,6 @@ export default ( '@typescript-eslint/no-unsafe-unary-minus': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'off', '@typescript-eslint/only-throw-error': 'off', - '@typescript-eslint/prefer-destructuring': 'off', '@typescript-eslint/prefer-find': 'off', '@typescript-eslint/prefer-includes': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts index cc8a23f738ea..7227e1277cb7 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts @@ -23,8 +23,6 @@ export default ( { name: 'typescript-eslint/stylistic-type-checked-only', rules: { - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-includes': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts index c3b76192bb57..c5edfd82b2e1 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts @@ -31,8 +31,6 @@ export default ( '@typescript-eslint/consistent-indexed-object-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/no-confusing-non-null-assertion': 'error', 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', diff --git a/tools/scripts/generate-configs.mts b/tools/scripts/generate-configs.mts index e6892c71b647..6bfe58661dc4 100644 --- a/tools/scripts/generate-configs.mts +++ b/tools/scripts/generate-configs.mts @@ -114,7 +114,13 @@ function reducer( [key, value]: RuleEntry, settings: ConfigRuleSettings = {}, ): LinterConfigRules { - if (value.meta.deprecated) { + const deprecated = value.meta.deprecated; + if (deprecated) { + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish, eqeqeq + if (typeof deprecated === 'object' && deprecated.availableUntil === null) { + return config; + } + if (value.meta.docs.recommended) { throw new Error(`${key} is both deprecated and recommended.`); } From 13702f0bb2ee97e98513f32e6c4a3b774735db80 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 16:06:57 +0900 Subject: [PATCH 06/11] feat: add frozen property at docs meta data --- packages/utils/src/ts-eslint/Rule.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 3b40254b0a6e..e2700cf07fee 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -25,6 +25,11 @@ export interface RuleMetaDataDocs { * The URL of the rule's docs. */ url?: string; + + /** + * Mark this rule as frozen. + */ + isFrozen?: boolean; } export interface ExternalSpecifier { From ebc9a5c4352b8e185de41471ffbba8662f2af19a Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 16:08:42 +0900 Subject: [PATCH 07/11] Revert "feat: mark these rule as frozen" This reverts commit 3447143ccb8991b6ef5fbe5b2e68f905a7631750. --- packages/eslint-plugin/src/rules/default-param-last.ts | 3 --- packages/eslint-plugin/src/rules/dot-notation.ts | 3 --- packages/eslint-plugin/src/rules/init-declarations.ts | 3 --- packages/eslint-plugin/src/rules/member-ordering.ts | 3 --- packages/eslint-plugin/src/rules/naming-convention.ts | 3 --- packages/eslint-plugin/src/rules/no-magic-numbers.ts | 3 --- packages/eslint-plugin/src/rules/prefer-destructuring.ts | 3 --- 7 files changed, 21 deletions(-) diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index 01afb9dfa156..1d120720d26c 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -8,9 +8,6 @@ export default createRule({ name: 'default-param-last', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, docs: { description: 'Enforce default parameters to be last', extendsBaseRule: true, diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 39bbab09a939..69d53170c70e 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -32,9 +32,6 @@ export default createRule({ meta: { type: 'suggestion', defaultOptions, - deprecated: { - availableUntil: null, - }, docs: { description: 'Enforce dot notation whenever possible', extendsBaseRule: true, diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index 926b47adea6a..16b3f87e713c 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -19,9 +19,6 @@ export default createRule({ name: 'init-declarations', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index d84d5d9fe0f5..7ae9ec7627cf 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -726,9 +726,6 @@ export default createRule({ name: 'member-ordering', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, docs: { description: 'Require a consistent member declaration order', }, diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index f8df03cfcfa8..03500d825163 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -66,9 +66,6 @@ export default createRule({ name: 'naming-convention', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, docs: { description: 'Enforce naming conventions for everything across a codebase', diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 7b9e20ab2ab7..6ecddefd0645 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -49,9 +49,6 @@ export default createRule({ name: 'no-magic-numbers', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: 'Disallow magic numbers', diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index fb884dba1402..a3afb125a301 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -72,9 +72,6 @@ export default createRule({ name: 'prefer-destructuring', meta: { type: 'suggestion', - deprecated: { - availableUntil: null, - }, // defaultOptions, -- base rule does not use defaultOptions docs: { description: 'Require destructuring from arrays and/or objects', From 47a4d4079ed5e15cac3d780ec2f672af9b75ad8e Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 16:18:29 +0900 Subject: [PATCH 08/11] feat: mark these rule as frozen with frozen property --- packages/eslint-plugin/src/rules/default-param-last.ts | 1 + packages/eslint-plugin/src/rules/dot-notation.ts | 1 + packages/eslint-plugin/src/rules/init-declarations.ts | 1 + packages/eslint-plugin/src/rules/member-ordering.ts | 1 + packages/eslint-plugin/src/rules/naming-convention.ts | 1 + packages/eslint-plugin/src/rules/no-magic-numbers.ts | 1 + packages/eslint-plugin/src/rules/prefer-destructuring.ts | 1 + packages/utils/src/ts-eslint/Rule.ts | 2 +- 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index 1d120720d26c..edfa85842df8 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -11,6 +11,7 @@ export default createRule({ docs: { description: 'Enforce default parameters to be last', extendsBaseRule: true, + frozen: true, }, messages: { shouldBeLast: 'Default parameters should be last.', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 69d53170c70e..73363938f13a 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -35,6 +35,7 @@ export default createRule({ docs: { description: 'Enforce dot notation whenever possible', extendsBaseRule: true, + frozen: true, recommended: 'stylistic', requiresTypeChecking: true, }, diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index 16b3f87e713c..fafc9a404f12 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -24,6 +24,7 @@ export default createRule({ description: 'Require or disallow initialization in variable declarations', extendsBaseRule: true, + frozen: true, }, hasSuggestions: baseRule.meta.hasSuggestions, messages: baseRule.meta.messages, diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 7ae9ec7627cf..f930292bf3f2 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -728,6 +728,7 @@ export default createRule({ type: 'suggestion', docs: { description: 'Require a consistent member declaration order', + frozen: true, }, messages: { incorrectGroupOrder: diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 03500d825163..bc5183734437 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -71,6 +71,7 @@ export default createRule({ 'Enforce naming conventions for everything across a codebase', // technically only requires type checking if the user uses "type" modifiers requiresTypeChecking: true, + frozen: true, }, messages: { doesNotMatchFormat: diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 6ecddefd0645..04b48b3a1daa 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -53,6 +53,7 @@ export default createRule({ docs: { description: 'Disallow magic numbers', extendsBaseRule: true, + frozen: true, }, messages: baseRule.meta.messages, schema: [schema], diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index a3afb125a301..40c0de88ba40 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -76,6 +76,7 @@ export default createRule({ docs: { description: 'Require destructuring from arrays and/or objects', extendsBaseRule: true, + frozen: true, requiresTypeChecking: true, }, fixable: baseRule.meta.fixable, diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index e2700cf07fee..fb7b062fb0db 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -29,7 +29,7 @@ export interface RuleMetaDataDocs { /** * Mark this rule as frozen. */ - isFrozen?: boolean; + frozen?: boolean; } export interface ExternalSpecifier { From c605266c8638a2be9ce08b2da91961c4435b6b0b Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 16:23:10 +0900 Subject: [PATCH 09/11] Revert "chore: generate config" This reverts commit 081c034df75f29ff0259d59d91c682bae8341b01. --- packages/eslint-plugin/src/configs/eslintrc/all.ts | 12 ++++++++++++ .../src/configs/eslintrc/disable-type-checked.ts | 3 +++ .../configs/eslintrc/stylistic-type-checked-only.ts | 2 ++ .../src/configs/eslintrc/stylistic-type-checked.ts | 2 ++ packages/eslint-plugin/src/configs/flat/all.ts | 12 ++++++++++++ .../src/configs/flat/disable-type-checked.ts | 3 +++ .../src/configs/flat/stylistic-type-checked-only.ts | 2 ++ .../src/configs/flat/stylistic-type-checked.ts | 2 ++ tools/scripts/generate-configs.mts | 8 +------- 9 files changed, 39 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/configs/eslintrc/all.ts b/packages/eslint-plugin/src/configs/eslintrc/all.ts index 60b5034646fb..34f7fd540450 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/all.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/all.ts @@ -26,12 +26,20 @@ export = { '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/explicit-member-accessibility': 'error', '@typescript-eslint/explicit-module-boundary-types': 'error', + 'init-declarations': 'off', + '@typescript-eslint/init-declarations': 'error', 'max-params': 'off', '@typescript-eslint/max-params': 'error', + '@typescript-eslint/member-ordering': 'error', '@typescript-eslint/method-signature-style': 'error', + '@typescript-eslint/naming-convention': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-delete': 'error', @@ -61,6 +69,8 @@ export = { '@typescript-eslint/no-invalid-void-type': 'error', 'no-loop-func': 'off', '@typescript-eslint/no-loop-func': 'error', + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-promises': 'error', @@ -115,6 +125,8 @@ export = { '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/parameter-properties': 'error', '@typescript-eslint/prefer-as-const': 'error', + 'prefer-destructuring': 'off', + '@typescript-eslint/prefer-destructuring': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts index cdd78658347b..6853a151722d 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts @@ -13,6 +13,8 @@ export = { '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/consistent-return': 'off', '@typescript-eslint/consistent-type-exports': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-array-delete': 'off', '@typescript-eslint/no-base-to-string': 'off', '@typescript-eslint/no-confusing-void-expression': 'off', @@ -44,6 +46,7 @@ export = { '@typescript-eslint/no-unsafe-unary-minus': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'off', '@typescript-eslint/only-throw-error': 'off', + '@typescript-eslint/prefer-destructuring': 'off', '@typescript-eslint/prefer-find': 'off', '@typescript-eslint/prefer-includes': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts index 670ead763412..eb4765a87b3a 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts @@ -10,6 +10,8 @@ import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'; export = { extends: ['./configs/eslintrc/base', './configs/eslintrc/eslint-recommended'], rules: { + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-includes': 'error', diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts index 94b62e510f54..7a6759d8032d 100644 --- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts @@ -18,6 +18,8 @@ export = { '@typescript-eslint/consistent-indexed-object-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/no-confusing-non-null-assertion': 'error', 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/all.ts b/packages/eslint-plugin/src/configs/flat/all.ts index 842169448d16..777028d8580c 100644 --- a/packages/eslint-plugin/src/configs/flat/all.ts +++ b/packages/eslint-plugin/src/configs/flat/all.ts @@ -39,12 +39,20 @@ export default ( '@typescript-eslint/consistent-type-definitions': 'error', '@typescript-eslint/consistent-type-exports': 'error', '@typescript-eslint/consistent-type-imports': 'error', + 'default-param-last': 'off', + '@typescript-eslint/default-param-last': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/explicit-member-accessibility': 'error', '@typescript-eslint/explicit-module-boundary-types': 'error', + 'init-declarations': 'off', + '@typescript-eslint/init-declarations': 'error', 'max-params': 'off', '@typescript-eslint/max-params': 'error', + '@typescript-eslint/member-ordering': 'error', '@typescript-eslint/method-signature-style': 'error', + '@typescript-eslint/naming-convention': 'error', 'no-array-constructor': 'off', '@typescript-eslint/no-array-constructor': 'error', '@typescript-eslint/no-array-delete': 'error', @@ -74,6 +82,8 @@ export default ( '@typescript-eslint/no-invalid-void-type': 'error', 'no-loop-func': 'off', '@typescript-eslint/no-loop-func': 'error', + 'no-magic-numbers': 'off', + '@typescript-eslint/no-magic-numbers': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-new': 'error', '@typescript-eslint/no-misused-promises': 'error', @@ -129,6 +139,8 @@ export default ( '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/parameter-properties': 'error', '@typescript-eslint/prefer-as-const': 'error', + 'prefer-destructuring': 'off', + '@typescript-eslint/prefer-destructuring': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-for-of': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts index 8e45627e7a6e..5a48e1722775 100644 --- a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts @@ -20,6 +20,8 @@ export default ( '@typescript-eslint/await-thenable': 'off', '@typescript-eslint/consistent-return': 'off', '@typescript-eslint/consistent-type-exports': 'off', + '@typescript-eslint/dot-notation': 'off', + '@typescript-eslint/naming-convention': 'off', '@typescript-eslint/no-array-delete': 'off', '@typescript-eslint/no-base-to-string': 'off', '@typescript-eslint/no-confusing-void-expression': 'off', @@ -51,6 +53,7 @@ export default ( '@typescript-eslint/no-unsafe-unary-minus': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'off', '@typescript-eslint/only-throw-error': 'off', + '@typescript-eslint/prefer-destructuring': 'off', '@typescript-eslint/prefer-find': 'off', '@typescript-eslint/prefer-includes': 'off', '@typescript-eslint/prefer-nullish-coalescing': 'off', diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts index 7227e1277cb7..cc8a23f738ea 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts @@ -23,6 +23,8 @@ export default ( { name: 'typescript-eslint/stylistic-type-checked-only', rules: { + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-find': 'error', '@typescript-eslint/prefer-includes': 'error', diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts index c5edfd82b2e1..c3b76192bb57 100644 --- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts +++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts @@ -31,6 +31,8 @@ export default ( '@typescript-eslint/consistent-indexed-object-style': 'error', '@typescript-eslint/consistent-type-assertions': 'error', '@typescript-eslint/consistent-type-definitions': 'error', + 'dot-notation': 'off', + '@typescript-eslint/dot-notation': 'error', '@typescript-eslint/no-confusing-non-null-assertion': 'error', 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', diff --git a/tools/scripts/generate-configs.mts b/tools/scripts/generate-configs.mts index 6bfe58661dc4..e6892c71b647 100644 --- a/tools/scripts/generate-configs.mts +++ b/tools/scripts/generate-configs.mts @@ -114,13 +114,7 @@ function reducer( [key, value]: RuleEntry, settings: ConfigRuleSettings = {}, ): LinterConfigRules { - const deprecated = value.meta.deprecated; - if (deprecated) { - // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish, eqeqeq - if (typeof deprecated === 'object' && deprecated.availableUntil === null) { - return config; - } - + if (value.meta.deprecated) { if (value.meta.docs.recommended) { throw new Error(`${key} is both deprecated and recommended.`); } From bdc7e4e36e78a9c696467b8faabfa8d06f3f4f16 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Fri, 8 Aug 2025 16:52:10 +0900 Subject: [PATCH 10/11] docs: mark as frozen with emoji on rule docs --- .../src/components/RulesTable/index.tsx | 27 ++++--------------- .../src/components/lib/isRuleFrozen.ts | 11 -------- .../theme/MDXComponents/RuleAttributes.tsx | 3 +-- 3 files changed, 6 insertions(+), 35 deletions(-) delete mode 100644 packages/website/src/components/lib/isRuleFrozen.ts diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 4ecea89afb4b..68315eb926c9 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -1,8 +1,5 @@ import type { RulesMeta } from '@site/rulesMeta'; -import type { - DeprecatedInfo, - RuleRecommendation, -} from '@typescript-eslint/utils/ts-eslint'; +import type { RuleRecommendation } from '@typescript-eslint/utils/ts-eslint'; import Link from '@docusaurus/Link'; import { useHistory } from '@docusaurus/router'; @@ -25,7 +22,6 @@ import { SUGGESTIONS_EMOJI, TYPE_INFORMATION_EMOJI, } from '../constants'; -import { isRuleFrozen } from '../lib/isRuleFrozen'; import styles from './styles.module.css'; function interpolateCode( @@ -45,18 +41,6 @@ function getActualRecommended({ return recommended ? getRecommendationWithEmoji(recommended) : ['', '']; } -function isRealDeprecated( - deprecated: boolean | DeprecatedInfo | undefined, -): boolean { - if (typeof deprecated === 'boolean') { - return deprecated; - } - if (isRuleFrozen(deprecated)) { - return false; - } - return !!deprecated; -} - function RuleRow({ rule, }: { @@ -66,7 +50,6 @@ function RuleRow({ return null; } const { deprecated, fixable, hasSuggestions } = rule; - const isDeprecated = isRealDeprecated(deprecated); const { extendsBaseRule, requiresTypeChecking } = rule.docs; const [emoji, actualRecommended] = getActualRecommended(rule); return ( @@ -76,7 +59,7 @@ function RuleRow({ @typescript-eslint/{rule.name} - {isRuleFrozen(rule.deprecated) && ❄️} + {rule.docs.frozen && ❄️}

{interpolateCode(rule.docs.description)} @@ -114,9 +97,9 @@ function RuleRow({ - {isDeprecated ? DEPRECATED_RULE_EMOJI : ''} + {deprecated ? DEPRECATED_RULE_EMOJI : ''} ); @@ -193,7 +176,7 @@ export default function RulesTable(): React.JSX.Element { match(filters.suggestions, !!r.hasSuggestions), match(filters.typeInformation, !!r.docs.requiresTypeChecking), match(filters.extension, !!r.docs.extendsBaseRule), - match(filters.deprecated, isRealDeprecated(r.deprecated)), + match(filters.deprecated, !!r.deprecated), ].filter( (o): o is boolean => // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish diff --git a/packages/website/src/components/lib/isRuleFrozen.ts b/packages/website/src/components/lib/isRuleFrozen.ts deleted file mode 100644 index 34ec211e8a7f..000000000000 --- a/packages/website/src/components/lib/isRuleFrozen.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { DeprecatedInfo } from '@typescript-eslint/utils/ts-eslint'; - -export function isRuleFrozen( - deprecated: boolean | DeprecatedInfo | undefined, -): boolean { - return ( - typeof deprecated === 'object' && - // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish, eqeqeq - deprecated.availableUntil === null - ); -} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index af8a710bee4a..ec1aa2d1d7d0 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -17,7 +17,6 @@ import { STYLISTIC_CONFIG_EMOJI, SUGGESTIONS_EMOJI, } from '../../components/constants'; -import { isRuleFrozen } from '../../components/lib/isRuleFrozen'; import { Feature } from './Feature'; import styles from './RuleAttributes.module.css'; @@ -156,7 +155,7 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { }); } - if (isRuleFrozen(rule.deprecated)) { + if (rule.docs.frozen) { features.push({ children: ( <> From 0e004ade34b9896e801fcbf8f1a11f3ab928e684 Mon Sep 17 00:00:00 2001 From: nayounsang Date: Sat, 9 Aug 2025 01:56:20 +0900 Subject: [PATCH 11/11] fix: lint --- packages/eslint-plugin/src/rules/naming-convention.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index bc5183734437..facda6fcbc44 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -70,8 +70,8 @@ export default createRule({ description: 'Enforce naming conventions for everything across a codebase', // technically only requires type checking if the user uses "type" modifiers - requiresTypeChecking: true, frozen: true, + requiresTypeChecking: true, }, messages: { doesNotMatchFormat: