1- import { defineConfig } from "eslint/config" ;
2- import next from "eslint-config-next" ;
3- import nextCoreWebVitals from "eslint-config-next/core-web-vitals" ;
41import typescriptEslint from "@typescript-eslint/eslint-plugin" ;
52import tsParser from "@typescript-eslint/parser" ;
6- import path from "node:path" ;
7- import { fileURLToPath } from "node:url" ;
83import js from "@eslint/js" ;
9- import { FlatCompat } from "@eslint/eslintrc " ;
4+ import globals from "globals " ;
105
11- const __filename = fileURLToPath ( import . meta. url ) ;
12- const __dirname = path . dirname ( __filename ) ;
13- const compat = new FlatCompat ( {
14- baseDirectory : __dirname ,
15- recommendedConfig : js . configs . recommended ,
16- allConfig : js . configs . all
17- } ) ;
18-
19- export default defineConfig ( [ {
20- extends : [
21- ...compat . extends ( "plugin:@typescript-eslint/recommended" ) ,
22- ...next ,
23- ...nextCoreWebVitals ,
24- ...compat . extends ( "prettier" )
25- ] ,
26-
27- plugins : {
28- "@typescript-eslint" : typescriptEslint ,
29- } ,
30-
31- languageOptions : {
32- parser : tsParser ,
33- ecmaVersion : 12 ,
34- sourceType : "module" ,
35-
36- parserOptions : {
37- ecmaFeatures : {
38- jsx : true ,
6+ export default [
7+ js . configs . recommended ,
8+ {
9+ files : [ "**/*.{js,jsx,ts,tsx}" ] ,
10+ plugins : {
11+ "@typescript-eslint" : typescriptEslint ,
12+ } ,
13+ languageOptions : {
14+ parser : tsParser ,
15+ ecmaVersion : 12 ,
16+ sourceType : "module" ,
17+ globals : {
18+ ...globals . browser ,
19+ ...globals . node ,
20+ ...globals . es2021 ,
3921 } ,
22+ parserOptions : {
23+ ecmaFeatures : {
24+ jsx : true ,
25+ } ,
26+ } ,
27+ } ,
28+ rules : {
29+ ...typescriptEslint . configs . recommended . rules ,
30+ "@typescript-eslint/no-explicit-any" : "warn" ,
31+ "@typescript-eslint/no-unused-vars" : [ "error" , {
32+ "argsIgnorePattern" : "^_" ,
33+ "varsIgnorePattern" : "^_"
34+ } ] ,
35+ "no-redeclare" : "off" ,
36+ "@typescript-eslint/no-redeclare" : "error" ,
4037 } ,
4138 } ,
42- } ] ) ;
39+ {
40+ ignores : [ ".next/**" , "node_modules/**" , "out/**" , "public/**" ] ,
41+ }
42+ ] ;
0 commit comments