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.
First off, thanks for considering this change! I've used your plugin for quite some time and it's been super helpful.
Description
(Drawn from commit message on 15ace41)
This PR refactors
./src/index.js
to support ESLint's "new" flat configuration file in a non-disruptive, backwards-compatible manner.The introduction of the flat configuration changed the "shape" of the object that plugins should export. As a result, plugin authors are adding confis with names like
flat/recommended
(as I've done here) for consumers ot use. Rules for the "flat"-prefixed configurations are the same as the legacy config, but with the exported objects conforming to the new "flat" syntax.I followed the recommendations in the plugin migration guide with inspiration drawn from the eslint-plugin-jsdoc's project.
Notable changes:
meta
key as recommended by ESLint with name and version drawn frompackage.json
flat/recommended
configuration matching the rules set by the existingrecommended configuration
Usage in an
eslint.config.js
file would look like:…and also
I neglected to note the "before" in my commit message. Before this change, using this plugin in a "flat" configuration file is possible, but requires a bit of extra work: