-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
68 lines (67 loc) · 1.89 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
60
61
62
63
64
65
66
67
68
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',
},
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-labs/spaces/issues/76
// https://github.com/microsoft/TypeScript/issues/16577#issuecomment-703190339
'import/extensions': [
'error',
'always',
{
ignorePackages: true,
},
],
// Enforce a convention in module import order
'import/order': [
'error',
{
'newlines-between': 'always', // or 'never' or 'always-and-inside-groups'
groups: ['builtin', 'external', 'internal', ['parent', 'sibling'], 'index'],
alphabetize: {
order: 'asc', // or 'desc'
caseInsensitive: true,
},
},
],
// Enforce a newline after import statements
'import/newline-after-import': 'error',
},
},
{
files: 'ably.d.ts',
extends: ['plugin:jsdoc/recommended'],
},
],
ignorePatterns: ['dist', 'build', 'docs', 'examples'],
settings: {
jsdoc: {
tagNamePreference: {
default: 'defaultValue',
},
},
},
};