-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
113 lines (113 loc) · 3.2 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
module.exports = {
root: true, // Make sure eslint picks up the config at the root of the directory
parserOptions: {
ecmaVersion: 2020, // Use the latest ecmascript standard
sourceType: 'module', // Allows using import/export statements
ecmaFeatures: {
jsx: true // Enable JSX since we're using React
}
},
settings: {
react: {
version: 'detect' // Automatically detect the react version
}
},
env: {
es6: true,
browser: true, // Enables browser globals like window and document
amd: true, // Enables require() and define() as global variables as per the amd spec.
node: true // Enables Node.js global variables and Node.js scoping.
},
extends: [
'airbnb',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'plugin:react-prefer-function-component/recommended',
'next',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: [
'react-hooks',
'react-prefer-function-component',
'prefer-arrow-functions',
'@typescript-eslint'
],
rules: {
'react/function-component-definition': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'newline-per-chained-call': 'off',
'jsx-a11y/label-has-for': [
'warn',
{
required: {
some: ['nesting', 'id']
}
}
],
'no-confusing-arrow': 'off',
'no-use-before-define': 'off',
'prefer-template': 'error',
'require-yield': 'off',
'react/forbid-prop-types': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-no-target-blank': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-sort-props': [
'warn',
{
callbacksLast: true,
shorthandFirst: false,
shorthandLast: true,
ignoreCase: true,
noSortAlphabetically: false
}
],
'react/require-extension': 'off',
'react/sort-prop-types': [
'warn',
{
callbacksLast: true,
ignoreCase: true,
requiredFirst: false,
sortShapeProp: true
}
],
'react/react-in-jsx-scope': 'off',
'no-console': 'error',
'prefer-arrow-functions/prefer-arrow-functions': 'error',
'react/prop-types': 'off',
'react/no-unknown-property': ['error', { ignore: ['jsx', 'global'] }],
'prettier/prettier': ['error', {}, { usePrettierrc: true }], // Use our .prettierrc file as source
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton']
}
],
'no-restricted-exports': 'off',
'jsx-a11y/label-has-associated-control': [
2,
{
depth: 1
}
],
'no-underscore-dangle': 'off',
'import/no-cycle': 'off',
'global-require': 'off',
'react/require-default-props': 'off',
'no-nested-ternary': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error']
}
};