-
Notifications
You must be signed in to change notification settings - Fork 5
/
eslint.config.cjs
77 lines (75 loc) · 1.74 KB
/
eslint.config.cjs
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
74
75
76
77
const globals = require("globals");
const finsitPlugin = require("@foretagsplatsen/eslint-plugin");
module.exports = [
{
name: "global ignores",
ignores: ["dist/", "coverage/", "sample/"],
},
...finsitPlugin.configs.main,
{
name: "globals",
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
name: "global rules",
rules: {
"import/no-unused-modules": [
"error",
{
unusedExports: true,
missingExports: true,
ignoreExports: [
// List of files exporting stuff which are not imported:
"src/widgetjs.js",
"vitest.config.js",
"eslint.config.cjs",
".eslintrc.cjs",
// List of files not exporting anything:
"src/router/optionalParameterSegment.js",
"src/router/staticSegment.js",
],
},
],
"import/no-anonymous-default-export": "off",
"jsdoc/check-param-names": "off",
"jsdoc/check-tag-names": "off",
"jsdoc/check-types": "off",
"jsdoc/match-description": "off",
"jsdoc/no-undefined-types": "off",
"jsdoc/require-hyphen-before-param-description": "off",
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"jsdoc/tag-lines": "off",
"no-magic-numbers": "off",
},
},
{
name: "test rules",
files: ["src/test/**/*.js"],
rules: {
"import/no-unused-modules": [
"error",
{
unusedExports: true,
missingExports: true,
// List of files not exporting anything:
ignoreExports: ["**/*Test.js"],
},
],
"sonarjs/no-duplicate-string": "off",
},
},
{
name: "Disable import/no-unused-modules as it's flaky",
rules: {
"import/no-unused-modules": "off",
},
},
];