11import eslint from '@eslint/js' ;
22import prettierRecommended from 'eslint-plugin-prettier/recommended' ;
3- import next from " @next/eslint-plugin-next" ;
4- import { fixupConfigRules } from " @eslint/compat" ;
5- import tsEslint from " typescript-eslint" ;
3+ import next from ' @next/eslint-plugin-next' ;
4+ import { fixupConfigRules } from ' @eslint/compat' ;
5+ import tsEslint from ' typescript-eslint' ;
66import { FlatCompat } from '@eslint/eslintrc' ;
77import path from 'path' ;
88import { fileURLToPath } from 'url' ;
@@ -12,7 +12,7 @@ const __filename = fileURLToPath(import.meta.url);
1212const __dirname = path . dirname ( __filename ) ;
1313
1414const compat = new FlatCompat ( {
15- baseDirectory : __dirname , // optional; default: process.cwd()
15+ baseDirectory : __dirname ,
1616} ) ;
1717
1818const tsConfig = (
@@ -21,7 +21,7 @@ const tsConfig = (
2121
2222const nextConfig = (
2323 fixupConfigRules (
24- ( compat . config ( next . configs [ " core-web-vitals" ] ) ) ,
24+ ( compat . config ( next . configs [ ' core-web-vitals' ] ) ) ,
2525 )
2626) ;
2727
@@ -32,16 +32,18 @@ export default [
3232 prettierRecommended ,
3333 {
3434 ignores : [
35- ".*.?(c|m)js" ,
36- "*.setup*.?(c|m)js" ,
37- "*.config*.?(c|m)js" ,
38- "*.d.ts" ,
39- ".turbo/" ,
40- ".git/" ,
41- "build/" ,
42- "dist/" ,
43- "coverage/" ,
44- "node_modules/" ,
35+ '.*.?(c|m)js' ,
36+ '*.setup*.?(c|m)js' ,
37+ '*.config*.?(c|m)js' ,
38+ '*.d.ts' ,
39+ '.turbo/' ,
40+ '.git/' ,
41+ 'build/' ,
42+ 'dist/' ,
43+ 'coverage/' ,
44+ 'node_modules/' ,
45+ '.next/' ,
46+ 'public/' ,
4547 ] ,
4648 } ,
4749 ) ,
@@ -53,11 +55,41 @@ export default [
5355 React : true ,
5456 JSX : true ,
5557 } ,
58+ parserOptions : {
59+ ecmaVersion : 'latest' ,
60+ sourceType : 'module' ,
61+ ecmaFeatures : {
62+ jsx : true ,
63+ } ,
64+ } ,
5665 } ,
5766 rules : {
58- "@typescript-eslint/array-type" : "off" ,
59- "@typescript-eslint/consistent-type-definitions" : "off" ,
60- "@typescript-eslint/no-empty-function" : "off" ,
67+ // TypeScript specific rules
68+ '@typescript-eslint/array-type' : 'off' ,
69+ '@typescript-eslint/consistent-type-definitions' : 'off' ,
70+ '@typescript-eslint/no-empty-function' : 'off' ,
71+ '@typescript-eslint/no-unused-vars' : [ 'warn' , { argsIgnorePattern : '^_' } ] ,
72+ '@typescript-eslint/no-explicit-any' : 'warn' ,
73+ '@typescript-eslint/explicit-function-return-type' : 'off' ,
74+ '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
75+
76+ // React specific rules
77+ 'react/react-in-jsx-scope' : 'off' ,
78+ 'react/prop-types' : 'off' ,
79+ 'react/display-name' : 'off' ,
80+
81+ // Next.js specific rules
82+ '@next/next/no-html-link-for-pages' : 'error' ,
83+ '@next/next/no-img-element' : 'warn' ,
84+ '@next/next/no-unwanted-polyfillio' : 'error' ,
85+
86+ // General rules
87+ 'no-console' : [ 'warn' , { allow : [ 'warn' , 'error' ] } ] ,
88+ 'no-debugger' : 'warn' ,
89+ 'no-duplicate-imports' : 'error' ,
90+ 'no-unused-expressions' : 'error' ,
91+ 'prefer-const' : 'warn' ,
92+ 'no-var' : 'error' ,
6193 } ,
6294 } ,
6395] ;
0 commit comments