-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
93 lines (93 loc) · 2.29 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
88
89
90
91
92
93
module.exports = {
env: {
browser: true,
node: true,
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
tsconfigRootDir: './',
project: ['./tsconfig.json'],
},
extends: [
'next/core-web-vitals',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
plugins: ['@typescript-eslint', 'import', 'react', 'react-hooks'],
rules: {
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: false },
],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'@typescript-eslint/naming-convention': [
'error',
{
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
selector: 'variable',
},
{
format: ['camelCase', 'PascalCase'],
selector: 'function',
},
{
format: ['PascalCase'],
selector: 'typeLike',
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
radix: 'error',
'react/function-component-definition': [
'error',
{
namedComponents: 'arrow-function',
},
],
'react/jsx-props-no-spreading': 'off',
'react/jsx-max-props-per-line': [
'error',
{ maximum: 1, when: 'multiline' },
],
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
shorthandFirst: true,
multiline: 'last',
reservedFirst: true,
},
],
'react/no-unknown-property': ['error', { ignore: ['css'] }],
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/self-closing-comp': 'error',
'spaced-comment': 'warn',
},
overrides: [
{
files: ['**/*.stories.*'],
rules: {
'import/no-anonymous-default-export': 'off',
},
},
],
settings: {
react: {
version: 'detect',
},
},
};