-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
69 lines (64 loc) · 1.97 KB
/
eslint.config.mjs
File metadata and controls
69 lines (64 loc) · 1.97 KB
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
import { defineConfig } from "eslint/config";
import typescriptEslint from "typescript-eslint";
import prettier from "eslint-config-prettier";
import love from "eslint-config-love";
import globals from "globals";
import jest from "eslint-plugin-jest";
import js from "@eslint/js";
export default defineConfig([
js.configs.recommended,
typescriptEslint.configs.eslintRecommended,
typescriptEslint.configs.recommendedTypeChecked,
typescriptEslint.configs.strict,
love,
prettier,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
},
rules: {
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-magic-numbers": [
"error",
{ ignore: [0, 1], ignoreEnums: true },
],
// Breaking the following rule is a key part of how our middleware works right now.
// We want to move away from that, but for the moment the rule must be disabled.
"no-param-reassign": ["error", { props: false }],
// This rule objects to most express middleware.
"require-atomic-updates": "off",
},
},
{
files: ["**/*.test.ts"],
plugins: {
jest,
},
rules: {
"@typescript-eslint/unbound-method": "off",
"jest/unbound-method": "error",
"jest/no-focused-tests": "error",
// Test files are allowed to be long because they need to be able to comprehensively test
// the relevant code, however many tests that takes. Their natural structure also makes
// them more navigable than other lengthy files might be.
"max-lines": "off",
"@typescript-eslint/no-magic-numbers": "off",
// async methods without awaits are sometimes needed for mocking
"@typescript-eslint/require-await": "off",
// This interferes with some mocking patterns that we use widely
"@typescript-eslint/strict-void-return": "off",
},
},
]);