feat: introduce flat config #361
Merged
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.
Introduce flat configs (blog, doc), required to migrate to ESLint 9 (#342).
Migration guide: https://eslint.org/docs/latest/use/configure/migration-guide
To keep our config compatible with legacy versions, I've created new configs in a separate
flat/directory.You can see the new usage in the updated README or in the
packages/test/eslint.config.jsfiles:Notes
I've tried to keep changes minimal, configs in the
flat/dir are meant to be a simple port.A lot of plugins already expose ways to work with flat configs, I simply followed their doc, for example:
Edit: FIXED in 2.31.0
Only theimportplugin is not fully compatible and I had to disableimport/no-named-as-defaultfor now.I've been able to reuse the rules from the
rules/dir by just deleting the deprecated properties:pluginsis now moved at the top leveloverridesis now an additional entry of the flat configChanges
flat/direslint.config.jsfiles@eslint/jsandglobalRefs
envmoved tolanguageOptions: https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-optionsparsermoved tolanguageOptions: https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsersSFCC-391