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

Add new option flatConfigFile #239

Closed
ricardogobbosouza opened this issue Dec 23, 2023 · 2 comments
Closed

Add new option flatConfigFile #239

ricardogobbosouza opened this issue Dec 23, 2023 · 2 comments

Comments

@ricardogobbosouza
Copy link
Collaborator

ricardogobbosouza commented Dec 23, 2023

Waiting #238
Simplify the use of flat config

// before
const ESLintPlugin = require('eslint-webpack-plugin');

module.exports = {
  // ...
  plugins: [new ESLintPlugin({
    configType: 'flat',
    eslintPath: 'eslint/use-at-your-own-risk',
    overrideConfigFile: 'flat-config.js',
  })],
  // ...
};
// after
const ESLintPlugin = require('eslint-webpack-plugin');

module.exports = {
  // ...
  plugins: [new ESLintPlugin({
    flatConfigFile: 'flat-config.js',
  })],
  // ...
};
  1. Create a flatConfigFile option that will define:
  • The eslintPath as eslint/use-at-your-own-risk
  • The configType as flat
  • The overrideConfigFile as flatConfigFile
  1. Automatically define flatConfigFile if there is an eslint.config.js file in the project root
  2. Add a section in the readme about flatConfigFile
@onigoetz
Copy link
Contributor

Hi @ricardogobbosouza

I have the impression that the addition of this option will become a problem once ESLint 9 is released

My current understanding, as per these blog posts:

The ESLint class will now be equivalent to the FlatESLint class in v8.x. With the exception of a few options, this should mostly be a transparent change.

So that means that the import that's done right now will suddenly handle flatConfig instead of eslintrc-style config

So maybe there is something to do with imports to auto-detect ESLint's version or imports to differentiate which one we have loaded? I expect this part of the logic to become more complicated once ESLint 9 is released

@alexander-akait
Copy link
Member

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

No branches or pull requests

3 participants