forked from scratchblocks/scratchblocks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
97 lines (85 loc) · 1.99 KB
/
eslint.config.mjs
File metadata and controls
97 lines (85 loc) · 1.99 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import globals from "globals"
import babelParser from "@babel/eslint-parser"
import js from "@eslint/js"
export default [
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
parser: babelParser,
ecmaVersion: 14,
sourceType: "module",
parserOptions: {
requireConfigFile: false,
},
},
rules: {
curly: [2, "all"],
"default-case": 2,
"default-case-last": 2,
"dot-notation": 2,
eqeqeq: [
2,
"always",
{
null: "never",
},
],
"no-constant-condition": [
2,
{
checkLoops: false,
},
],
"no-constant-binary-expression": 2,
"no-duplicate-imports": 2,
"no-else-return": 2,
"no-lonely-if": 2,
"no-loop-func": 2,
"no-restricted-syntax": [
2,
{
selector:
'CallExpression > MemberExpression[property.name="join"] > ArrayExpression',
message:
"Do not call Array.join on newly constructed array; use template string instead",
},
{
selector:
'BinaryExpression[left.callee.property.name="indexOf"] > UnaryExpression[operator="-"][argument.value="1"]',
message: "Use includes method instead of indexOf method",
},
],
"no-self-compare": 2,
"no-sequences": 2,
"no-unreachable-loop": 2,
"no-unused-private-class-members": 2,
"no-unused-vars": [
2,
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"no-useless-concat": 2,
"no-var": 2,
"prefer-arrow-callback": 2,
"prefer-const": 2,
"prefer-object-spread": 2,
"prefer-rest-params": 2,
"prefer-spread": 2,
yoda: [2, "never"],
},
},
{
files: ["tests/*.js"],
languageOptions: {
globals: {
...globals.jest,
},
},
},
]