@eslinted/defaults 12.18.0 → 12.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +562 -563
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.spec.d.ts +2 -0
- package/dist/index.spec.d.ts.map +1 -0
- package/dist/index.spec.js +154 -0
- package/dist/index.spec.js.map +1 -0
- package/dist/rules/_strings/option.d.ts +1 -1
- package/dist/rules/_strings/option.d.ts.map +1 -1
- package/dist/rules/_strings/option.js +1 -1
- package/dist/rules/_strings/option.js.map +1 -1
- package/dist/rules/_strings/state.d.ts +1 -1
- package/dist/rules/_strings/state.d.ts.map +1 -1
- package/dist/rules/_strings/state.js +1 -1
- package/dist/rules/_strings/state.js.map +1 -1
- package/dist/rules/_strings/state.spec.js +23 -18
- package/dist/rules/_strings/state.spec.js.map +1 -1
- package/dist/rules/css/enable.d.ts +11 -11
- package/dist/rules/css/index.d.ts +11 -11
- package/dist/rules/enable.d.ts +148 -148
- package/dist/rules/html/index.d.ts +41 -41
- package/dist/rules/html/plugin/index.d.ts +41 -41
- package/dist/rules/index.d.ts +550 -551
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/json/enable.d.ts +4 -4
- package/dist/rules/json/index.d.ts +42 -42
- package/dist/rules/json/plugin/extension.d.ts +19 -19
- package/dist/rules/json/plugin/index.d.ts +19 -19
- package/dist/rules/jsonc/index.d.ts +1 -1
- package/dist/rules/jsonc/plugin/index.d.ts +1 -1
- package/dist/rules/jsoncc/index.d.ts +1 -1
- package/dist/rules/jsoncc/plugin/index.d.ts +1 -1
- package/dist/rules/mocha/chai/expect.d.ts +3 -3
- package/dist/rules/mocha/chai/index.d.ts +1 -1
- package/dist/rules/mocha/disable.d.ts +2 -2
- package/dist/rules/mocha/enable.d.ts +16 -16
- package/dist/rules/mocha/index.d.ts +22 -22
- package/dist/rules/stylistic.d.ts +67 -67
- package/dist/rules/svelte/disable.d.ts +6 -6
- package/dist/rules/svelte/enable.d.ts +67 -67
- package/dist/rules/svelte/extension/disable.d.ts +3 -3
- package/dist/rules/svelte/extension/index.d.ts +2 -2
- package/dist/rules/svelte/index.d.ts +78 -78
- package/dist/rules/ts/disable.d.ts +19 -19
- package/dist/rules/ts/enable.d.ts +86 -86
- package/dist/rules/ts/extension/disable.d.ts +8 -8
- package/dist/rules/ts/extension/index.d.ts +7 -7
- package/dist/rules/ts/index.d.ts +120 -120
- package/dist/rules/yml/enable.d.ts +11 -12
- package/dist/rules/yml/enable.d.ts.map +1 -1
- package/dist/rules/yml/enable.js +0 -1
- package/dist/rules/yml/enable.js.map +1 -1
- package/dist/rules/yml/extension.d.ts +8 -8
- package/dist/rules/yml/index.d.ts +19 -20
- package/dist/rules/yml/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.spec.ts +228 -0
- package/src/index.ts +1 -1
- package/src/rules/_strings/option.ts +1 -2
- package/src/rules/_strings/state.spec.ts +27 -22
- package/src/rules/_strings/state.ts +3 -3
- package/src/rules/yml/enable.ts +1 -1
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import "chai/register-should.js";
|
|
2
|
+
import { defaults } from ".";
|
|
3
|
+
|
|
4
|
+
describe(
|
|
5
|
+
"Main Export",
|
|
6
|
+
function () {
|
|
7
|
+
const SCOPE = [
|
|
8
|
+
"js",
|
|
9
|
+
"ts",
|
|
10
|
+
],
|
|
11
|
+
GLOBAL_SCOPE = "*",
|
|
12
|
+
{
|
|
13
|
+
ignores,
|
|
14
|
+
files,
|
|
15
|
+
rules,
|
|
16
|
+
} = defaults;
|
|
17
|
+
|
|
18
|
+
describe(
|
|
19
|
+
"module",
|
|
20
|
+
function () {
|
|
21
|
+
it(
|
|
22
|
+
"with object submodules: ignores, files, rules",
|
|
23
|
+
function () {
|
|
24
|
+
ignores
|
|
25
|
+
.should
|
|
26
|
+
.be
|
|
27
|
+
.an("object");
|
|
28
|
+
files
|
|
29
|
+
.should
|
|
30
|
+
.be
|
|
31
|
+
.an("object");
|
|
32
|
+
rules
|
|
33
|
+
.should
|
|
34
|
+
.be
|
|
35
|
+
.an("object");
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
describe(
|
|
41
|
+
"submodule: ignores",
|
|
42
|
+
function () {
|
|
43
|
+
it(
|
|
44
|
+
"has scopes",
|
|
45
|
+
function () {
|
|
46
|
+
for (const scope of SCOPE)
|
|
47
|
+
ignores
|
|
48
|
+
.should
|
|
49
|
+
.have
|
|
50
|
+
.own
|
|
51
|
+
.property(scope);
|
|
52
|
+
},
|
|
53
|
+
);
|
|
54
|
+
it(
|
|
55
|
+
"has global scope",
|
|
56
|
+
function () {
|
|
57
|
+
ignores
|
|
58
|
+
.should
|
|
59
|
+
.have
|
|
60
|
+
.own
|
|
61
|
+
.property(GLOBAL_SCOPE);
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
it(
|
|
65
|
+
"of arrays",
|
|
66
|
+
function () {
|
|
67
|
+
for (const scope of Object.values(ignores))
|
|
68
|
+
scope
|
|
69
|
+
|
|
70
|
+
.should
|
|
71
|
+
.be
|
|
72
|
+
.an("array");
|
|
73
|
+
},
|
|
74
|
+
);
|
|
75
|
+
it(
|
|
76
|
+
"of strings",
|
|
77
|
+
function () {
|
|
78
|
+
for (const scope of Object.values(ignores))
|
|
79
|
+
for (const pattern of scope)
|
|
80
|
+
pattern
|
|
81
|
+
.should
|
|
82
|
+
.be
|
|
83
|
+
.a("string");
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
it(
|
|
87
|
+
"with at least one global ignore pattern",
|
|
88
|
+
function () {
|
|
89
|
+
ignores[GLOBAL_SCOPE]
|
|
90
|
+
.should
|
|
91
|
+
.have
|
|
92
|
+
.lengthOf
|
|
93
|
+
.above(0);
|
|
94
|
+
},
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
);
|
|
98
|
+
describe(
|
|
99
|
+
"submodule: files",
|
|
100
|
+
function () {
|
|
101
|
+
it(
|
|
102
|
+
"has scopes",
|
|
103
|
+
function () {
|
|
104
|
+
for (const scope of SCOPE)
|
|
105
|
+
files
|
|
106
|
+
.should
|
|
107
|
+
.have
|
|
108
|
+
.own
|
|
109
|
+
.property(scope);
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
it(
|
|
113
|
+
"NO global scope",
|
|
114
|
+
function () {
|
|
115
|
+
files
|
|
116
|
+
.should
|
|
117
|
+
.not
|
|
118
|
+
.have
|
|
119
|
+
.own
|
|
120
|
+
.property(GLOBAL_SCOPE);
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
|
+
it(
|
|
124
|
+
"of arrays",
|
|
125
|
+
function () {
|
|
126
|
+
for (const scope of Object.values(files))
|
|
127
|
+
scope
|
|
128
|
+
|
|
129
|
+
.should
|
|
130
|
+
.be
|
|
131
|
+
.an("array");
|
|
132
|
+
},
|
|
133
|
+
);
|
|
134
|
+
it(
|
|
135
|
+
"of strings",
|
|
136
|
+
function () {
|
|
137
|
+
for (const scope of Object.values(files))
|
|
138
|
+
for (const pattern of scope)
|
|
139
|
+
pattern
|
|
140
|
+
.should
|
|
141
|
+
.be
|
|
142
|
+
.a("string");
|
|
143
|
+
},
|
|
144
|
+
);
|
|
145
|
+
},
|
|
146
|
+
);
|
|
147
|
+
describe(
|
|
148
|
+
"submodule: rules",
|
|
149
|
+
function () {
|
|
150
|
+
it(
|
|
151
|
+
"has scopes",
|
|
152
|
+
function () {
|
|
153
|
+
for (const scope of SCOPE)
|
|
154
|
+
rules
|
|
155
|
+
.should
|
|
156
|
+
.have
|
|
157
|
+
.own
|
|
158
|
+
.property(scope);
|
|
159
|
+
},
|
|
160
|
+
);
|
|
161
|
+
it(
|
|
162
|
+
"NO global scope",
|
|
163
|
+
function () {
|
|
164
|
+
rules
|
|
165
|
+
.should
|
|
166
|
+
.not
|
|
167
|
+
.have
|
|
168
|
+
.own
|
|
169
|
+
.property(GLOBAL_SCOPE);
|
|
170
|
+
},
|
|
171
|
+
);
|
|
172
|
+
it(
|
|
173
|
+
"of arrays",
|
|
174
|
+
function () {
|
|
175
|
+
for (const scope of Object.values(files))
|
|
176
|
+
scope
|
|
177
|
+
|
|
178
|
+
.should
|
|
179
|
+
.be
|
|
180
|
+
.an("array");
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
it(
|
|
184
|
+
"of object",
|
|
185
|
+
function () {
|
|
186
|
+
for (const scope of Object.values(rules))
|
|
187
|
+
for (const rule of scope)
|
|
188
|
+
rule
|
|
189
|
+
.should
|
|
190
|
+
.be
|
|
191
|
+
.an("object");
|
|
192
|
+
},
|
|
193
|
+
);
|
|
194
|
+
it(
|
|
195
|
+
"named rulesets",
|
|
196
|
+
function () {
|
|
197
|
+
for (const scope of Object.values(rules))
|
|
198
|
+
for (const rule of scope) {
|
|
199
|
+
rule
|
|
200
|
+
.should
|
|
201
|
+
.have
|
|
202
|
+
.keys(
|
|
203
|
+
"id",
|
|
204
|
+
"rules",
|
|
205
|
+
);
|
|
206
|
+
rule
|
|
207
|
+
.id
|
|
208
|
+
.should
|
|
209
|
+
.be
|
|
210
|
+
.a("string");
|
|
211
|
+
rule
|
|
212
|
+
.rules
|
|
213
|
+
.should
|
|
214
|
+
.be
|
|
215
|
+
.an("object");
|
|
216
|
+
|
|
217
|
+
for (const key of Object.keys(rule.rules))
|
|
218
|
+
key
|
|
219
|
+
.should
|
|
220
|
+
.be
|
|
221
|
+
.a("string");
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
},
|
|
228
|
+
);
|
package/src/index.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import "chai/register-should.js";
|
|
2
2
|
import * as State from "./state";
|
|
3
3
|
|
|
4
|
-
const state = { ...State };
|
|
5
|
-
|
|
6
4
|
describe(
|
|
7
|
-
"Strings:
|
|
5
|
+
"Strings: State",
|
|
8
6
|
function () {
|
|
7
|
+
const state = { ...State };
|
|
8
|
+
|
|
9
9
|
describe(
|
|
10
10
|
"shape",
|
|
11
11
|
function () {
|
|
12
12
|
it(
|
|
13
|
-
"is module
|
|
13
|
+
"is object module",
|
|
14
14
|
function () {
|
|
15
15
|
state
|
|
16
|
-
.should
|
|
16
|
+
.should
|
|
17
|
+
.be
|
|
17
18
|
.an("object");
|
|
18
19
|
},
|
|
19
20
|
);
|
|
20
21
|
},
|
|
21
22
|
);
|
|
22
23
|
describe(
|
|
23
|
-
"
|
|
24
|
+
"keys",
|
|
24
25
|
function () {
|
|
26
|
+
const keys = Object.keys(state);
|
|
27
|
+
|
|
25
28
|
it(
|
|
26
|
-
"
|
|
29
|
+
"count 3",
|
|
27
30
|
function () {
|
|
28
|
-
|
|
29
|
-
.should
|
|
31
|
+
keys
|
|
32
|
+
.should
|
|
33
|
+
.have
|
|
30
34
|
.lengthOf(3);
|
|
31
35
|
},
|
|
32
36
|
);
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
describe(
|
|
36
|
-
"unique count",
|
|
37
|
-
function () {
|
|
38
37
|
it(
|
|
39
|
-
"
|
|
38
|
+
"unique count 3",
|
|
40
39
|
function () {
|
|
41
|
-
new
|
|
42
|
-
.should
|
|
40
|
+
new Set(keys)
|
|
41
|
+
.should
|
|
42
|
+
.have
|
|
43
43
|
.lengthOf(3);
|
|
44
44
|
},
|
|
45
45
|
);
|
|
@@ -49,13 +49,18 @@ describe(
|
|
|
49
49
|
"values",
|
|
50
50
|
function () {
|
|
51
51
|
it(
|
|
52
|
-
"
|
|
52
|
+
"off(0) | warn(1) | error(2)",
|
|
53
53
|
function () {
|
|
54
|
-
new
|
|
54
|
+
new Set(Object.values(state))
|
|
55
55
|
.should
|
|
56
|
-
.
|
|
57
|
-
.
|
|
58
|
-
|
|
56
|
+
.have
|
|
57
|
+
.members(
|
|
58
|
+
[
|
|
59
|
+
0,
|
|
60
|
+
1,
|
|
61
|
+
2,
|
|
62
|
+
],
|
|
63
|
+
);
|
|
59
64
|
},
|
|
60
65
|
);
|
|
61
66
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export const
|
|
2
|
-
OFF =
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
OFF = 0,
|
|
3
|
+
WARN = 1,
|
|
4
|
+
ON = 2;
|
package/src/rules/yml/enable.ts
CHANGED
|
@@ -27,6 +27,6 @@ export const YmlEnablePlugin = {
|
|
|
27
27
|
"yml/require-string-key": ON,
|
|
28
28
|
// "yml/sort-keys": OFF,
|
|
29
29
|
// "yml/sort-sequence-values": OFF,
|
|
30
|
-
"yml/vue-custom-block/no-parsing-error":
|
|
30
|
+
// "yml/vue-custom-block/no-parsing-error": OFF /* I don't use Vue and I plan to continue not using it if I can help it */,
|
|
31
31
|
} as const,
|
|
32
32
|
};
|