-
Notifications
You must be signed in to change notification settings - Fork 42
/
.eslintrc.js
73 lines (73 loc) · 2.14 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
69
70
71
72
73
module.exports = {
root: true,
// FIXME: Figure out why "next/core-web-vitals" fails to load.
extends: ["@inrupt/eslint-config-lib"],
ignorePatterns: [
"*.d.ts",
// This is a file automatically generated by NextJS
"next.config.js",
"**/umd/**",
"**/dist/**",
// There are currently linting errors in example code, these will be
// addressed separately.
"**/examples/**",
// TS linting rules aren't applicable to JS webpack config
"webpack.*.js"
],
overrides: [
// Add any package-specific rules as overrides here.
{
files: ["**/*.spec.ts"],
rules: {
// Using 'any' in the tests is usually justified.
"@typescript-eslint/no-explicit-any": "off",
},
},
],
env: {
// eslint will complain about imports from @jest/globals shadowing global
// variables if this is enabled:
"jest/globals": false,
},
rules: {
// The DI framework uses empty constructors to inject dependencies
"no-useless-constructor": "off",
"prettier/prettier": "error",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "interface",
format: ["PascalCase"],
custom: {
regex: "^I[A-Z]",
match: true,
},
},
],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// The following rules are disabled until the overall testing strategy is improved
"jest/no-mocks-import": "off",
"import/prefer-default-export": "off",
// The following rule should be re-enabled after a refactoring of the handler pattern
"class-methods-use-this": "off",
// This rule trips over modules with exports maps, like [email protected]
"import/no-unresolved": "off",
// FIXME Add "fetch" to the shared eslint config for the following rule.
"no-shadow": [
"error",
{
allow: [
"describe",
"it",
"jest",
"expect",
"beforeEach",
"beforeAll",
"afterEach",
"afterAll",
"fetch"
],
},
],
},
};