-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
38 lines (34 loc) · 1.1 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import pluginNext from '@next/eslint-plugin-next'
import parser from '@typescript-eslint/parser' // optional
import eslintTypescript from '@typescript-eslint/eslint-plugin'
export default [
{
name: 'ESLint Config - nextjs',
languageOptions: {
parser, // optional
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true
},
tsConfigRootDir: import.meta.dirname
}
},
plugins: {
'@next/next': pluginNext,
'@typescript-eslint': eslintTypescript
},
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
// TypeScript rules
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], // Allow unused vars starting with _
'@typescript-eslint/no-explicit-any': 'warn', // Discourage `any` usage
'prefer-const': 'warn',
eqeqeq: ['warn', 'always'], // Use === and !==
'no-console': 'warn' // Discourage console.log in production
}
}
]