Feat/add ESLint flat config support with backward compatibility #62
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.
Add ESLint Flat Config Support with backward compatibility
Hey!
I would like to use this awesome plugin in my project, which uses ESLint 9+ with FlatConfig, so I suggest adding FlatConfig support to the plugin while maintaining the current functionality for those who still use
.eslintrc.What's New
ESLint 9 made flat config the default, so I've updated the plugin to work with both the new and old config formats. The plugin now exports two configs:
flat/recommendedfor the new flat config (ESLint 9+)legacy-recommendedfor traditional.eslintrcsetupsUsage
For ESLint 9+ (Flat Config)
For ESLint 8 (.eslintrc)
{ "extends": ["plugin:sql/legacy-recommended"] }What Changed
tsctotsupfor dual CJS/ESM outputmetaobject with name and versionTesting
All tests pass, including new ones that verify:
Backward Compatibility
It seems that the plugin did not previously export any predefined configurations, so there are zero breaking changes. If you're using the plugin today, it'll keep working exactly as before.
This is my first contribution to an eslint community plugin and I am new to this field, so please feel free to give me feedbacks ^^