-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path.eslintrc.js
52 lines (52 loc) · 1.63 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
module.exports = {
root: true,
env: {
es6: true,
node: true,
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'security', 'jsdoc'],
extends: ['eslint:recommended', 'plugin:security/recommended'],
rules: {
'eol-last': 'error',
// security/detect-object-injection just gives a lot of false positives
// see https://github.com/nodesecurity/eslint-plugin-security/issues/21
'security/detect-object-injection': 'off',
'@typescript-eslint/no-var-requires': 'error',
// Use typescript-eslint’s version of the no-redeclare rule, which isn’t triggered by overload signatures.
// TODO remove this once we start using the full @typescript-eslint/recommended ruleset in #958
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
},
overrides: [
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_' }],
// TypeScript already enforces these rules better than any eslint setup can
'no-undef': 'off',
'no-dupe-class-members': 'off',
'no-unused-vars': 'off',
},
},
{
files: ['ably.d.ts', 'modular.d.ts'],
extends: ['plugin:jsdoc/recommended'],
rules: {
'jsdoc/check-tag-names': ['warn', { definedTags: ['experimental'] }],
},
},
],
ignorePatterns: ['build', 'test', 'tools', 'scripts', 'typedoc/generated', 'react', 'Gruntfile.js', 'grunt'],
settings: {
jsdoc: {
tagNamePreference: {
default: 'defaultValue',
},
},
},
};