-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy path.eslintrc.json
More file actions
71 lines (69 loc) · 2.64 KB
/
.eslintrc.json
File metadata and controls
71 lines (69 loc) · 2.64 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"project": true
},
"plugins": ["@typescript-eslint", "mocha", "sonarjs"],
"rules": {
"curly": "error",
"eqeqeq": "warn",
"no-throw-literal": "warn",
// TODO "@typescript-eslint/semi" rule moved to https://eslint.style
"semi": "error",
"no-console": "warn",
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.object.callee.name='tag'][callee.property.name='only']",
"message": "Unexpected exclusive mocha test with tag().suite.only() or tag().test.only()"
},
{
"selector": "ImportExpression",
"message": "Dynamic imports using 'import()' are not allowed. Use static imports at the top of the file instead."
},
{
"selector": "CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduce']",
"message": "Provide initialValue to .reduce(). Otherwise an empty array will throw a 'reduce of empty array with no initial value' error."
},
{
"selector": "CallExpression[arguments.length=1] > MemberExpression.callee > Identifier.property[name='reduceRight']",
"message": "Provide initialValue to .reduceRight(). Otherwise an empty array will throw a 'reduce of empty array with no initial value' error."
}
],
"@typescript-eslint/no-floating-promises": ["warn", { "checkThenables": true }],
"@typescript-eslint/await-thenable": "warn",
// Mostly fails tests, ex. expect(...).to.be.true returns a Chai.Assertion
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "none"
}
],
"sonarjs/cognitive-complexity": ["error", 15],
"sonarjs/use-type-alias": "off",
"sonarjs/function-return-type": "off",
"sonarjs/slow-regex": "off",
"sonarjs/publicly-writable-directories": "off",
"sonarjs/no-same-argument-assert": "off",
"sonarjs/no-invariant-returns": "off",
"sonarjs/fixme-tag": "off",
"sonarjs/todo-tag": "off",
// These should be progressively enabled over time as we fix the underlying issues
"sonarjs/no-ignored-exceptions": "off",
"sonarjs/no-async-constructor": "off"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended-legacy",
"prettier"
],
"ignorePatterns": ["assets", "out", "dist", "**/*.d.ts"]
}