-
-
Notifications
You must be signed in to change notification settings - Fork 675
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 for "Flat Config" #1291
Comments
Now that this repo is linting itself using flat config, what would be the next steps? Do you have a plan for exporting flat configs from this plugin? |
I think the next step is to exporting the flat config from this plugin 👍 |
Cool! Would you do that in addition to the eslintrc configs? Or as a replacement? (Trying to figure out what to recommend to other plugins, too.) |
just to make sure because I just ran into an error while setting this up with flat config from eslint: Flatconfig or |
I haven't tried it yet, but you should be able to use const { FlatCompat } = require('@eslint/eslintrc')
const eslintrc = new FlatCompat({
baseDirectory: __dirname
})
module.exports = [
// …
...eslintrc.plugins('vue'),
...eslintrc.extends('plugin:vue/recommended'),
// …
] (similar to how plugins/configs in our own ESLint config were migrated in #2226) |
yeah, true that works, thanks! On npmjs it says
which I thought meant to not use it in my project. Btw I am using import { FlatCompat } from '@eslint/eslintrc';
import globals from 'globals';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const eslintrc = new FlatCompat({
baseDirectory: __dirname
})
export default [
{
ignores: ["node_modules", "coverage", ".nyc_output", "dist"]
},
...eslintrc.plugins('vue', 'prettier'),
...eslintrc.extends('plugin:vue/vue3-recommended', 'prettier'),
{
files: ['src/**/*.js', 'src/**/*.vue'],
languageOptions: {
globals: {
...globals.browser,
},
parserOptions: {
ecmaVersion: 2022,
sourceType: "module"
}
},
rules: {
...
}
}
]; |
HI @Havrin , I'm currently facing this error after using your code
|
Any news about supporting flat config? It's been 3 years :( This package is last thing we need to ditch CJS and go 100% ESM in a project. |
@conradhale started working on a solution to this issue in #2319. It would be great if anyone reading this could test that implementation and review the PR. You can install the development version using the following command:
Please also mention any documentation updates you would like to see. |
This comment has been minimized.
This comment has been minimized.
Thanks for sharing that config! Just a few remarks:
This code worked for me https://gist.github.com/Robin-Hoodie/ad242ecb6d92e33cb21d5869f01dd63b |
The problem you want to solve.
We need to check for compatibility with ESLint's new Flat Config.
Your take on the correct solution to problem.
When
@eslint/eslintrc
is ready to use, check compatibility.Modify the sharable configuration as needed.
Additional context
The text was updated successfully, but these errors were encountered: