1- import { defineConfig } from "eslint/config"
2- import typescriptEslint from "@typescript-eslint/eslint-plugin"
3- import tsParser from "@typescript-eslint/parser"
4- import path from "node:path"
5- import { fileURLToPath } from "node:url"
61import js from "@eslint/js"
7- import { FlatCompat } from "@eslint/eslintrc"
2+ import nextCoreWebVitals from "eslint-config-next/core-web-vitals"
3+ import tseslint from "typescript-eslint"
84
9- const __filename = fileURLToPath ( import . meta. url )
10- const __dirname = path . dirname ( __filename )
11- const compat = new FlatCompat ( {
12- baseDirectory : __dirname ,
13- recommendedConfig : js . configs . recommended ,
14- allConfig : js . configs . all
15- } )
16-
17- export default defineConfig ( [
5+ const config = [
6+ ...nextCoreWebVitals ,
7+ js . configs . recommended ,
8+ ...tseslint . configs . recommended ,
189 {
1910 ignores : [ "next-env.d.ts" , ".next" ] ,
20- } ,
21- {
22- extends : [
23- ...compat . extends ( "next/core-web-vitals" ) ,
24- ...compat . extends ( "eslint:recommended" ) ,
25- ...compat . extends ( "plugin:@typescript-eslint/recommended" )
26- ] ,
27-
28- plugins : {
29- "@typescript-eslint" : typescriptEslint ,
30- } ,
31-
32- languageOptions : {
33- parser : tsParser ,
34- } ,
35-
3611 rules : {
3712 "array-callback-return" : [ "error" ] ,
3813 "no-await-in-loop" : [ "error" ] ,
@@ -46,10 +21,11 @@ export default defineConfig([
4621 "no-unreachable-loop" : [ "error" ] ,
4722 "no-unused-private-class-members" : [ "error" ] ,
4823 "require-atomic-updates" : [ "error" ] ,
49-
5024 "@typescript-eslint/no-unused-vars" : [ "error" , {
5125 argsIgnorePattern : "^_" ,
5226 } ] ,
5327 } ,
5428 }
55- ] )
29+ ]
30+
31+ export default config
0 commit comments