-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
87 lines (87 loc) · 2.23 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
83
84
85
86
87
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
plugins: ['prettier', 'import'],
extends: [
'next/core-web-vitals',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
ignorePatterns: ['node_modules'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'import/no-unresolved': 'error',
'prettier/prettier': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/no-children-prop': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unstable-nested-components': 'off',
eqeqeq: 'error',
'import/order': [
'WARN',
{
pathGroups: [
{
pattern: '@/**',
group: 'external',
position: 'after',
},
],
groups: [
'builtin',
'external',
'internal',
'unknown',
'parent',
'sibling',
'index',
'object',
'type',
],
'newlines-between': 'always',
},
],
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['../*'],
message: 'Usage of relative parent imports is not allowed.',
},
],
},
],
},
settings: {
'import/extensions': ['.js', '.jsx', '.tsx', '.ts'],
'import/resolver': {
typescript: {},
},
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'no-shadow': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
},
},
],
};