-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.eslintrc.js
More file actions
69 lines (66 loc) · 1.91 KB
/
Copy path.eslintrc.js
File metadata and controls
69 lines (66 loc) · 1.91 KB
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
const parserOptions = {
ecmaVersion: 6,
sourceType: 'module',
}
const eslintRules = {
'arrow-body-style': 'warn',
'arrow-spacing': 'error',
'eol-last': 'error',
'func-call-spacing': 'error',
'no-alert': 'error',
'no-async-promise-executor': 'error',
'no-case-declarations': 'error',
'no-console': ['error', { allow: ['error', 'warn'] }],
'no-control-regex': 'error',
'no-dupe-keys': 'error',
'no-empty': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-semi': 'error',
'no-fallthrough': 'error',
'no-import-assign': 'error',
'no-irregular-whitespace': 'error',
'no-prototype-builtins': 'error',
'no-return-await': 'error',
'no-trailing-spaces': 'error',
'no-useless-escape': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-var': 'error',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
quotes: ['error', 'single'],
'spaced-comment': 'error',
}
const typescriptEslintRules = {
'@typescript-eslint/no-empty-function': 'off', // OFF using empty functions for testing
}
module.exports = {
env: {
browser: true,
es6: true,
node: true,
jest: true,
},
extends: ['eslint:recommended'],
overrides: [
{
files: ['src/**/*.ts'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
parser: '@typescript-eslint/parser',
parserOptions: {
...parserOptions,
project: './tsconfig.json',
tsconfigRootDir: './',
},
plugins: ['@typescript-eslint'],
rules: {
...eslintRules,
...typescriptEslintRules,
},
},
],
}