forked from teoxoy/factorio-blueprint-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
96 lines (90 loc) · 3.62 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module.exports = {
env: {
browser: true,
es6: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
// Turns off all rules that are unnecessary or might conflict with Prettier
'plugin:prettier/recommended',
'prettier/@typescript-eslint'
// Ends here
],
rules: {
'prettier/prettier': 'warn',
'@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/interface-name-prefix': ['error', 'always'], // TODO: maybe turn off
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-object-literal-type-assertion': ['error', { allowAsParameter: true }],
'@typescript-eslint/explicit-member-accessibility': 'off', // TODO: turn on
'@typescript-eslint/explicit-function-return-type': 'off', // TODO: turn on
'@typescript-eslint/camelcase': 'off', // TODO: turn on
'import/order': 'warn',
'import/first': 'warn',
'import/exports-last': 'warn',
'import/group-exports': 'warn',
// Possible Errors (https://eslint.org/docs/rules/#possible-errors)
'no-console': 'off',
// Best Practices (https://eslint.org/docs/rules/#best-practices)
curly: ['warn', 'all'],
'dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
eqeqeq: ['warn', 'always'],
'guard-for-in': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-param-reassign': 'error',
'no-return-assign': ['error', 'always'],
'no-return-await': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-concat': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-with': 'error',
'wrap-iife': ['error', 'inside'],
yoda: ['error', 'never', { exceptRange: true }],
// Stylistic Issues (https://eslint.org/docs/rules/#stylistic-issues)
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'no-mixed-operators': [
'error',
{
groups: [
// ['+', '-', '*', '/', '%', '**'],
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof']
],
allowSamePrecedence: true
}
],
'no-multi-assign': 'error',
'no-negated-condition': 'error',
'no-nested-ternary': 'error',
'no-new-object': 'error',
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-unneeded-ternary': 'error',
'operator-assignment': ['error', 'always'],
'prefer-object-spread': 'error',
'spaced-comment': ['warn', 'always', { block: { balanced: true } }],
// ECMAScript 6 (https://eslint.org/docs/rules/#ecmascript-6)
'arrow-body-style': ['error', 'as-needed'],
'no-confusing-arrow': ['error', { allowParens: true }],
'no-var': 'error',
'prefer-spread': 'error',
'prefer-template': 'error'
}
}