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

Recommendations Needed for Using FlatCompat in CommonJS eslint Configs #133

Closed
rostislav-simonik opened this issue Oct 31, 2023 · 2 comments · Fixed by #134 or #131
Closed

Recommendations Needed for Using FlatCompat in CommonJS eslint Configs #133

rostislav-simonik opened this issue Oct 31, 2023 · 2 comments · Fixed by #134 or #131

Comments

@rostislav-simonik
Copy link

We are currently working on migrating our eslint configs to flat configs, but are facing a high level of complexity in the process. I'm seeking recommendations or best practices on how to effectively use FlatCompat in CommonJS eslint configs.

Utilization of FlatCompat in CommonJS:

  • How can FlatCompat be effectively used within CommonJS eslint configs?
  • Are there any best practices or recommended approaches to facilitate this integration?

Support for CommonJS Projects:

  • Has consideration been given to publishing the FlatCompat utility with support specifically for CommonJS projects?

Your insights and advice regarding these queries will be greatly valuable and appreciated.

@nzakas
Copy link
Member

nzakas commented Nov 1, 2023

In CommonJS, you can just use require():

const { FlatCompat } = require("@eslint/eslintrc");

Otherwise, you can use the example in the README mostly as-is. We can probably update that with a CommonJS example to avoid confusion.

@rostislav-simonik
Copy link
Author

Thanks, yes, that was one of the things that was crucial to proceed further. Now, we are battling how to integrate eslint-config-standard-with-typescript and other configs using FlatCompat. There are a few concerns about that here typescript-eslint/typescript-eslint#7694, but it looks promising on our side so far.

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

Successfully merging a pull request may close this issue.

2 participants