-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
81 lines (78 loc) · 2.36 KB
/
index.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
module.exports = {
env: {
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['eslint-comments', 'import', 'prettier'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier',
],
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
rules: {
// TypeScript (@typescript-eslint/eslint-plugin)
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
Boolean: { message: 'Use boolean instead', fixWith: 'boolean' },
Number: { message: 'Use number instead', fixWith: 'number' },
String: { message: 'Use string instead', fixWith: 'string' },
Symbol: { message: 'Use symbol instead', fixWith: 'symbol' },
},
},
],
// ESLint (eslint-plugin-eslint-comments)
'eslint-comments/no-unused-disable': 'warn',
// Import/export syntax (eslint-plugin-import)
'import/no-useless-path-segments': [
'warn',
{
noUselessIndex: true,
},
],
'import/order': ['warn', { 'newlines-between': 'always' }],
// Custom
'array-callback-return': 'warn',
curly: 'warn',
'dot-notation': 'warn',
'eol-last': 'warn',
eqeqeq: ['error', 'always', { null: 'never' }],
'guard-for-in': 'warn',
'no-alert': 'warn',
'no-console': 'warn',
'no-debugger': 'warn',
'no-duplicate-imports': ['warn', { includeExports: true }],
'no-floating-decimal': 'warn',
'no-new': 'warn',
'no-proto': 'warn',
'no-return-assign': 'warn',
'no-underscore-dangle': ['warn', { allowAfterThis: true }],
'no-unneeded-ternary': 'warn',
'one-var': ['warn', 'never'],
'prefer-arrow-callback': 'warn',
'prefer-const': 'off',
radix: 'warn',
yoda: 'warn',
},
};