-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Provide support for eslint 9's flat configuration #232
Comments
You are using |
Thanks. I’ll explore this as a possibility. Short term I’ve downgraded back to eslint 8. |
It looks like this doesn't support eslint 9 yet, I see |
Its releases' changelog doesn't include any content related to ESLint 9, so... |
Bumping this, does anyone know what needs to be fixed to get ESLint support? Happy to help contribute as it's blocking our team's ability to upgrade to ESLint 9 |
@ratherblue: I currently have vue3 + typescript + eslint9, not using vue-eslint-parser though, but I wonder why it is actually needed here. Not sure it helps your case, but here it is: In package.json (extract only):
Here is my
|
@dclause can you try it with type information enabled for |
@sid-6581 Not sure what you ask here:
|
@dclause Thanks! I was able to get it to work eventually, it was a little more complicated by the fact that I'm using pug and I have a monorepo. Here is what I ended up with: import js from "@eslint/js";
import ts from "typescript-eslint";
import vue from "eslint-plugin-vue";
import vuePug from "eslint-plugin-vue-pug";
import vueParser from "vue-eslint-parser";
import stylistic from "@stylistic/eslint-plugin";
export default ts.config(
{
files: ["**/*.js", "**/*.ts", "**/*.vue"],
},
{
ignores: ["**/dist/*", "**/wwwroot/*", "**/api.ts", "**/bin/*", "**/obj/*"],
},
js.configs.recommended,
stylistic.configs["recommended-flat"],
...ts.configs.strictTypeChecked,
...ts.configs.stylisticTypeChecked,
...vue.configs["flat/recommended"],
stylistic.configs["disable-legacy"],
{
languageOptions: {
parser: vueParser,
parserOptions: {
ecmaVersion: "latest",
extraFileExtensions: [".vue"],
parser: ts.parser,
project: ["./tsconfig.json", "./src/FrontEnd.Shared/tsconfig.json"],
sourceType: "module",
templateTokenizer: {
pug: "vue-eslint-parser-template-tokenizer-pug",
},
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"vue-pug": vuePug,
},
rules: { ... }
} |
Some related info that may be helpful: apparently typescript-eslint only supports one set of tsconfig settings per project file. It's a singleton per project file. See typescript-eslint/typescript-eslint#6778 and sveltejs/eslint-plugin-svelte#422. For configs that apply different rules to different sets of files, I'm not sure how to get ESLint to work, where "work" means that I'm getting ESLint errors output for .vue files. Also I'm using Vue 2, if that matters. I've tried to create a bunch of separate tsconfig files to trick ESLint into linting .vue files, but so far this hasn't worked. If anyone does have a config that successfully lints .vue files (especially if you can use different rules for different files), then it'd be great to see that config! |
It is not clear whether vue-eslint-parser supports eslint 9's flat configuration, but the current issue I am running into suggest that flat configuration may not be supported.
I currently have the following
eslint.config.js
:This is currently giving me errors of the type:
Related dependencies:
The text was updated successfully, but these errors were encountered: