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

eslint.config.js support #3217

Open
dalisoft opened this issue May 9, 2024 · 10 comments
Open

eslint.config.js support #3217

dalisoft opened this issue May 9, 2024 · 10 comments
Assignees
Labels
C-bug Category - Bug

Comments

@dalisoft
Copy link

dalisoft commented May 9, 2024

Currently eslint.config.js is not supported as tested by bunx oxlint . --import-plugin --config=eslint.config.js

And got

❯ bunx oxlint . --import-plugin --config=eslint.config.js

  × Failed to parse jsonc file "eslint.config.js"

Invalid Options: Failed to parse configuration file.
@Boshen
Copy link
Member

Boshen commented May 14, 2024

The error message is leading, it should be something like "we do not support files other than json".

@dalisoft
Copy link
Author

@Boshen yes, but support for eslint.config.js would be cool

@DonIsaac
Copy link
Collaborator

@dalisoft please refer to this statement @Boshen made: #2214 (comment)

@AndreaPontrandolfo
Copy link

This is actually a HUGE issue because now the new "Flat Config" format (the eslint.config.js) is the default in ESLint (and ALL the other formats are now deprecated, they just don't work anymore) and not supporting it would mean that you give up on the OXLint <> ESLint interoperability. At which point i don't even know why you are developing the --import-plugin, if nobody can use OXLint and ESLint togheter.

@Boshen
Copy link
Member

Boshen commented May 19, 2024

This is actually a HUGE issue because now the new "Flat Config" format (the eslint.config.js) is the default in ESLint (and ALL the other formats are now deprecated, they just don't work anymore) and not supporting it would mean that you give up on the OXLint <> ESLint interoperability. At which point i don't even know why you are developing the --import-plugin, if nobody can use OXLint and ESLint togheter.

Do you have a rough idea of how to make it work? i.e. load eslint and get all the information we need?

@AndreaPontrandolfo
Copy link

You mean this?
I guess everything can be found here.

@DonIsaac
Copy link
Collaborator

@Boshen if you'd like I can put something together

@milesj
Copy link
Collaborator

milesj commented May 20, 2024

You can't load and evaluate JavaScript from Rust, that's the crux of the problem.

To make this even remotely work, you would need to execute a node process that loads eslint, resolves the config, and outputs its information as JSON (is this even possible?). With this, you're now coupling node's overhead to Rust, and you lose some performance wins.

@Boshen
Copy link
Member

Boshen commented May 21, 2024

You can't load and evaluate JavaScript from Rust, that's the crux of the problem.

To make this even remotely work, you would need to execute a node process that loads eslint, resolves the config, and outputs its information as JSON (is this even possible?). With this, you're now coupling node's overhead to Rust, and you lose some performance wins.

I'm not worried about the performance impact, I'm worried about the maintenance burden put into this project, as stated in #2214 (comment)

When I was doing research while setting up oxlint, I read almost all ESLint related issues from GitHub, stackoverflow, discord, reddit etc, and 90% of them are configuration issues, and a lot of them are unanswered due to its context and complexity.

@Dunqing
Copy link
Member

Dunqing commented May 24, 2024

Maybe we can use eslint --print-config to do it. This command will output all configurations in JSON format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category - Bug
Projects
None yet
Development

No branches or pull requests

6 participants