-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
74 lines (68 loc) · 1.94 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
const OFF = 0;
// const WARN = 1;
const ERROR = 2;
module.exports = {
env: {
browser: true,
es6: true,
mocha: true,
},
extends: ['airbnb', 'airbnb/hooks', 'prettier', 'plugin:cypress/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
JSX: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'simple-import-sort', 'prettier'],
settings: {
'import/resolver': {
typescript: {},
},
},
rules: {
// note you must disable the base rule as it can report incorrect errors
'no-use-before-define': OFF,
'no-void': OFF,
'@typescript-eslint/no-use-before-define': ERROR,
'prettier/prettier': ERROR,
// note you must disable the base rule as it can report incorrect errors
'no-shadow': OFF,
'@typescript-eslint/no-shadow': [ERROR],
// ESLint rules
'no-underscore-dangle': OFF,
'arrow-parens': [ERROR, 'as-needed'],
'no-nested-ternary': OFF,
'import/prefer-default-export': OFF,
'import/extensions': [ERROR, 'never'],
'import/no-unresolved': ERROR,
'import/no-extraneous-dependencies': [
ERROR,
{
devDependencies: true,
},
],
'no-param-reassign': ['error', { props: false }],
// Sorting rules
'sort-imports': OFF,
'import/order': OFF,
'import/first': ERROR,
'import/no-duplicates': ERROR,
'simple-import-sort/imports': ERROR,
'simple-import-sort/exports': ERROR,
'import/newline-after-import': ['error', { count: 1 }],
// TypeScript rules
'no-unused-vars': 'off', // disable the native no-unused-vars so that only the TS one is enabled
'@typescript-eslint/no-unused-vars': OFF,
'@typescript-eslint/explicit-function-return-type': OFF,
'@typescript-eslint/no-explicit-any': OFF,
'no-redeclare': OFF,
},
};