-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
59 lines (58 loc) · 1.86 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
"use strict";
module.exports = {
env: {
es2023: true,
node: true,
},
extends: [
"airbnb-base",
"plugin:@eslint-community/eslint-comments/recommended",
"plugin:jsdoc/recommended",
"plugin:promise/recommended",
"plugin:regexp/recommended",
"plugin:security/recommended-legacy",
"prettier",
],
overrides: [
{
extends: ["plugin:jest/recommended", "plugin:jest/style"],
files: ["src/**/*.test.js"],
plugins: ["jest"],
rules: {
"jest/no-duplicate-hooks": "error",
"jest/no-test-return-statement": "error",
"jest/prefer-comparison-matcher": "error",
"jest/prefer-each": "warn",
"jest/prefer-equality-matcher": "error",
"jest/prefer-expect-resolves": "error",
"jest/prefer-hooks-in-order": "error",
"jest/prefer-hooks-on-top": "error",
"jest/prefer-mock-promise-shorthand": "error",
"jest/prefer-spy-on": "error",
"jest/require-top-level-describe": "error",
},
},
],
parserOptions: {
ecmaVersion: 2023,
// Explicitly tell ESLint to parse JavaScript as CommonJS, as airbnb-base sets this to "modules" for ECMAScript
sourceType: "script",
},
plugins: ["import", "jsdoc", "promise", "regexp", "security"],
root: true,
rules: {
"@eslint-community/eslint-comments/disable-enable-pair": "off",
"@eslint-community/eslint-comments/no-unused-disable": "error",
"@eslint-community/eslint-comments/require-description": "error",
"import/no-extraneous-dependencies": "error",
"jsdoc/check-syntax": "error",
"jsdoc/require-description-complete-sentence": "error",
"jsdoc/require-hyphen-before-param-description": "error",
"no-multiple-empty-lines": ["error", { max: 1 }],
"prefer-destructuring": ["error", { object: true, array: false }],
"promise/prefer-await-to-callbacks": "warn",
"promise/prefer-await-to-then": "warn",
"security/detect-object-injection": "off",
strict: ["error", "global"],
},
};