-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
48 lines (48 loc) · 1.39 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
module.exports = {
extends: ['airbnb', 'airbnb/hooks', 'prettier', 'prettier/react'],
plugins: ['react', 'prettier'],
// babel-eslint parser is used to support experimental features not supported in ESLint itself yet
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 8,
ecmaFeatures: {
impliedStrict: true, //enable global strict mode (if ecmaVersion is 5 or greater)
},
},
root: true,
env: {
browser: true,
node: true,
jest: true,
},
rules: {
'react/state-in-constructor': 0,
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'arrow-body-style': ['error', 'as-needed'],
// disables the windows/unix linebreak checks.
'linebreak-style': [0, 'error', 'windows'],
// allow .js extensions for JSX.
'react/jsx-filename-extension': [
1,
{
extensions: ['.js', '.jsx'],
},
],
// ignores the libraries being in devDependencies like: jest and storybook
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['**/*.test.js', '**/*.spec.js', '**/*.stories.js'] },
],
// configure the prettier plugin
'prettier/prettier': [
'error',
{
trailingComma: 'all',
singleQuote: true,
semi: false,
},
],
'import/prefer-default-export': 'off',
},
};