Repository navigation
Conversation
Collaborator
Author
|
I believe this is needed because of eslint/eslint#20352 |
Collaborator
Author
|
The bug was closed. Reopened as a change request: eslint/eslint#20354 |
This was referenced Jan 2, 2026
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Type-aware configuration can fail for untyped or excluded JavaScript files, and root discovery can hang on Windows.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Separates package.json linting from the recommended source-code configuration.
Changes:
- Adds a dedicated
packageJsonconfig. - Updates recommended JS/TS patterns and type-aware parsing.
- Documents isolated configuration usage.
| File | Description |
|---|---|
| README.md | Documents scoped source and package configurations. |
| lib/index.ts | Separates package rules and updates parser configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The recommended config carried a `files: ['package.json']` block. Once any config object matches package.json, ESLint lints it, and every config object without `files` in the user's config applies to it too. A type-checked config layered after `recommended`, such as `tseslint.configs.strictTypeChecked`, then throws "You have used a rule which requires type information" on package.json. ESLint declined to add isolated configs (eslint/eslint#20354), so the block moves to its own `packageJson` config, which users spread last.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

recommendedincludes afiles: ['package.json']config object. Once any config object matchespackage.json, ESLint lints that file, and every config object in the user's config that has nofilesapplies to it too. If you layer a type-checked config afterrecommended, for exampletseslint.configs.strictTypeChecked, ESLint throws onpackage.json:ESLint declined to add isolated configs (eslint/eslint#20354), so this PR moves the
package.jsonrules into their ownpackageJsonconfig.recommendedno longer lintspackage.json. To keepdepend/ban-dependencies, spread the new config last:packageJsonturns the type-checked rules off forpackage.json, which is why it must come last.Changes:
lib/index.ts: move thepackage.jsonconfig object fromrecommendedintoconfigs.packageJsonindex.d.ts: add thepackageJsonconfig typedocs/configuration.md: document the new config and why it comes lasttests/recommendedConfig.test.ts:recommendedalone does not lintpackage.json, a type-checked config withoutfilesno longer throws on it, andpackageJsonspread last reports banned dependencies