Skip to content

feat(eslint-config-fluid): generate deprecated-rules data and remove deprecated stylistic rules#26199

Open
tylerbutler wants to merge 10 commits into
microsoft:mainfrom
tylerbutler:deprecated-rules-script
Open

feat(eslint-config-fluid): generate deprecated-rules data and remove deprecated stylistic rules#26199
tylerbutler wants to merge 10 commits into
microsoft:mainfrom
tylerbutler:deprecated-rules-script

Conversation

@tylerbutler
Copy link
Copy Markdown
Member

@tylerbutler tylerbutler commented Jan 13, 2026

Summary

  • Adds a generate-deprecated-rules script that introspects rule metadata from ESLint core and every plugin referenced by the flat configs, then writes the results — including replacedBy info and whether each rule is enabled in our resolved configs and/or referenced from our local rule sources — to data/deprecated-rules.json. Wired into npm run build after print-configs.
  • Removes a batch of deprecated core ESLint stylistic rules from 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/typedef rule. Prettier already covers formatting concerns.
  • Stops re-enabling no-multi-spaces after prettierConfig in library/configs/base.mts — left disabled since it is also deprecated.
  • Switches print-configs to run via jiti and adds data/ to .prettierignore.
  • Regenerates printed-configs/*.json to reflect the rule removals.

@tylerbutler tylerbutler marked this pull request as ready for review January 13, 2026 20:20
Copilot AI review requested due to automatic review settings January 13, 2026 20:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-eslint package 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

Comment thread common/build/eslint-config-fluid/scripts/generate-deprecated-rules.ts Outdated
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/
@tylerbutler tylerbutler force-pushed the deprecated-rules-script branch from 7553a20 to 2054f95 Compare February 20, 2026 00:31
@tylerbutler tylerbutler self-assigned this Feb 20, 2026
Generated data files like deprecated-rules.json should not be
subject to prettier formatting checks, similar to printed-configs/.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

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:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

# Conflicts:
#	common/build/eslint-config-fluid/package.json
@github-actions

This comment was marked as outdated.

@tylerbutler tylerbutler changed the title feat(eslint-config-fluid): add script to generate deprecated rules JSON feat(eslint-config-fluid): generate deprecated-rules data and remove deprecated stylistic rules May 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  288859 links
    1925 destination URLs
    2175 URLs ignored
       0 warnings
       0 errors


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants