-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
86 lines (86 loc) · 2.61 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: 'detect'
}
},
env: {
browser: true,
amd: true,
node: true,
es6: true
},
extends: ['typescript', 'typescript/react', 'eslint:recommended', 'plugin:react/recommended', 'plugin:jsx-a11y/recommended', 'plugin:react-hooks/recommended', 'plugin:@next/next/recommended', 'plugin:prettier/recommended', 'plugin:storybook/recommended'],
plugins: ['simple-import-sort', '@typescript-eslint', 'eslint-plugin-tsdoc'],
rules: {
'prettier/prettier': ['error', {
singleQuote: true
}, {
usePrettierrc: true
}],
'react/react-in-jsx-scope': 'off',
'jsx-a11y/anchor-is-valid': ['error', {
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton']
}],
'arrow-body-style': ['error', 'as-needed'],
'arrow-parens': ['error', 'as-needed'],
'max-lines': ['error', 350],
'no-console': ['error', {
allow: ['warn', 'error', 'info']
}],
'react/destructuring-assignment': ['error', 'always'],
'react/jsx-closing-bracket-location': ['error', 'tag-aligned'],
'react/jsx-first-prop-new-line': [2, 'multiline'],
'react/no-array-index-key': 'off',
'react/self-closing-comp': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/no-noninteractive-tabindex': 'off',
'react-hooks/exhaustive-deps': 'off',
'no-useless-escape': 'off',
'react/display-name': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'react/prop-types': 'off',
'@typescript-eslint/ban-types': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'react/jsx-no-target-blank': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'no-case-declarations': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error', {
ignoreDeclarationMerge: true
}],
'tsdoc/syntax': 'error'
},
overrides: [{
files: ['**/*.tsx'],
rules: {
'max-lines': ['error', 700]
}
}, {
files: ['**/*.{js|cjs}'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off'
}
}, {
files: ['**/*.types.ts'],
rules: {
'max-lines': 'off'
}
}]
};