-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
82 lines (80 loc) · 2.59 KB
/
.eslintrc.js
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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'],
extends: [
'eslint:recommended',
'next',
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'no-unused-vars': 'off', // Disabling base rule as it's handled by @typescript-eslint/no-unused-vars
'no-console': 'off', // Allow console with warning to identify usage
'@typescript-eslint/explicit-module-boundary-types': 'off', // Disabling requirement for explicit return types on functions
'react/no-unescaped-entities': 'off', // Disable warnings for unescaped entities in JSX
'react/display-name': 'off', // Disable display name rule for React components
'react/jsx-curly-brace-presence': [
'warn',
{ props: 'never', children: 'never' },
], // Enforce no unnecessary curly braces in JSX
"react/no-deprecated": "warn", // Enable warning for deprecated methods in React
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'no-empty': 'off',
'no-fallthrough': 'off',
'react/jsx-key': 'warn',
'react/no-children-prop': 'off',
'no-prototype-builtins': 'warn',
'no-case-declarations': 'warn',
'react-hooks/exhaustive-deps': 'off',
// Disable rule for unused vars but enable warning for unused imports and vars with specific patterns
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'off',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_', // Ignore vars with _ prefix
args: 'after-used',
argsIgnorePattern: '^_', // Ignore args with _ prefix
},
],
// Configuring import sorting
'simple-import-sort/exports': 'warn',
'simple-import-sort/imports': [
'warn',
{
groups: [
['^react$', '^@?\\w', '^\\u0000'],
['^.+\\.s?css$'],
['^@/lib', '^@/hooks'],
['^@/data'],
['^@/components', '^@/container'],
['^@/store'],
['^@/'],
[
'^\\./?$',
'^\\.(?!/?$)',
'^\\.\\./?$',
'^\\.\\.(?!/?$)',
'^\\.\\./\\.\\./?$',
'^\\.\\./\\.\\.(?!/?$)',
'^\\.\\./\\.\\./\\.\\./?$',
'^\\.\\./\\.\\./\\.\\.(?!/?$)',
],
['^@/types'],
['^'],
],
},
],
},
globals: {
React: 'writable', // Updated to 'writable' to reflect correct usage
JSX: true,
},
};