-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
113 lines (113 loc) · 3.3 KB
/
Copy path.eslintrc.js
File metadata and controls
113 lines (113 loc) · 3.3 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
'jest/globals': true,
},
extends: [
'next/core-web-vitals',
'eslint:recommended',
'plugin:import/recommended',
'next',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
overrides: [
{
files: ["storybook/**/**/**/*.stories.@(js|jsx|ts|tsx)"],
rules: {
"import/no-anonymous-default-export": "off"
}
},
{
files: ['src/**/**/**/*.@(js|jsx|ts|tsx)'],
rules: {
'max-lines': ['error', {'max': 300, 'skipBlankLines': true, 'skipComments': true}],
curly: ['error', 'multi-line'],
'prefer-const': 'error',
'linebreak-style': ['error', 'unix'],
'no-var': 'error',
'no-multi-spaces': 'error',
quotes: ['error', 'single'],
semi: ['error', 'always'],
'prettier/prettier': ['error'],
'react/react-in-jsx-scope': 0,
'@typescript-eslint/no-explicit-any': 'off',
'react/jsx-wrap-multilines': ['error', {
declaration: 'parens-new-line',
assignment: 'parens-new-line',
return: 'parens-new-line',
arrow: 'parens-new-line',
condition: 'parens-new-line',
logical: 'parens-new-line',
prop: 'parens-new-line'
}], // This rule enforces consistent line breaks inside jsx
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],
'no-unused-vars': ['error'],
'import/no-duplicates': ['error'],
'array-bracket-spacing': ['error', 'never'],
'comma-spacing': ['error', { before: false, after: true }],
'eol-last': ['error', 'always'],
'no-multi-spaces': 'error',
'no-nested-ternary': 'error',
'no-param-reassign': ['error', { props: false }],
'no-restricted-syntax': ['error', 'WithStatement'],
'no-unneeded-ternary': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'warn',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'object-curly-spacing': ['error', 'always'],
'react/jsx-wrap-multilines': ['error', {'declaration': false, 'assignment': false}]
},
plugins: [
'react',
'@typescript-eslint',
'prettier',
'import',
'jest',
'local-rules'
],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
{
files: ['**/__mock__/**/*.mock.@(js|jsx|ts|tsx)'],
rules: {
'max-lines': 'off',
},
}
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
'prettier',
'import',
'jest',
],
rules: {
indent: 'off',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'prettier/prettier': ['error'],
'react/react-in-jsx-scope': 0,
'import/no-unresolved': ['error', {'ignore': [ '\.svg' ] }],
},
};