-
-
Notifications
You must be signed in to change notification settings - Fork 55
feat!: remove deprecated ESLint config(eslintrc) #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
All configs are updated to modern; however, "flat/*" is still retained (for maximum compatibility).
There was a problem hiding this 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 removes the deprecated ESLint eslintrc configuration format, modernizing all configs to use the flat config format exclusively. The "flat/*" prefixed configs are retained for backward compatibility but marked as deprecated.
Changes:
- Removed eslintrc exports from all configuration files (recommended.js, recommended-script.js, recommended-module.js)
- Updated primary config exports (recommended-module, recommended-script, recommended, all) to use flat config format
- Added new "mixed-esm-and-cjs" config for handling mixed module types
- Removed eslintrc test file and updated documentation generator configuration
- Updated rule documentation to reflect that all rules are now included in the "all" config
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lib/configs/eslintrc.js | Removed entire test file for deprecated eslintrc configs |
| lib/index.js | Updated config exports to use flat format for primary config names; deprecated "flat/*" prefixed configs retained for backward compatibility |
| lib/configs/recommended.js | Removed eslintrc export, keeping only flat config export |
| lib/configs/recommended-script.js | Removed eslintrc export and self-references; flat config now self-contained with explicit globals |
| lib/configs/recommended-module.js | Removed eslintrc export and self-references; flat config now self-contained with explicit globals |
| lib/configs/all.js | Updated type annotation from Linter.FlatConfig to Linter.Config |
| docs/rules/*.md | Updated 37 rule documentation files to show rules are enabled in "all" config |
| README.md | Added "all" config to the configs legend and updated rules table to show "all" config inclusion |
| .eslint-doc-generatorrc.js | Added "mixed-esm-and-cjs" to ignored configs; removed emoji mappings for deprecated configs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const configs = { | ||
| "recommended-module": { plugins: ["n"], ...esmConfig.eslintrc }, | ||
| "recommended-script": { plugins: ["n"], ...cjsConfig.eslintrc }, | ||
| recommended: { plugins: ["n"], ...recommendedConfig.eslintrc }, | ||
| "recommended-module": { plugins: { n: base }, ...esmConfig.flat }, | ||
| "recommended-script": { plugins: { n: base }, ...cjsConfig.flat }, | ||
| recommended: { plugins: { n: base }, ...recommendedConfig.flat }, | ||
| "mixed-esm-and-cjs": [ | ||
| { files: ["**/*.js"], plugins: { n: base }, ...recommendedConfig.flat }, | ||
| { files: ["**/*.mjs"], plugins: { n: base }, ...esmConfig.flat }, | ||
| { files: ["**/*.cjs"], plugins: { n: base }, ...cjsConfig.flat }, | ||
| ], | ||
| all: { plugins: { n: base }, ...allRulesConfig.flat }, |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The newly introduced non-prefixed configs (recommended-module, recommended-script, recommended, mixed-esm-and-cjs, all) lack test coverage. While the deprecated "flat/*" prefixed configs have tests in tests/lib/configs/flat.js, there are no tests verifying that the new primary config names work correctly. Consider adding test coverage for these configs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
|
@aladdin-add I've opened a new pull request, #505, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: aladdin-add <[email protected]>
This pull request updates documentation and configuration for the
eslint-plugin-nproject to introduce and clarify the newallconfiguration, improve documentation on configuration usage, and update rule tables and examples for consistency and clarity.Documentation and Config Updates:
allconfiguration to the documentation and updated the rules table to indicate which rules are enabled by it. [1] [2] [3] [4] [5] [6] [7]README.mdto use moderneslint.config.jswithdefineConfigand ES module syntax, and removed legacy.eslintrc.jsonexamples.flat/mixed-esm-and-cjstomixed-esm-and-cjsthroughout the documentation and config files. [1] [2].eslint-doc-generatorrc.jsto remove unused or outdated entries.These changes help users understand the available configurations, encourage use of modern ESLint config formats, and keep documentation accurate and up to date.