Replies: 10 comments 6 replies
-
It's not step-by-step, but all important points should be covered by the Migrate to v9.x guide: |
Beta Was this translation helpful? Give feedback.
-
As for the VS Code ESLint extension, v3 will automatically detect flat config (https://github.com/microsoft/vscode-eslint/releases/tag/3.0.1-alpha.1). With v2, you need to set {
"eslint.experimental.useFlatConfig": true
}
|
Beta Was this translation helpful? Give feedback.
-
Is there a complete example of |
Beta Was this translation helpful? Give feedback.
-
For reference, Embrace the Future: Navigating the New Flat Configuration of ESLint seems like a good start. |
Beta Was this translation helpful? Give feedback.
-
I tried |
Beta Was this translation helpful? Give feedback.
-
eslint@8.57.0 I get the following error.
|
Beta Was this translation helpful? Give feedback.
-
Tested eslint@8.57.0
Installed & tested eslint@9.0.0-beta.2
package.jsonAdded |
Beta Was this translation helpful? Give feedback.
-
const { FlatCompat } = require("@eslint/eslintrc");
const js = require("@eslint/js");
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname, // optional
recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended"
allConfig: js.configs.all,
});
module.exports = [
...compat.config({
env: {
browser: true,
es2021: true,
node: true,
},
ignorePatterns: [
"**/*.log",
"**/.DS_Store",
"*.",
".vscode/settings.json",
".history",
".yarn",
"bazel-*",
"bazel-bin",
"bazel-out",
"bazel-qwik",
"bazel-testlogs",
"dist",
"dist-dev",
"lib",
"lib-types",
"etc",
"external",
"node_modules",
"temp",
"tsc-out",
"tsdoc-metadata.json",
"target",
"output",
"rollup.config.js",
"build",
".cache",
".vscode",
".rollup.cache",
"dist",
"tsconfig.tsbuildinfo",
"vite.config.ts",
"*.spec.tsx",
"*.spec.ts",
".netlify",
"pnpm-lock.yaml",
"package-lock.json",
"yarn.lock",
"server",
],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:qwik/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
ecmaVersion: 2021,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"prefer-spread": "off",
"no-case-declarations": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-unnecessary-condition": "warn",
},
})
]; Error: Error while loading rule 'qwik/valid-lexical-scope': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser I will get this error |
Beta Was this translation helpful? Give feedback.
-
thank you for making eslint more complicated, unusable, it motivates us to move to Biomes after spending 8 hours dealing with errors everywhere in the new config file, these sad after having used eslint for 7 years! |
Beta Was this translation helpful? Give feedback.
-
ESLint 9 is a weird update that definitely has some problems, which will hopefully be resolved in the future |
Beta Was this translation helpful? Give feedback.
-
I have seen Configuration Migration Guide.
Is there an step by step guide for ESLint 9 (beta) installation?
(e.g. on Linux with VS Code & VS Code ESLint extension)
.eslintrc.json
rules toeslint.config.js
Here is a snippet of
.eslintrc.json
Beta Was this translation helpful? Give feedback.
All reactions