-
Notifications
You must be signed in to change notification settings - Fork 72
/
.eslintrc.js
81 lines (79 loc) · 2.06 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"use strict";
const error = "error";
const warn = process.argv.includes("--report-unused-disable-directives")
? "error"
: "warn";
module.exports = {
root: true,
extends: ["eslint:recommended"],
plugins: ["vitest"],
parserOptions: {
ecmaVersion: 2018,
},
env: { es6: true, node: true },
rules: {
"arrow-body-style": warn,
"default-case": error,
"default-case-last": warn,
"dot-notation": warn,
"no-caller": error,
"no-console": warn,
"no-eval": error,
"no-labels": error,
"no-octal-escape": error,
"no-param-reassign": error,
"no-promise-executor-return": error,
"no-restricted-syntax": [
error,
{
selector: "SequenceExpression",
message:
"The comma operator is confusing and a common mistake. Don’t use it!",
},
],
"no-self-compare": error,
"no-shadow": error,
"no-template-curly-in-string": error,
"no-unmodified-loop-condition": error,
"no-unneeded-ternary": warn,
"no-useless-backreference": error,
"no-useless-computed-key": warn,
"no-useless-concat": warn,
"no-useless-constructor": warn,
"no-useless-rename": warn,
"no-var": warn,
"object-shorthand": warn,
"one-var": [warn, "never"],
"prefer-arrow-callback": warn,
"prefer-const": warn,
"prefer-destructuring": [warn, { object: true, array: false }],
"prefer-exponentiation-operator": warn,
"prefer-numeric-literals": warn,
"prefer-object-spread": warn,
"prefer-promise-reject-errors": error,
"prefer-regex-literals": warn,
"prefer-rest-params": warn,
"prefer-spread": warn,
"prefer-template": warn,
curly: warn,
eqeqeq: [error, "always", { null: "ignore" }],
strict: error,
yoda: warn,
},
overrides: [
{
files: ["test/*.js", "*.mjs"],
parserOptions: {
sourceType: "module",
},
},
{
files: ["*.test.js"],
extends: ["plugin:vitest/recommended"],
rules: {
"vitest/no-disabled-tests": warn,
"vitest/no-focused-tests": warn,
},
},
],
};