This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
65 lines (65 loc) · 1.97 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
module.exports = {
env: {
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "tsconfig.json",
},
plugins: ["@typescript-eslint", "jest", "import"],
rules: {
curly: ["error", "all"],
eqeqeq: ["error", "always"],
"no-implicit-coercion": ["error"],
// https://github.com/eslint/eslint/blob/master/docs/rules/no-sequences.md#when-not-to-use-it
"no-restricted-syntax": ["error", "SequenceExpression"],
"prefer-const": ["error", { destructuring: "all" }],
"require-await": ["error"],
"@typescript-eslint/no-unused-expressions": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-use-before-define": ["error", { functions: false }],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
allowString: false,
allowNumber: false,
allowNullableObject: false,
},
],
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
},
overrides: [
{
// Disable some rules that fail for vendored Jest code. If we fix these, it'll be harder to
// merge upstream changes.
files: ["packages/jest-plugin/src/vendored/**/*.ts"],
rules: {
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/unbound-method": "off",
},
},
{
files: ["**/*.test.ts"],
rules: {
// Allow tests to call require() since that's needed for some mocking.
"@typescript-eslint/no-var-requires": "off",
},
},
],
};