Draft
Conversation
- Use `satisfies ESLint.Plugin` instead of `: ESLint.Plugin` type annotation to preserve the inferred type of the default export - Restructure config assignment to avoid mutation and unsafe non-null assertion The generated `.d.ts` now types `configs` as a required property with all four named configs as `Linter.Config`. See e18e#67 for what this is fixing.
Author
|
Note that strictly speaking this adds a requirement of TypeScript 4.9 (released Nov 2022), which added |
43081j
reviewed
Feb 18, 2026
| }; | ||
| } satisfies ESLint.Plugin; | ||
|
|
||
| plugin.configs!.recommended = recommended(plugin); |
Contributor
There was a problem hiding this comment.
the reason for this was so the plugin a config has is the same plugin you import.
this isn't the case anymore if you export a new object (L56).
which means ESLint's new extends syntax will get confused. e.g.
{
plugins: [
e18e
},
extends: [
'e18e/recommended' // this'll now cause problems since the `e18e` above and the one this config holds are different objects
]
}
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.
Problem
Fixes #67.
Fix
satisfies ESLint.Plugininstead of: ESLint.Plugintype annotation to preserve the inferred type of the default exportThe generated
.d.tsnow typesconfigsas a required property with all four named configs asLinter.Config.