Migrate to ESLint 9 flat config (#239)
* eslint 9 * fix lint errors * update package-lock.json
This commit is contained in:
1 parent
d9d8bbebe1
commit
a4b3068850
9 files changed
+5830
-5854
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import { dirname } from "path"
|
||||
import { fileURLToPath } from "url"
|
||||
import { FlatCompat } from "@eslint/eslintrc"
|
||||
import { defineConfig, globalIgnores } from "eslint/config"
|
||||
import globals from "globals"
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
})
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores([
|
||||
".next/**",
|
||||
"out/**",
|
||||
"build/**",
|
||||
"modules/**",
|
||||
"public/static/**",
|
||||
"next-env.d.ts",
|
||||
]),
|
||||
...compat.extends("next/core-web-vitals"),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
semi: ["error", "never"],
|
||||
indent: ["warn", 4],
|
||||
quotes: ["warn", "double"],
|
||||
"eol-last": ["error", "always"],
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"no-tabs": "error",
|
||||
"no-var": "error",
|
||||
"space-before-function-paren": "off",
|
||||
"react/jsx-uses-react": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
},
|
||||
},
|
||||
])
|
||||
Reference in new issue
Block a user