Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📈 Tracking: Flat Config support #18093

Open
14 of 37 tasks
JoshuaKGoldberg opened this issue Feb 8, 2024 · 38 comments
Open
14 of 37 tasks

📈 Tracking: Flat Config support #18093

JoshuaKGoldberg opened this issue Feb 8, 2024 · 38 comments
Assignees

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Feb 8, 2024

👋 Hi all! With flat config stabilized and ESLint v9 on the horizon, 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 v16.0.0
astro eslint-plugin-astro#241 eslint-plugin-astro#324 0.32.0
compat 🏗️ eslint-plugin-compat/#603 eslint-plugin-compat/#609
cypress 📝 cypress-io/eslint-plugin-cypress#146
deprecation 🏗️ eslint-plugin-deprecation#78 eslint-plugin-deprecation#79
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
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
storybook 📝 eslint-plugin-storybook#135
stylistic 0.0.0
svelte eslint-plugin-svelte#467 2.28.0
tailwindcss 📝 eslint-plugin-tailwindcss#280
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
prettier eslint-config-prettier#231 eslint-config-prettier#261 9.0.0
standard 📦 🛑 eslint-config-standard#351 3d1284 standard#1948
standard-with-typescript 📝 eslint-config-standard-with-typescript#1299
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! ❤️

@lydell
Copy link

lydell commented Feb 8, 2024

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?

@bradzacher
Copy link
Contributor

bradzacher commented Feb 8, 2024

@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
Copy link

dasa commented Feb 9, 2024

This is great! Here's a couple more:

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

@aladdin-add
Copy link
Member

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

@jaydenseric
Copy link

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

@JoshuaKGoldberg
Copy link
Contributor Author

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.

@rhysd
Copy link
Contributor

rhysd commented Mar 7, 2024

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.

@voxpelli
Copy link
Contributor

voxpelli commented Mar 8, 2024

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

@silverwind
Copy link
Contributor

silverwind commented Mar 9, 2024

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.

@voxpelli
Copy link
Contributor

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.

@silverwind
Copy link
Contributor

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.

@vincentbriglia
Copy link

Would it be possible to also track eslint 9 compatibility in this list ?

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link

@nirtamir2
Copy link

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

@philsherry
Copy link

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

@JoshuaKGoldberg
Copy link
Contributor Author

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
Copy link

Would it be possible to add npm eslint-plugin-no-use-extend-native with tracking issue dustinspecker/eslint-plugin-no-use-extend-native#136 ?

@aladdin-add
Copy link
Member

@jlarmstrongiv Out of curiosity: is it even maintained? the last version was published ~4 years ago!

@silverwind
Copy link
Contributor

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

@vhoyer
Copy link

vhoyer commented Apr 18, 2024

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.

@JoshuaKGoldberg
Copy link
Contributor Author

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

@ljharb
Copy link
Sponsor Contributor

ljharb commented Apr 24, 2024

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.

@JoshuaKGoldberg
Copy link
Contributor Author

@ljharb just to clarify: why does it also block the react and jsx-a11y plugins?

@ljharb
Copy link
Sponsor Contributor

ljharb commented Apr 24, 2024

oh actually you're right, that's about blocking v9 support, not about flat config.

@controversial
Copy link

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

@ljharb
Copy link
Sponsor Contributor

ljharb commented Apr 24, 2024

@controversial yes, but eslint hasn't shipped that yet, and seemingly won't until i'm able to confirm that approach would work.

@controversial
Copy link

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

@ljharb
Copy link
Sponsor Contributor

ljharb commented Apr 24, 2024

Yes, except for the last step - i'm not shipping any breaking changes, so v9 support would be additive.

@Logicer16
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Implementing
Development

No branches or pull requests