-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy patheslint.config.js
65 lines (64 loc) · 1.66 KB
/
eslint.config.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
import dwpConfig from "@dwp/eslint-config-base";
import securityPlugin from "eslint-plugin-security";
import jsdocsPlugin from "eslint-plugin-jsdoc";
import sonarjsPlugin from "eslint-plugin-sonarjs";
import importPlugin from "eslint-plugin-import";
export default [
...dwpConfig,
securityPlugin.configs.recommended,
jsdocsPlugin.configs["flat/recommended"],
sonarjsPlugin.configs.recommended,
importPlugin.flatConfigs.recommended,
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
{
rules: {
"jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
"sonarjs/todo-tag": "warn",
"sonarjs/cognitive-complexity": ["warn", 15],
"sonarjs/public-static-readonly": "off" /* Can only use in TypeScript */,
},
},
{
name: "Global ignore list",
ignores: [
"assets/**/*",
"dist/**/*",
"examples/**/*",
"scripts/**/*",
"docs/api/**/*",
],
},
{
name: "Test files",
files: ["tests/**/*.js"],
languageOptions: {
globals: {
it: "readonly",
describe: "readonly",
beforeEach: "readonly",
afterEach: "readonly",
},
},
rules: {
"jsdoc/require-param-description": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": "off",
"security/detect-object-injection": "off",
"sonarjs/no-nested-functions": "off",
},
},
{
name: "Validators",
files: ["src/lib/validators/**/*.js"],
rules: {
// the API docs builder requires use of @memberof which raises this finding
"jsdoc/no-undefined-types": "off",
},
},
];