π Tracking: Flat Config support
Opened this issue Β· 44 comments
π Hi all! With flat config stabilized and ESLint v9 on the horizon released!, many community plugins are adding native support for flat config. The Configuration Migration Guide provides docs on how to do that.
This is a tracking issue of the ~50 ~65 or so most popular community integrations and plugins for ESLint. We'll keep this list updated over time.
See also π Tracking: ESLint v9 support for plugins additionally supporting ESLint v9.
π Status and Types emoji key:
- β Full support released!
- π Partial support released
- π¦ Merged; pending release
- ποΈ PR was at least started
- π Issue filed; waiting for PR
- β Not supported; no issue filed
- β Unknown
- π Known blocker
Task list of issues/PRs on projects that didn't have released support yet at time of filing:
- polygonplanet/sublime-text-eslint#30
- microsoft/vscode-eslint#1644
- dimaMachina/graphql-eslint#2178
- Intellicode/eslint-plugin-react-native#333
- typescript-eslint/typescript-eslint#7694 βοΈ
- ota-meshi/eslint-plugin-astro#241 βοΈ
- amilajack/eslint-plugin-compat#603 βοΈ
- cypress-io/eslint-plugin-cypress#146 βοΈ
- gund/eslint-plugin-deprecation#85 βοΈ
- eslint-community/eslint-plugin-es-x#124 βοΈ
- eslint-community/eslint-plugin-eslint-comments#182 βοΈ
- eslint-functional/eslint-plugin-functional#776 βοΈ
- import-js/eslint-plugin-import#2556
- un-ts/eslint-plugin-import-x#60 βοΈ
- ota-meshi/eslint-plugin-jsonc#240 βοΈ
- jest-community/eslint-plugin-jest#1408 βοΈ
- jsx-eslint/eslint-plugin-jsx-a11y#891
- mightyiam/eslint-config-love#1299 βοΈ
- eslint/eslint-plugin-markdown#231 βοΈ
- lo1tuma/eslint-plugin-mocha#341 βοΈ
- vercel/next.js#58411
- eslint-community/eslint-plugin-promise#449
- ota-meshi/eslint-plugin-regexp#695 βοΈ
- facebook/react#28313
- facebook/react-native#42996
- SonarSource/eslint-plugin-sonarjs#403
- storybookjs/eslint-plugin-storybook#135
- francoismassart/eslint-plugin-tailwindcss#280 βοΈ
- testing-library/eslint-plugin-testing-library#853
- vuejs/eslint-plugin-vue#1291 βοΈ
- intlify/eslint-plugin-vue-i18n#484 βοΈ
- iamturns/eslint-config-airbnb-typescript#331
- gajus/eslint-config-canonical#80 βοΈ
- standard/eslint-config-standard#351
- eslint/create-config#51 βοΈ
- microsoft/rushstack#4372
- xojs/xo#702
Keep in mind that this list isn't automatic: I'm hand-editing it. Please report any inaccuracies or out-of-date information! β€οΈ
What counts as βsupportedβ? eslint-plugin-simple-import-sort is currently marked as ββ Not supported; no issue filedβ. I got curious and tried to use it with this flat config:
import simpleImportSort from "eslint-plugin-simple-import-sort";
export default [
{
plugins: {
"simple-import-sort": simpleImportSort,
},
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
}
}
];
It worked! What does it take to earn the precious β emoji?
@lydell in your case you're pretty close already because the plugin provides no configs, no processors, no globals, etc. Your plugin will "just work" in flat configs because of that.
The only thing you're really missing is plugin metadata: https://eslint.org/docs/latest/extend/plugin-migration-flat-config#adding-plugin-meta-information
xo does not support it yet: xojs/xo#702
What counts as βsupportedβ?
Another level of "support" is for the ESLint plugin packages to have TypeScript types. I intend to have type-safe ESLint flat config in my projects, and many ESLint plugins currently don't publish types for their exports, because before flat config it was ESLint that was importing the modules, instead of consumers in their projects. Some plugin packages that export types are broken for TypeScript in nodenext
mode, which should be the gold standard for determining the status of TypeScript support since it's the only mode that actually reflects how CJS and ESM interop in current Node.js versions (as well as modern bundlers) actually works.
It would be great if the tracking table in this issue description were to have another status column for TypeScript support.
Thanks a great idea @jaydenseric, adding now! (sorry for the delay)
I'm also adding @types/eslint
, as that will need to be updated to have the new types too.
Hi, I created a PR to support flat config at eslint-plugin-mocha repository:
lo1tuma/eslint-plugin-mocha#349
EDIT: The PR was merged and shipped as eslint-plugin-mocha 10.4.0.
Would be good to get eslint-community/eslint-utils#183 / eslint-community/eslint-utils#186 in there as well, as it may be a blocker for quite a few other modules
Can eslint-plugin-i
be added to the list? With 136k weekly downloads, I think it easily qualifies as popular. It being a soft for of eslint-plugin-import
likely means it won't gain support before it, but it is good to track, I opened un-ts/eslint-plugin-import-x#29 there.
What's the officially suggested peer-dependency range for someone who wants to support eg. ESLint 8 and later, including pre-releases of ESLint 9?
I think the algorithm for npm is what causes some struggles with some here: npm/rfcs#397 (comment)
And as I wrote in eslint-community/eslint-utils#183 (comment), I think ^8.0.0 || >=9.0.0-0
may be the solution, but it may inadvertently cause some end-users to get the pre-release of ESLint 9 installed indirectly if one ships ^8.0.0 || >=9.0.0-0
as the peer dependency range of a stable module.
Can
eslint-plugin-i
be added to the list? With 136k weekly downloads, I think it easily qualifies as popular. It being a soft for ofeslint-plugin-import
likely means it won't gain support before it, but it is good to track, I opened un-es/eslint-plugin-import-x#29 there.
FYI, that plugin was renamed to eslint-plugin-import-x
and flat config support will come in that package.
Could you please add eslint-plugin-jest-formatting
(500k weekly downloads)? I opened an issue there: dangreenisrael/eslint-plugin-jest-formatting#122.
Nuxt is working on it here: https://github.com/nuxt/eslint / https://eslint.nuxt.com/
ESLint plugin yml already supports flat config: https://github.com/ota-meshi/eslint-plugin-yml
ESLint plugin vue i18n does not support flat config yet: intlify/eslint-plugin-vue-i18n#484
Submitted the webdriverio/webdriverio#12547 issue and prepared a PR webdriverio/webdriverio#12580
I hope the PR is a backward-compatible with both: an old configuration system and flat configs, but I can't say for sure about an old one because it's my very first contribution to a something related to ESLint. Would be great to get some external review.
I'm working on it for vue a11y: vue-a11y/eslint-plugin-vuejs-accessibility#1073
Are there any guidelines on how to write a .d.ts file for an ESLint rule, and how to check that it works?
In my case (eslint-plugin-simple-import-sort), the plugin is written in pure JS and works with both eslintrc and flat config. I know that I need export = something
, but I donβt know exactly what something
needs to be to be helpful, and how precise it needs to be.
(Edit: I received a PR shortly after posting this: lydell/eslint-plugin-simple-import-sort#164)
I used eslint version 8 with ...compat.extends('airbnb'),
and all works as excepted. But yesterday realeased 9 version of eslint. And now i see errors in console
Error: Failed to load config "airbnb" to extend from.
Maybe somone faced with this problem also?
it'd be nice to add https://github.com/sarbbottam/eslint-find-rules to the list.
For Sublime Text, https://github.com/polygonplanet/sublime-text-eslint is listed but there is also the much more popular https://github.com/SublimeLinter/SublimeLinter-eslint plugin. It does appear to work fine with flat config at first glance.
Would it be possible to also track eslint 9 compatibility in this list ?
- mocha is marked as completed, however according to lo1tuma/eslint-plugin-mocha#352 compatibility support is not in the current version eslint-plugin-mocha@10.4.1
BTW: Great to see a consolidated compatibility list! ππ»
- mocha eslint-plugin-mocha@10.4.2 has fixed compatibility issues with ESLint 9.
I have multiple ESLint plugins I created. Is there an easy way to just convert them to flat config?
https://github.com/nirtamir2/eslint-plugin-sort-export-all (over 10k downloads per week)
https://github.com/nirtamir2/eslint-plugin-i18n-prefix
https://github.com/nirtamir2/eslint-plugin-default-import-name
https://github.com/nirtamir2/eslint-plugin-no-typeof-window-undefined
I'm open to contributions if someone wants to help me π
I wonder how difficult is it to convert my eslint config to support flag config https://www.github.com/nirtamir2/eslint-config-nirtamir2
@JoshuaKGoldberg This is one of the most impressive feats I've seen on GitHub and I applaud your efforts. Many thanks.
Also, Iβd like to echo what @vincentbriglia said about adding ESLint 9 compatibility to the list. Itβs great if they decide to support the flat config, but if their peerDependency
stops at 8.x
, then it's an issue to be addressed.
Are there any guidelines on how to write a .d.ts file for an ESLint rule, and how to check that it works?
Good question. I think the tricky bit is that it changes based on what parser & types system the plugin is built on: vanilla JS, typescript-eslint TS, jsonc-eslint-parser JSON, etc. I know docs for the TS side are tracked in typescript-eslint/typescript-eslint#5444; the others would be separate issues I think.
much more popular https://github.com/SublimeLinter/SublimeLinter-eslint plugin
TIL! I tried it out locally and it seemed to work. I'm not a Sublime user, so not confident - someone should mention if we're missing something. Thanks!
I have multiple ESLint plugins I created. Is there an easy way to just convert them to flat config?
β¨ https://eslint.org/docs/latest/extend/plugin-migration-flat-config! β¨
For other questions on converting, I'd suggest asking in a separate ESLint asking-for-help format such as the Discord's #help
channel. If there are gaps in docs you think should be filled in then that'd be a separate issue.
ESLint 9
I like that idea. Let me go back and ask the ESLint team about it. To my knowledge, this issue is the first time a tracking table like this one was made.
Would it be possible to add npm eslint-plugin-no-use-extend-native with tracking issue dustinspecker/eslint-plugin-no-use-extend-native#136 ?
@jlarmstrongiv Out of curiosity: is it even maintained? the last version was published ~4 years ago!
@jlarmstrongiv Out of curiosity: is it even maintained? the last version was published ~4 years ago!
It may not be maintained but it sure is popular.
I'm working on it for vue a11y: vue-a11y/eslint-plugin-vuejs-accessibility#1073
I've just merged and release flat support for eslint-plugin-vuejs-accessibility in version 2.3.0
.
Would it be possible to also track eslint 9 compatibility in this list ?
Voila: #18391. Good idea!
Note that #18391 only tracks plugins that already have flat config support. I didn't want that table to become a superset of this one - that'd be harder to read and also harder to maintain. So that table has a much higher percentage of β s than this one. π
I also added a small note to the bottom of each post: these aren't automatically updated. I just update them every time I'm pinged, or when I have spare minutes a few times a week. If something gets out-of-date for more than a couple of days, please do post a note here and we'll get that updated. π
It's worth noting that since #18087 is a blocker for the import plugin, it's also a blocker for the airbnb and airbnb-base configs (the latter of which isn't in the table yet), and for the react and jsx-a11y plugins.
@ljharb just to clarify: why does it also block the react
and jsx-a11y
plugins?
oh actually you're right, that's about blocking v9 support, not about flat config.
@controversial yes, but eslint hasn't shipped that yet, and seemingly won't until i'm able to confirm that approach would work.
@ljharb oh yeah - that makes sense. so to my understanding, eslint-plugin-import
would need to:
- develop a proof-of-concept update off of eslintβs
issue18087-poc
branch - confirm it works
- then, wait for eslint to ship a version of the API from
issue18087-poc
in 9.x - finally, ship an
eslint-plugin-import
update requiring eslint@^9.x ?
Yes, except for the last step - i'm not shipping any breaking changes, so v9 support would be additive.
@JoshuaKGoldberg I think you might have the wrong issue for eslint-plugin-import-x
. un-ts/eslint-plugin-import-x#29 is still open and unresolved. The issues you have in the list are for v9 support.
eslint-plugin-sonar v1.0.3 now supports the flat config
eslint-plugin-tailwindcss v3.16.0
now supports flat config and v9, according to https://github.com/francoismassart/eslint-plugin-tailwindcss/releases/tag/v3.16.0, francoismassart/eslint-plugin-tailwindcss#330.
eslint-plugin-cypress supports ESLint Flat config in
This is an enhancement compared to v3.2.0 which supported the ESLint v9 API and relied on the Flat config compatibility utility to support Flat configs.
angular-eslint v18 (released yesteday) supports flat config, I'm not sure why the table currently states and links to v16. Please can you update @JoshuaKGoldberg?
Tracking links For Sublime Text:
Please add TanStack/query#7544 for tracking Flat Config Support