@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.
Files changed (63) hide show
  1. package/dist/index.d.ts +562 -563
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.spec.d.ts +2 -0
  6. package/dist/index.spec.d.ts.map +1 -0
  7. package/dist/index.spec.js +154 -0
  8. package/dist/index.spec.js.map +1 -0
  9. package/dist/rules/_strings/option.d.ts +1 -1
  10. package/dist/rules/_strings/option.d.ts.map +1 -1
  11. package/dist/rules/_strings/option.js +1 -1
  12. package/dist/rules/_strings/option.js.map +1 -1
  13. package/dist/rules/_strings/state.d.ts +1 -1
  14. package/dist/rules/_strings/state.d.ts.map +1 -1
  15. package/dist/rules/_strings/state.js +1 -1
  16. package/dist/rules/_strings/state.js.map +1 -1
  17. package/dist/rules/_strings/state.spec.js +23 -18
  18. package/dist/rules/_strings/state.spec.js.map +1 -1
  19. package/dist/rules/css/enable.d.ts +11 -11
  20. package/dist/rules/css/index.d.ts +11 -11
  21. package/dist/rules/enable.d.ts +148 -148
  22. package/dist/rules/html/index.d.ts +41 -41
  23. package/dist/rules/html/plugin/index.d.ts +41 -41
  24. package/dist/rules/index.d.ts +550 -551
  25. package/dist/rules/index.d.ts.map +1 -1
  26. package/dist/rules/json/enable.d.ts +4 -4
  27. package/dist/rules/json/index.d.ts +42 -42
  28. package/dist/rules/json/plugin/extension.d.ts +19 -19
  29. package/dist/rules/json/plugin/index.d.ts +19 -19
  30. package/dist/rules/jsonc/index.d.ts +1 -1
  31. package/dist/rules/jsonc/plugin/index.d.ts +1 -1
  32. package/dist/rules/jsoncc/index.d.ts +1 -1
  33. package/dist/rules/jsoncc/plugin/index.d.ts +1 -1
  34. package/dist/rules/mocha/chai/expect.d.ts +3 -3
  35. package/dist/rules/mocha/chai/index.d.ts +1 -1
  36. package/dist/rules/mocha/disable.d.ts +2 -2
  37. package/dist/rules/mocha/enable.d.ts +16 -16
  38. package/dist/rules/mocha/index.d.ts +22 -22
  39. package/dist/rules/stylistic.d.ts +67 -67
  40. package/dist/rules/svelte/disable.d.ts +6 -6
  41. package/dist/rules/svelte/enable.d.ts +67 -67
  42. package/dist/rules/svelte/extension/disable.d.ts +3 -3
  43. package/dist/rules/svelte/extension/index.d.ts +2 -2
  44. package/dist/rules/svelte/index.d.ts +78 -78
  45. package/dist/rules/ts/disable.d.ts +19 -19
  46. package/dist/rules/ts/enable.d.ts +86 -86
  47. package/dist/rules/ts/extension/disable.d.ts +8 -8
  48. package/dist/rules/ts/extension/index.d.ts +7 -7
  49. package/dist/rules/ts/index.d.ts +120 -120
  50. package/dist/rules/yml/enable.d.ts +11 -12
  51. package/dist/rules/yml/enable.d.ts.map +1 -1
  52. package/dist/rules/yml/enable.js +0 -1
  53. package/dist/rules/yml/enable.js.map +1 -1
  54. package/dist/rules/yml/extension.d.ts +8 -8
  55. package/dist/rules/yml/index.d.ts +19 -20
  56. package/dist/rules/yml/index.d.ts.map +1 -1
  57. package/package.json +1 -1
  58. package/src/index.spec.ts +228 -0
  59. package/src/index.ts +1 -1
  60. package/src/rules/_strings/option.ts +1 -2
  61. package/src/rules/_strings/state.spec.ts +27 -22
  62. package/src/rules/_strings/state.ts +3 -3
  63. 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
@@ -4,7 +4,7 @@ import { rules } from "./rules";
4
4
 
5
5
  export { settings } from "./settings";
6
6
  export const defaults = {
7
- files,
8
7
  ignores,
8
+ files,
9
9
  rules,
10
10
  };
@@ -25,6 +25,5 @@ never = "never",
25
25
  none = "none",
26
26
  outside = "outside",
27
27
  single = "single",
28
- wildcard = "*",
29
28
  strict = "strict",
30
- zebra = "zebra";
29
+ wildcard = "*";
@@ -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:Level",
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 (converted to object)",
13
+ "is object module",
14
14
  function () {
15
15
  state
16
- .should.be
16
+ .should
17
+ .be
17
18
  .an("object");
18
19
  },
19
20
  );
20
21
  },
21
22
  );
22
23
  describe(
23
- "count",
24
+ "keys",
24
25
  function () {
26
+ const keys = Object.keys(state);
27
+
25
28
  it(
26
- "is 3",
29
+ "count 3",
27
30
  function () {
28
- Object.keys(state)
29
- .should.have
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
- "is 3",
38
+ "unique count 3",
40
39
  function () {
41
- new Map(Object.entries(state))
42
- .should.have
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
- "are: error | warn | off",
52
+ "off(0) | warn(1) | error(2)",
53
53
  function () {
54
- new Map(Object.entries(state))
54
+ new Set(Object.values(state))
55
55
  .should
56
- .include("error")
57
- .and.include("warn")
58
- .and.include("off");
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 = "off",
3
- ON = "error",
4
- WARN = "warn";
2
+ OFF = 0,
3
+ WARN = 1,
4
+ ON = 2;
@@ -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": ON,
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
  };