Skip to content

Conversation

@tylerbutler
Copy link
Member

Summary

Adds a script that automatically generates a JSON file listing all deprecated ESLint rules from core ESLint and all plugins used in the config. This enables tooling to programmatically identify and handle deprecated rules.

Features

  • Queries rule metadata from ESLint core and 12 plugins:
    • @typescript-eslint
    • unicorn
    • jsdoc
    • import-x
    • promise
    • react
    • react-hooks
    • depend
    • @eslint-community/eslint-comments
    • @rushstack
    • @fluid-internal/fluid
    • tsdoc
    • unused-imports
  • Tracks which deprecated rules are currently configured in our ESLint configs
  • Records replacement rules when available
  • Supports both flat config (flat.mts) and legacy CJS configs (recommended.js, strict.js)

Output

The script generates printed-configs/deprecated-rules.json containing:

  • 119 deprecated rules total
  • 70 rules that are currently configured
  • 21 rules with documented replacements

Usage

pnpm run generate-deprecated-rules

Test plan

  • Script runs successfully on main branch
  • Falls back to legacy config when flat config is unavailable
  • Generates valid JSON output

Add a script that automatically generates a JSON file listing all deprecated
ESLint rules from core ESLint and all plugins used in the config. This enables
tooling to programmatically identify and handle deprecated rules.

The script:
- Queries rule metadata from ESLint core and 12 plugins
- Tracks which deprecated rules are configured in our ESLint configs
- Records replacement rules when available
- Supports both flat config (flat.mts) and legacy CJS configs

Output is written to printed-configs/deprecated-rules.json.
@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
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

Address PR feedback from Copilot: use indexOf with bounds check
to robustly handle edge cases like rule names starting with "/".
Also use nullish coalescing for consistency.
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.

1 participant