feat(eslint-config-fluid): generate deprecated-rules data and remove deprecated stylistic rules#26199
feat(eslint-config-fluid): generate deprecated-rules data and remove deprecated stylistic rules#26199tylerbutler wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a script to automatically generate a JSON file containing all deprecated ESLint rules from core ESLint and 12 plugins. The script intelligently detects and uses either flat config (flat.mts) or legacy CJS configs (recommended.js, strict.js) to determine which deprecated rules are currently configured in the project.
Changes:
- Adds a new TypeScript script that queries rule metadata from ESLint and all configured plugins to identify deprecated rules
- Generates a comprehensive JSON output tracking 119 deprecated rules, their replacement rules, and configuration status
- Adds the
typescript-eslintpackage as a dependency to support the script's functionality
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/build/eslint-config-fluid/scripts/generate-deprecated-rules.ts | New script that extracts deprecated rules from ESLint core and plugins, with fallback logic for config loading |
| common/build/eslint-config-fluid/printed-configs/deprecated-rules.json | Auto-generated JSON output containing 119 deprecated rules with metadata about replacements and configuration status |
| common/build/eslint-config-fluid/package.json | Adds generate-deprecated-rules npm script and typescript-eslint dependency |
| common/build/eslint-config-fluid/pnpm-lock.yaml | Lockfile updates for the new typescript-eslint dependency |
Files not reviewed (1)
- common/build/eslint-config-fluid/pnpm-lock.yaml: Language not supported
Rewrite the deprecated rules generation script for the current modular flat config structure. The script loads the flat configs, inspects plugin rule metadata for deprecated rules, and outputs a JSON file of deprecated rules that are still configured. Key changes from the previous version: - Removed legacy CJS config support (ESLint 8 compat layer removed) - Uses ESLint's calculateConfigForFile for resolved rule detection - Extracts plugins directly from flat config objects - Outputs to data/ directory instead of printed-configs/
7553a20 to
2054f95
Compare
Generated data files like deprecated-rules.json should not be subject to prettier formatting checks, similar to printed-configs/.
399cacd to
aaaaa8e
Compare
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (1334 lines, 13 files), I've queued these reviewers:
How this works
|
This comment was marked as outdated.
This comment was marked as outdated.
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
Summary
generate-deprecated-rulesscript that introspects rule metadata from ESLint core and every plugin referenced by the flat configs, then writes the results — includingreplacedByinfo and whether each rule is enabled in our resolved configs and/or referenced from our local rule sources — todata/deprecated-rules.json. Wired intonpm run buildafterprint-configs.library/rules/base.mts(arrow-parens,brace-style,comma-dangle,comma-spacing,eol-last,func-call-spacing,keyword-spacing,linebreak-style,max-len,new-parens,newline-per-chained-call,no-extra-semi,no-multiple-empty-lines,no-trailing-spaces,no-whitespace-before-property,object-curly-spacing,padded-blocks,padding-line-between-statements,quote-props,quotes,semi,semi-spacing,space-before-blocks,space-before-function-paren,space-in-parens,space-infix-ops,spaced-comment) plus the deprecated@typescript-eslint/typedefrule. Prettier already covers formatting concerns.no-multi-spacesafterprettierConfiginlibrary/configs/base.mts— left disabled since it is also deprecated.print-configsto run viajitiand addsdata/to.prettierignore.printed-configs/*.jsonto reflect the rule removals.