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

Support of new eslint flat config #2804

Open
OlivierZal opened this issue Aug 6, 2023 · 24 comments
Open

Support of new eslint flat config #2804

OlivierZal opened this issue Aug 6, 2023 · 24 comments

Comments

@OlivierZal
Copy link

Hi,

eslint.config.js should be added in

'**/.eslintrc.js' // eslint config
in order to support new eslint flat config.

Thanks!

@ljharb
Copy link
Collaborator

ljharb commented Aug 7, 2023

sadly yes, that's true.

@OlivierZal
Copy link
Author

I can do the PR if you want, is there a release branch?

@ljharb
Copy link
Collaborator

ljharb commented Aug 8, 2023

Actually we may need to wait until all of our peer deps support flat config. If that’s already working, then a PR to the default branch is fine.

@Krushna-Nanda
Copy link

how should i contribute , where to start

@OlivierZal
Copy link
Author

OlivierZal commented Aug 24, 2023

@ljharb, I don't know the exact process on this project, but here's a PR from a fork: https://github.com/airbnb/javascript/pull/2818/files

@filiptammergard
Copy link

filiptammergard commented Oct 27, 2023

A PR for adding eslint.config.js is up: #2849

You can already use flat config, even when using plugins and configs that don't yet support it, by using ...compat: https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config Many project already do this.

I don't think we need to wait for full flat config support to allow importing dev dependencies from flat config files.

@sergeushenecz
Copy link

sergeushenecz commented Apr 6, 2024

After upgrade to eslint 9.0.0. now i see error
I used ...compat.extends('airbnb'), and all was ok.
But now i see
Error: Failed to load config "airbnb" to extend from.
Maybe someone know how does it fix?

@OlivierZal

This comment was marked as off-topic.

@sergeushenecz
Copy link

is this library not suported ?

@OlivierZal
Copy link
Author

Every config needs to be updated to support new v9 eslint API, which has breaking changes.

Since v9 has been released yesterday, we probably need to wait for configs’ compatibility (see eslint/typescript, which has a dedicated issue with thread about it and tracking).

@ljharb
Copy link
Collaborator

ljharb commented Apr 6, 2024

Correct; just like with every eslint major, all the plugins this config depends on have to support it before we can.

sir-gon pushed a commit to sir-gon/algorithm-exercises-js that referenced this issue Apr 15, 2024
@adrian-gierakowski
Copy link

adrian-gierakowski commented Apr 27, 2024

For reference, tracking issues for plugins which need to be resolved first:

import-js/eslint-plugin-import#2556

jsx-eslint/eslint-plugin-react#3699
jsx-eslint/eslint-plugin-react#3685

jsx-eslint/eslint-plugin-jsx-a11y#978

@ljharb have I missed anything?

@ljharb
Copy link
Collaborator

ljharb commented Apr 27, 2024

eslint-find-rules, as well.

@iserdmi
Copy link

iserdmi commented May 18, 2024

Hello! Have we got any expectation when approximately airbnb flatconfig will be ready? Some days, weeks, or months?

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2024

@iserdmi nope. in the past it's taken multiple months to support a new eslint major, but this one is more disruptive and difficult to migrate to, so it might take longer.

sir-gon pushed a commit to sir-gon/algorithm-exercises-js that referenced this issue May 24, 2024
vbojilova referenced this issue in impactoss/impactoss-client Jun 25, 2024
@NishargShah

This comment was marked as spam.

@aayushkhosla

This comment was marked as spam.

@pierluigilenoci

This comment was marked as spam.

@ljharb

This comment was marked as resolved.

@efoken
Copy link

efoken commented Nov 9, 2024

@ljharb I think this issue is only about adding eslint.config.js inside import/no-extraneous-dependencies and not about implementing flat config. I am already using eslint.config.js with the Airbnb config (with compat) and I had to disable this rule because of that

@ljharb
Copy link
Collaborator

ljharb commented Nov 9, 2024

@efoken you shouldn't be using flat config with this plugin at all until we actually support it.

@efoken
Copy link

efoken commented Nov 9, 2024

@ljharb as long as people use ESLint 8 with flat config and use the Airbnb config with compat there isn't any problem, everything works perfect 😉

@farski
Copy link

farski commented Dec 2, 2024

Sorry if this is all very obvious, and I'm just not understanding it. It seems like there are several possible (theoretical) scenarios:

  1. Using eslint-config-airbnb ESLint 8 with legacy config
  2. Using eslint-config-airbnb ESLint 8 with flat config via FlatCompat
  3. Using eslint-config-airbnb ESLint 8 with flat config (no FlatCompat)
  4. Using eslint-config-airbnb ESLint 9 with legacy config (ESLINT_USE_FLAT_CONFIG=false)
  5. Using eslint-config-airbnb ESLint 9 with flat config via FlatCompat
  6. Using eslint-config-airbnb ESLint 9 with flat config (no FlatCompat)

I believe the ultimate goal is № 6. Based on the @efoken's comment above, it seems like № 3 also works. Is there a benefit to switching to flat config on ESLint 8, other than a slightly smoother upgrade to ESLint 9 down the road? And is it true that neither № 4 or № 5 work?

@ljharb
Copy link
Collaborator

ljharb commented Dec 2, 2024

1 is already possible, obviously.

2 and 5 might work, but neither eslint nor myself will likely be able to effectively support you, so you're kind of on your own with those.

This issue tracks number 3 (and unblocks 6, once 4 is achievable). Number 4 (and thus 6) is tracked in #2961.

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

No branches or pull requests

13 participants