-
Notifications
You must be signed in to change notification settings - Fork 8
/
.eslintrc.js
55 lines (55 loc) · 1.51 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
module.exports = {
root: true,
env: {
es6: true,
node: true,
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'security', 'jsdoc', 'import'],
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',
// the code problem checked by this ESLint rule is automatically checked by the TypeScript compiler
'no-redeclare': 'off',
},
overrides: [
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-unused-vars': ['error'],
// TypeScript already enforces these rules better than any eslint setup can
'no-undef': 'off',
'no-dupe-class-members': 'off',
// see:
// https://github.com/ably/spaces/issues/76
// https://github.com/microsoft/TypeScript/issues/16577#issuecomment-703190339
'import/extensions': [
'error',
'always',
{
ignorePackages: true,
},
],
},
},
{
files: 'ably.d.ts',
extends: ['plugin:jsdoc/recommended'],
},
],
ignorePatterns: ['dist', 'build', 'examples', 'test/ably-common'],
settings: {
jsdoc: {
tagNamePreference: {
default: 'defaultValue',
},
},
},
};