-
Notifications
You must be signed in to change notification settings - Fork 12
/
.eslintrc.js
56 lines (55 loc) · 1.48 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
const { OFF, WARN, ERROR } = {
OFF: 0,
WARN: 1,
ERROR: 2,
};
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
extends: ['plugin:react/recommended', 'airbnb', 'plugin:cypress/recommended'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', 'prettier', 'cypress'],
rules: {
'max-len': [WARN, { code: 100, ignorePattern: '^import\\W.*', ignoreTrailingComments: true }],
'object-curly-newline': [
WARN,
{ ObjectPattern: { multiline: true, minProperties: 1 }, ImportDeclaration: 'always' },
],
'react/prop-types': OFF, // To be done in another refactor
'react/react-in-jsx-scope': OFF,
'react/jsx-filename-extension': [ERROR, { extensions: ['.js', '.jsx'] }],
'no-param-reassign': [ERROR, { props: true, ignorePropertyModificationsFor: ['draft'] }],
'no-use-before-define': [ERROR, { functions: false }],
'no-plusplus': [ERROR, { allowForLoopAfterthoughts: true }],
'jest/expect-expect': OFF,
},
overrides: [
{
files: ['src/scripts/**', 'jest.config.js'],
env: { node: true },
},
{
files: ['**.test.**', '**.spec.**'],
env: {
node: true,
jest: true,
},
},
],
settings: {
'import/resolver': {
node: {
extensions: ['.ts', '.js', '.jsx', '.json'],
paths: ['node_modules/', 'node_modules/@types', 'src/'],
},
},
},
};