forked from webpack/webpack.js.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
58 lines (58 loc) · 1.46 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
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:react/recommended', 'prettier'],
parser: '@babel/eslint-parser',
env: {
browser: true,
es6: true,
node: true,
jest: true,
'cypress/globals': true,
},
plugins: ['cypress', 'react-hooks'],
rules: {
'no-console': 'off',
semi: ['error', 'always'],
quotes: ['error', 'single'],
'no-duplicate-imports': 'error',
'react/jsx-uses-react': 'off', // no longer needed with new jsx transform
'react/react-in-jsx-scope': 'off', // ditto
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
react: {
version: 'detect',
},
},
overrides: [
{ files: ['src/**/*.jsx'] }, // eslint would lint .js only by default
{
files: ['**/*.mdx'],
extends: ['plugin:mdx/recommended'],
globals: {
Badge: true,
StackBlitzPreview: true,
},
rules: {
semi: ['off'],
},
settings: {
'mdx/code-blocks': true,
},
},
{
files: ['**/*.mdx/*.{js,javascript}'], // we don't lint ts at the moment
rules: {
indent: ['error', 2],
quotes: ['error', 'single', { allowTemplateLiterals: true }],
'no-undef': 'off',
'no-unused-vars': 'off',
'no-constant-condition': 'off',
'no-useless-escape': 'off',
'no-dupe-keys': 'off',
'no-duplicate-imports': 'off',
},
},
],
};