-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.eslintrc.js
More file actions
102 lines (96 loc) · 2.91 KB
/
.eslintrc.js
File metadata and controls
102 lines (96 loc) · 2.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
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
97
98
99
100
101
const ts = {
files: [
'**/*.ts'
],
rules: {
// this needs to be off because things like import and export statements are
// "unsupported", even though we're transpiling them first.
"node/no-unsupported-features": "off",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/ban-types": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"indent": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/no-angle-bracket-type-assertion": "error",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-triple-slash-reference": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-for-in-array": "error"
}
};
const test = {
files: [
'spec/**/*.js',
'spec/**/*.ts'
],
plugins: [
'mocha',
],
globals: {
describe: false,
it: false,
beforeEach: false,
afterEach: false,
before: false,
after: false,
expect: false
},
rules: {
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-identical-title': 'error',
'mocha/no-mocha-arrows': 'error',
'mocha/no-nested-tests': 'error',
'mocha/no-return-and-callback': 'error',
'mocha/no-top-level-hooks': 'error',
},
};
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2017,
sourceType: 'module',
},
env: {
'node': true,
'browser': false,
'es6': true
},
rules: Object.assign(
{},
require('eslint-plugin-node').configs.recommended.rules,
require('eslint/conf/eslint-recommended').rules,
{
'no-constant-condition': ["error", { checkLoops: false }],
'require-yield': 0,
semi: ["error", "always"],
'node/no-extraneous-require': ['error', {
'allowModules': []
}],
'node/no-extraneous-import': ['error', {
'allowModules': []
}],
'node/no-missing-require': ['error'],
'no-undef': 'error',
}),
plugins: ['node', '@typescript-eslint'],
overrides: [ test, ts ]
};