-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.eslintrc.js
59 lines (54 loc) · 1.91 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
const airbnb = require('eslint-config-airbnb-base/rules/style');
// Do not restrict usage of for...of
const noRestrictedSyntax = airbnb.rules['no-restricted-syntax'].slice(1).filter(r => r.selector !== 'ForOfStatement');
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'airbnb-base',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
],
rules: {
'indent': ['error', 4, { 'SwitchCase': 1 }],
'max-len': ['error', 120],
'no-underscore-dangle': 'off',
'no-plusplus': 'off',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'import/prefer-default-export': 'off',
'object-curly-newline': ['error', { 'ObjectPattern': { 'multiline': true } }],
'prefer-const': ['error', {'destructuring': 'all'}],
'no-nested-ternary': 'off',
'no-restricted-syntax': ['error', ...noRestrictedSyntax],
'no-continue': 'off',
// Typescript plugin replacements
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
// False positives that are checked by TS
'no-redeclare': 'off',
'no-param-reassign': 'off',
'import/no-unresolved': 'off',
'no-use-before-define': 'off',
'no-shadow': 'off',
'no-dupe-class-members': 'off',
'no-undef': 'off',
// Allow importing TS files without extension, as Rollup takes care of that
'import/extensions': 'off',
},
};