This repository has been archived by the owner on Jan 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
73 lines (73 loc) · 2.35 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
// Allows for the use of imports
sourceType: 'module',
ecmaFeatures: {
// Allows for the parsing of JSX
jsx: true,
},
},
extends: [
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/errors',
'prettier/@typescript-eslint',
// Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'import', 'react', 'react-hooks'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/order': [
'error',
{
groups: ['external', 'internal'],
'newlines-between': 'always-and-inside-groups',
},
],
'import/no-unresolved': ['error', { ignore: ['^~/', '^next/'] }],
'jsx-a11y/anchor-is-valid': 'off',
'react/jsx-boolean-value': ['warn', 'never'],
'react/no-array-index-key': 'error',
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-multi-comp': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'warn',
'react/jsx-sort-props': [
'error',
{
callbacksLast: true,
},
],
'react/jsx-wrap-multilines': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'sort-imports': [
'warn',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
},
],
},
globals: {
window: 'writable',
document: 'writable',
},
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.tsx'],
},
},
react: {
// Tells eslint-plugin-react to automatically detect the version of React to use
version: 'detect',
},
},
}