eslint/eslint

πŸ“ˆ 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
Name Status Types Issue Commit / PR Version Blocker
Editor Extensions
Sublime Text βœ… n/a
VS Code βœ… n/a vscode-eslint#1644 3.0.5
Visual Studio ❓ n/a
Webstorm βœ… n/a WEB-57661 2022.3.2
Plugins
@graphql-eslint πŸ“ graphql-eslint#2178
@nuxt/eslint βœ… βœ… *
@react-native-community πŸ—οΈ eslint-plugin-react-native#333 eslint-plugin-react-native#43959
@typescript-eslint βœ… βœ… typescript-eslint#7694 typescript-eslint#7935 7.0.1
angular βœ… βœ… angular-eslint#1280 angular-eslint#1358 18.0.0
astro βœ… βœ… eslint-plugin-astro#241 eslint-plugin-astro#324 0.32.0
check-file βœ… ❌ eslint-plugin-check-file/#614 4d6725 2.8.0
compat βœ… ❌ eslint-plugin-compat/#603 eslint-plugin-compat/#609 5.0.0-2
cypress βœ… ❌ cypress-io/eslint-plugin-cypress#146 0e434c 3.3.0
deprecation βœ… βœ… eslint-plugin-deprecation#78 eslint-plugin-deprecation#79 3.0.0
ember βœ… ❌ eslint-plugin-ember#2020 11.12.0
es-x βœ… ❌ eslint-plugin-es-x#124 eslint-plugin-es-x#129 7.6.0
eslint-comments βœ… ❌ eslint-plugin-eslint-comments#182 eslint-plugin-eslint-comments#200 4.3.0
eslint-plugin βœ… ❌ eslint-plugin-eslint-plugin#342 eslint-plugin-eslint-plugin#347 5.1.0
functional βœ… βœ… eslint-plugin-functional#776 eslint-plugin-functional#789 6.2.0
import πŸ›‘ eslint-plugin-import#2556 eslint#18087
import-x πŸŒ— βœ… eslint-plugin-import-x#29 eslint-plugin-import-x#61 , eslint-plugin-import-x#62 0.4.2 eslint#18087
jsdoc βœ… βœ… eslint-plugin-jsdoc#1177 46.10.0
jsonc βœ… βœ… eslint-plugin-jsonc#240 eslint-plugin-jsonc#240 2.14.1
jest βœ… ❌ eslint-plugin-jest#1408 eslint-plugin-jest#1505 27.9.0
jest-formatting πŸ“ eslint-plugin-jest-formatting#1408
jsx-expressions πŸ“ eslint-plugin-jsx-expressions#18
jsx-ally πŸ—οΈ eslint-plugin-jsx-a11y#978 eslint-plugin-jsx-a11y#891
standard-with-typescript βœ… βœ… eslint-config-love#1299 eslint-config-love#1555 48.0.0
markdown βœ… ❌ eslint-plugin-markdown#231 eslint-plugin-markdown#232 4.0.1
mocha βœ… ❌ eslint-plugin-mocha#341 eslint-plugin-mocha#349 10.4.0
n βœ… ❌ eslint-plugin-n#89 eslint-plugin-n#95 16.0.0
next πŸ—οΈ next.js#58411 next.js#56181
nx βœ… βœ… nx#18285 nx#18379 16.7.0
perfectionist βœ… ❌ 969ae4 0.6.0
playwright βœ… βœ… eslint-plugin-playwright#168 eslint-plugin-playwright#169 0.17.0
prettier βœ… βœ… eslint-plugin-prettier#591 eslint-plugin-prettier#616 5.1.0
promise πŸ“ eslint-plugin-promise#449
qunit βœ… ❌ eslint-plugin-qunit#443 8.1.0
regexp βœ… βœ… eslint-plugin-regexp#695 eslint-plugin-regexp#702 2.3.0
react-hooks πŸ“ react#28313
react βœ… ❌ eslint-plugin-react#3429 7.32.0
react-native πŸ“ react-native#42996 react-native#42996
security βœ… ❌ eslint-plugin-security#118 2.0.0
simple-import-sort βœ… βœ… eslint-plugin-simple-import-sort#155 11.0.0
solid βœ… βœ… Types: eslint-plugin-solid#128 eslint-plugin-solid#96 0.13.0
sonarjs βœ… βœ… eslint-plugin-sonarjs#403 eslint-plugin-sonarjs#472 1.0.3
storybook πŸ“ eslint-plugin-storybook#135
stylistic βœ… βœ… 0.0.0
svelte βœ… βœ… eslint-plugin-svelte#467 2.28.0
tailwindcss βœ… ❌ eslint-plugin-tailwindcss#280 eslint-plugin-tailwindcss#330 3.16.0
TanStack Query πŸ“ query#7544
testing-library πŸ“ eslint-plugin-testing-library#853
unicorn βœ… ❌ eslint-plugin-unicorn#1885 eslint-plugin-unicorn#1886 50.0.0
vitest βœ… βœ… eslint-plugin-vitest#215 eslint-plugin-vitest#216 0.2.8
vue βœ… ❌ eslint-plugin-vue#1291 eslint-plugin-vue#2319 9.24.0
vue-i18n βœ… ❌ eslint-plugin-vue-i18n#484 eslint-plugin-vue-i18n#487 3.0.0-next.9
vuejs-accessibility βœ… βœ… eslint-plugin-vuejs-accessibility#1073 2.3.0
wdio πŸ“¦ βœ… webdriverio#12547 webdriverio#12679
yml βœ… βœ… eslint-plugin-yml#308 eslint-plugin-vue#311 1.13.1
Shared Configs
airbnb πŸ“ eslint-config-airbnb#2804
airbnb-typescript πŸ“ eslint-config-airbnb-typescript#331
canonical βœ… ❌ eslint-config-canonical#80 43.0.11
prettier βœ… βœ… eslint-config-prettier#231 eslint-config-prettier#261 9.0.0
standard πŸ“¦ πŸ›‘ eslint-config-standard#351 3d1284 standard#1948
Other Tools
@rushstack/eslint-patch πŸ“ n/a rushstack#4372
@types/eslint ❌ n/a
create-config βœ… n/a create-config#51 create-config#81 1.0.0
eslint-find-rules ❌ n/a
eslint-utils πŸ—οΈ n/a eslint-utils#183 eslint-utils#186
xo πŸ“ n/a xo#702

Task list of issues/PRs on projects that didn't have released support yet at time of filing:

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

dasa commented

This is great! Here's a couple more:

  • eslint-plugin-jsdoc: has flat support
  • eslint-plugin-regexp: has an issue

xo does not support it yet: xojs/xo#702

@lydell

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 of eslint-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 ?

BTW: Great to see a consolidated compatibility list! πŸ‘πŸ»

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.

@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.

@ljharb what outcome from #18087 is blocking eslint-plugin-import?

The messages in that issue thread seem to suggest that the resolution would be to proceed without a direct alternative to FileEnumerator, instead using a glob/walk function alongside isFileIgnored/isDirectoryIgnored.

@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-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?

Please add TanStack/query#7544 for tracking Flat Config Support