-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy patheslint.config.mjs
More file actions
96 lines (89 loc) · 1.98 KB
/
eslint.config.mjs
File metadata and controls
96 lines (89 loc) · 1.98 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import path from 'path';
import { FlatCompat } from '@eslint/eslintrc';
// Reuse the existing .eslintrc.js settings via the compatibility helper, but
// constrain what gets linted and reintroduce ignores (ESLint v9 no longer has
// default ignore patterns).
const compat = new FlatCompat({
baseDirectory: path.resolve(),
});
const ignores = [
'**/node_modules/**',
'**/.next/**',
'**/out/**',
'**/coverage/**',
'**/dist/**',
'**/.turbo/**',
'**/.git/**',
'**/public/**',
];
export default [
{ ignores },
...compat.config({
extends: ['next/core-web-vitals'],
root: true,
env: {
browser: true,
es2022: true,
node: true,
jest: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
// TypeScript specific rules (using ESLint equivalents)
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
// React specific rules
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react-hooks/exhaustive-deps': 'warn',
// General rules
'no-console': 'warn',
'no-debugger': 'error',
'prefer-const': 'error',
'no-var': 'error',
// Import rules
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
},
],
},
overrides: [
{
files: ['**/__tests__/**/*', '**/*.test.*', '**/*.spec.*'],
env: {
jest: true,
},
rules: {
'no-unused-vars': 'off',
'no-console': 'off',
},
},
{
files: ['**/*.config.js', '**/*.config.ts'],
rules: {
'no-var': 'off',
},
},
],
settings: {
react: {
version: 'detect',
},
},
}),
];