generated from tomo0613/ts-project-starter
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.eslintrc.js
82 lines (80 loc) · 2.83 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
const DISABLED = 0;
const WARNING = 1;
const ERROR = 2;
// https://dev.to/otamnitram/sorting-your-imports-correctly-in-react-213m
const importOrder_ruleConfig = {
'groups': ['builtin', 'external', 'internal'],
'alphabetize': {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
};
const noMixedOperators_ruleConfig = {
allowSamePrecedence: true,
groups: [
['%', '**'],
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof'],
],
};
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
env: {
browser: true,
node: true,
},
plugins: [
'@typescript-eslint',
],
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended',
],
rules: {
'import/extensions': [ERROR, 'never'],
'import/no-extraneous-dependencies': [WARNING, { devDependencies: true }],
'import/no-unresolved': DISABLED,
'import/order': [WARNING, importOrder_ruleConfig],
'import/prefer-default-export': DISABLED,
'react/jsx-uses-react': DISABLED,
'react/react-in-jsx-scope': DISABLED,
'brace-style': [WARNING, '1tbs', { allowSingleLine: false }],
'camelcase': DISABLED,
'curly': [WARNING, 'all'],
'func-names': [WARNING, 'as-needed'],
'indent': [WARNING, 4, { SwitchCase: 1 }],
'linebreak-style': DISABLED,
'lines-between-class-members': [WARNING, 'always', { exceptAfterSingleLine: true }],
'max-len': [WARNING, 120],
'no-continue': DISABLED,
'no-dupe-class-members': DISABLED,
'no-mixed-operators': [ERROR, noMixedOperators_ruleConfig],
'no-multi-spaces': WARNING,
'no-multiple-empty-lines': [WARNING, { max: 1 }],
'no-param-reassign': DISABLED,
'no-plusplus': DISABLED,
'no-prototype-builtins': DISABLED,
'no-shadow': DISABLED,
'no-underscore-dangle': DISABLED,
'no-use-before-define': DISABLED,
'object-curly-newline': DISABLED,
'quote-props': [WARNING, 'consistent-as-needed', { numbers: true }],
'sort-imports': DISABLED,
'wrap-iife': DISABLED,
'@typescript-eslint/camelcase': DISABLED,
'@typescript-eslint/explicit-function-return-type': DISABLED,
'@typescript-eslint/explicit-member-accessibility': DISABLED,
'@typescript-eslint/explicit-module-boundary-types': DISABLED,
'@typescript-eslint/member-delimiter-style': WARNING,
'@typescript-eslint/no-empty-function': WARNING,
'@typescript-eslint/no-shadow': ERROR,
'@typescript-eslint/no-use-before-define': [ERROR, 'nofunc'],
},
};