forked from gooddata/gooddata-ui-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
55 lines (54 loc) · 2.11 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
// (C) 2020 GoodData Corporation
module.exports = {
root: true,
ignorePatterns: ["**/dist/**/*.*"],
rules: {
"no-duplicate-imports": "error",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
"@typescript-eslint/ban-types": [
"error",
{
types: {
object: false,
},
extendDefaults: true,
},
],
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/member-ordering": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/prefer-optional-chain": "error",
"import/order": "off",
"no-restricted-imports": [
"error",
{
paths: [{ name: "lodash/get", message: "Please use the ?. and ?? operators instead." }],
},
],
"import/no-unassigned-import": "error",
// we don't mind duplicate string most of the time as they are often checked by TypeScript unions
"sonarjs/no-duplicate-string": "off",
// some of these findings are not actionable in a reasonable time
"sonarjs/cognitive-complexity": "warn",
"tsdoc/syntax": "error",
// these rules can make some regexes much less readable
"regexp/prefer-d": "off",
"regexp/prefer-w": "off",
// this rule is in direct conflict with the regexp plugin
"no-useless-escape": "off",
},
overrides: [
{
files: ["*.test.ts", "*.test.tsx", "*.spec.ts"],
rules: {
// we do not care about duplicate functions in test files, they often make sense (e.g. in different describe blocks)
"sonarjs/no-identical-functions": "off",
},
},
],
};