@zthun/janitor-options 19.2.0 → 19.2.2
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.cjs +245 -232
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +242 -234
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents options for linting in the zthunworks janitor system.
|
|
3
|
+
*/ function _define_property$1(obj, key, value) {
|
|
4
|
+
if (key in obj) {
|
|
5
|
+
Object.defineProperty(obj, key, {
|
|
6
|
+
value: value,
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true
|
|
10
|
+
});
|
|
11
|
+
} else {
|
|
12
|
+
obj[key] = value;
|
|
13
|
+
}
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A builder for creating linting options for the zthunworks janitor system.
|
|
18
|
+
*/ class ZJanitorOptionsLintBuilder {
|
|
19
|
+
/**
|
|
6
20
|
* Sets the path to the config file for eslint.
|
|
7
21
|
*
|
|
8
22
|
* @param esConfig -
|
|
@@ -10,12 +24,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
10
24
|
*
|
|
11
25
|
* @returns
|
|
12
26
|
* This object.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
/**
|
|
27
|
+
*/ esConfig(esConfig) {
|
|
28
|
+
this.lint.esConfig = esConfig;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
19
32
|
* Sets the path to the config file for htmlhint.
|
|
20
33
|
*
|
|
21
34
|
* @param htmlConfig -
|
|
@@ -23,12 +36,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
23
36
|
*
|
|
24
37
|
* @returns
|
|
25
38
|
* This object.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
39
|
+
*/ htmlConfig(htmlConfig) {
|
|
40
|
+
this.lint.htmlConfig = htmlConfig;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
32
44
|
* Sets the path to the config file for markdownlint.
|
|
33
45
|
*
|
|
34
46
|
* @param markdownConfig -
|
|
@@ -36,12 +48,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
36
48
|
*
|
|
37
49
|
* @returns
|
|
38
50
|
* This object.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
51
|
+
*/ markdownConfig(markdownConfig) {
|
|
52
|
+
this.lint.markdownConfig = markdownConfig;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
45
56
|
* Sets the path to the config file for prettier.
|
|
46
57
|
*
|
|
47
58
|
* @param prettyConfig -
|
|
@@ -49,12 +60,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
49
60
|
*
|
|
50
61
|
* @returns
|
|
51
62
|
* This object.
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/**
|
|
63
|
+
*/ prettyConfig(prettyConfig) {
|
|
64
|
+
this.lint.prettyConfig = prettyConfig;
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
58
68
|
* Sets the path to the config file for cspell.
|
|
59
69
|
*
|
|
60
70
|
* @param spellingConfig -
|
|
@@ -62,12 +72,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
62
72
|
*
|
|
63
73
|
* @returns
|
|
64
74
|
* This object.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
75
|
+
*/ spellingConfig(spellingConfig) {
|
|
76
|
+
this.lint.spellingConfig = spellingConfig;
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
71
80
|
* Sets the path to the config file for stylelint.
|
|
72
81
|
*
|
|
73
82
|
* @param styleConfig -
|
|
@@ -75,12 +84,11 @@ class ZJanitorOptionsLintBuilder {
|
|
|
75
84
|
*
|
|
76
85
|
* @returns
|
|
77
86
|
* This object.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/**
|
|
87
|
+
*/ styleConfig(styleConfig) {
|
|
88
|
+
this.lint.styleConfig = styleConfig;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
84
92
|
* Adds a list of globs to the list of files to lint with eslint.
|
|
85
93
|
*
|
|
86
94
|
* @param file -
|
|
@@ -88,13 +96,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
88
96
|
*
|
|
89
97
|
* @returns
|
|
90
98
|
* This object.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
*/ esFile(file = []) {
|
|
100
|
+
var _this_lint_esFiles;
|
|
101
|
+
const files = (_this_lint_esFiles = this.lint.esFiles) !== null && _this_lint_esFiles !== void 0 ? _this_lint_esFiles : [];
|
|
102
|
+
this.lint.esFiles = files.concat(file);
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
98
106
|
* Adds a list of globs to the list of files to lint with htmlhint.
|
|
99
107
|
*
|
|
100
108
|
* @param file -
|
|
@@ -102,13 +110,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
102
110
|
*
|
|
103
111
|
* @returns
|
|
104
112
|
* This object.
|
|
105
|
-
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
*/ htmlFile(file = []) {
|
|
114
|
+
var _this_lint_htmlFiles;
|
|
115
|
+
const files = (_this_lint_htmlFiles = this.lint.htmlFiles) !== null && _this_lint_htmlFiles !== void 0 ? _this_lint_htmlFiles : [];
|
|
116
|
+
this.lint.htmlFiles = files.concat(file);
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
112
120
|
* Adds a list of globs to the list of files to lint with json.
|
|
113
121
|
*
|
|
114
122
|
* @param file -
|
|
@@ -116,13 +124,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
116
124
|
*
|
|
117
125
|
* @returns
|
|
118
126
|
* This object.
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
*/ jsonFile(file = []) {
|
|
128
|
+
var _this_lint_jsonFiles;
|
|
129
|
+
const files = (_this_lint_jsonFiles = this.lint.jsonFiles) !== null && _this_lint_jsonFiles !== void 0 ? _this_lint_jsonFiles : [];
|
|
130
|
+
this.lint.jsonFiles = files.concat(file);
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
126
134
|
* Adds a list of globs to the list of files to lint with markdownlint.
|
|
127
135
|
*
|
|
128
136
|
* @param file -
|
|
@@ -130,13 +138,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
130
138
|
*
|
|
131
139
|
* @returns
|
|
132
140
|
* This object.
|
|
133
|
-
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
*/ markdownFile(file = []) {
|
|
142
|
+
var _this_lint_markdownFiles;
|
|
143
|
+
const files = (_this_lint_markdownFiles = this.lint.markdownFiles) !== null && _this_lint_markdownFiles !== void 0 ? _this_lint_markdownFiles : [];
|
|
144
|
+
this.lint.markdownFiles = files.concat(file);
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
140
148
|
* Adds a list of globs to the list of files to lint with prettier.
|
|
141
149
|
*
|
|
142
150
|
* @param file -
|
|
@@ -144,13 +152,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
144
152
|
*
|
|
145
153
|
* @returns
|
|
146
154
|
* This object.
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
*/ prettyFile(file = []) {
|
|
156
|
+
var _this_lint_prettyFiles;
|
|
157
|
+
const files = (_this_lint_prettyFiles = this.lint.prettyFiles) !== null && _this_lint_prettyFiles !== void 0 ? _this_lint_prettyFiles : [];
|
|
158
|
+
this.lint.prettyFiles = files.concat(file);
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
154
162
|
* Adds a list of globs to the list of files to lint with cspell.
|
|
155
163
|
*
|
|
156
164
|
* @param file -
|
|
@@ -158,13 +166,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
158
166
|
*
|
|
159
167
|
* @returns
|
|
160
168
|
* This object.
|
|
161
|
-
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
*/ spellingFile(file = []) {
|
|
170
|
+
var _this_lint_spellingFiles;
|
|
171
|
+
const files = (_this_lint_spellingFiles = this.lint.spellingFiles) !== null && _this_lint_spellingFiles !== void 0 ? _this_lint_spellingFiles : [];
|
|
172
|
+
this.lint.spellingFiles = files.concat(file);
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
168
176
|
* Adds a list of globs to the list of files to lint with stylelint.
|
|
169
177
|
*
|
|
170
178
|
* @param file -
|
|
@@ -172,13 +180,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
172
180
|
*
|
|
173
181
|
* @returns
|
|
174
182
|
* This object.
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
*/ styleFile(file = []) {
|
|
184
|
+
var _this_lint_styleFiles;
|
|
185
|
+
const files = (_this_lint_styleFiles = this.lint.styleFiles) !== null && _this_lint_styleFiles !== void 0 ? _this_lint_styleFiles : [];
|
|
186
|
+
this.lint.styleFiles = files.concat(file);
|
|
187
|
+
return this;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
182
190
|
* Adds a list of globs to the list of files to lint with yaml.
|
|
183
191
|
*
|
|
184
192
|
* @param file -
|
|
@@ -186,13 +194,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
186
194
|
*
|
|
187
195
|
* @returns
|
|
188
196
|
* This object.
|
|
189
|
-
*/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
197
|
+
*/ yamlFile(file = []) {
|
|
198
|
+
var _this_lint_yamlFiles;
|
|
199
|
+
const files = (_this_lint_yamlFiles = this.lint.yamlFiles) !== null && _this_lint_yamlFiles !== void 0 ? _this_lint_yamlFiles : [];
|
|
200
|
+
this.lint.yamlFiles = files.concat(file);
|
|
201
|
+
return this;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
196
204
|
* Adds a list of globs to the list of files to exclude from linting with htmlhint.
|
|
197
205
|
*
|
|
198
206
|
* @param files -
|
|
@@ -200,13 +208,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
200
208
|
*
|
|
201
209
|
* @returns
|
|
202
210
|
* This object.
|
|
203
|
-
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
*/ htmlExclude(files = []) {
|
|
212
|
+
var _this_lint_htmlFilesExclude;
|
|
213
|
+
const excludes = (_this_lint_htmlFilesExclude = this.lint.htmlFilesExclude) !== null && _this_lint_htmlFilesExclude !== void 0 ? _this_lint_htmlFilesExclude : [];
|
|
214
|
+
this.lint.htmlFilesExclude = excludes.concat(files);
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
210
218
|
* Adds a list of globs to the list of files to exclude from linting with json.
|
|
211
219
|
*
|
|
212
220
|
* @param file -
|
|
@@ -214,13 +222,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
214
222
|
*
|
|
215
223
|
* @returns
|
|
216
224
|
* This object.
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
*/ jsonExclude(file = []) {
|
|
226
|
+
var _this_lint_jsonFilesExclude;
|
|
227
|
+
const excludes = (_this_lint_jsonFilesExclude = this.lint.jsonFilesExclude) !== null && _this_lint_jsonFilesExclude !== void 0 ? _this_lint_jsonFilesExclude : [];
|
|
228
|
+
this.lint.jsonFilesExclude = excludes.concat(file);
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
224
232
|
* Adds a list of globs to the list of files to exclude from linting with markdownlint.
|
|
225
233
|
*
|
|
226
234
|
* @param file -
|
|
@@ -228,13 +236,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
228
236
|
*
|
|
229
237
|
* @returns
|
|
230
238
|
* This object.
|
|
231
|
-
*/
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
239
|
+
*/ markdownExclude(file = []) {
|
|
240
|
+
var _this_lint_markdownFilesExclude;
|
|
241
|
+
const excludes = (_this_lint_markdownFilesExclude = this.lint.markdownFilesExclude) !== null && _this_lint_markdownFilesExclude !== void 0 ? _this_lint_markdownFilesExclude : [];
|
|
242
|
+
this.lint.markdownFilesExclude = excludes.concat(file);
|
|
243
|
+
return this;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
238
246
|
* Adds a list of globs to the list of files to exclude from linting with prettier.
|
|
239
247
|
*
|
|
240
248
|
* @param file -
|
|
@@ -242,13 +250,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
242
250
|
*
|
|
243
251
|
* @returns
|
|
244
252
|
* This object.
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
253
|
+
*/ prettyExclude(file = []) {
|
|
254
|
+
var _this_lint_prettyFilesExclude;
|
|
255
|
+
const excludes = (_this_lint_prettyFilesExclude = this.lint.prettyFilesExclude) !== null && _this_lint_prettyFilesExclude !== void 0 ? _this_lint_prettyFilesExclude : [];
|
|
256
|
+
this.lint.prettyFilesExclude = excludes.concat(file);
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
252
260
|
* Adds a list of globs to the list of files to exclude from linting with cspell.
|
|
253
261
|
*
|
|
254
262
|
* @param file -
|
|
@@ -256,13 +264,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
256
264
|
*
|
|
257
265
|
* @returns
|
|
258
266
|
* This object.
|
|
259
|
-
*/
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
267
|
+
*/ spellingExclude(file = []) {
|
|
268
|
+
var _this_lint_spellingFilesExclude;
|
|
269
|
+
const excludes = (_this_lint_spellingFilesExclude = this.lint.spellingFilesExclude) !== null && _this_lint_spellingFilesExclude !== void 0 ? _this_lint_spellingFilesExclude : [];
|
|
270
|
+
this.lint.spellingFilesExclude = excludes.concat(file);
|
|
271
|
+
return this;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
266
274
|
* Adds a list of globs to the list of files to exclude from linting with stylelint.
|
|
267
275
|
*
|
|
268
276
|
* @param file -
|
|
@@ -270,13 +278,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
270
278
|
*
|
|
271
279
|
* @returns
|
|
272
280
|
* This object.
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
*/ styleExclude(file = []) {
|
|
282
|
+
var _this_lint_styleFilesExclude;
|
|
283
|
+
const excludes = (_this_lint_styleFilesExclude = this.lint.styleFilesExclude) !== null && _this_lint_styleFilesExclude !== void 0 ? _this_lint_styleFilesExclude : [];
|
|
284
|
+
this.lint.styleFilesExclude = excludes.concat(file);
|
|
285
|
+
return this;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
280
288
|
* Adds a single file glob to the list of files to exclude from linting with yaml.
|
|
281
289
|
*
|
|
282
290
|
* @param file -
|
|
@@ -284,13 +292,13 @@ class ZJanitorOptionsLintBuilder {
|
|
|
284
292
|
*
|
|
285
293
|
* @returns
|
|
286
294
|
* This object.
|
|
287
|
-
*/
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
295
|
+
*/ yamlExclude(file = []) {
|
|
296
|
+
var _this_lint_yamlFilesExclude;
|
|
297
|
+
const excludes = (_this_lint_yamlFilesExclude = this.lint.yamlFilesExclude) !== null && _this_lint_yamlFilesExclude !== void 0 ? _this_lint_yamlFilesExclude : [];
|
|
298
|
+
this.lint.yamlFilesExclude = excludes.concat(file);
|
|
299
|
+
return this;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
294
302
|
* Adds a file to all exclusion lists.
|
|
295
303
|
*
|
|
296
304
|
* @param file -
|
|
@@ -298,129 +306,130 @@ class ZJanitorOptionsLintBuilder {
|
|
|
298
306
|
*
|
|
299
307
|
* @returns
|
|
300
308
|
* This object.
|
|
301
|
-
*/
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
/**
|
|
309
|
+
*/ excludeAll(file = []) {
|
|
310
|
+
return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).styleExclude(file).yamlExclude(file);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
306
313
|
* Generates the spelling files based on the other files that have been set.
|
|
307
314
|
*
|
|
308
315
|
* @returns
|
|
309
316
|
* This object.
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
/**
|
|
317
|
+
*/ generateSpellingFiles() {
|
|
318
|
+
return this.spellingFile(this.lint.esFiles).spellingFile(this.lint.htmlFiles).spellingFile(this.lint.jsonFiles).spellingFile(this.lint.markdownFiles).spellingFile(this.lint.styleFiles).spellingFile(this.lint.yamlFiles);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
315
321
|
* Generates the pretty files based on the other files that have been set.
|
|
316
322
|
*
|
|
317
323
|
* @returns
|
|
318
324
|
* This object.
|
|
319
|
-
*/
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
/**
|
|
325
|
+
*/ generatePrettyFiles() {
|
|
326
|
+
return this.prettyFile(this.lint.esFiles).prettyFile(this.lint.htmlFiles).prettyFile(this.lint.jsonFiles).prettyFile(this.lint.markdownFiles).prettyFile(this.lint.styleFiles).prettyFile(this.lint.yamlFiles);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
324
329
|
* Adds conventional es files.
|
|
325
330
|
*
|
|
326
331
|
* @returns
|
|
327
332
|
* This object
|
|
328
|
-
*/
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
/**
|
|
333
|
+
*/ commonEsFiles() {
|
|
334
|
+
const extensions = "js,cjs,mjs,ts,mts,jsx,tsx";
|
|
335
|
+
return this.esFile(`*.{${extensions}}`).esFile(`src/**/*.{${extensions}}`).esFile(`features/**/*.{${extensions}}`).esFile(`packages/**/src/**/*.{${extensions}}`).esFile(`packages/**/features/**/*.{${extensions}}`).esFile(`packages/*/vite.config.{${extensions}}`).esFile(`packages/*/vitest.config.{${extensions}}`).esFile(`.config/*.{${extensions}}`);
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
334
338
|
* Adds conventional css files.
|
|
335
339
|
*
|
|
336
340
|
* @returns
|
|
337
341
|
* This object.
|
|
338
|
-
*/
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
/**
|
|
342
|
+
*/ commonCssFiles() {
|
|
343
|
+
return this.styleFile(`src/**/*.css`).styleFile(`packages/**/*.css`).styleFile("styles/**/*.css");
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
343
346
|
* Adds conventional sass files.
|
|
344
347
|
*
|
|
345
348
|
* @returns
|
|
346
349
|
* This object.
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/**
|
|
350
|
+
*/ commonSassFiles() {
|
|
351
|
+
return this.styleFile(`src/**/*.{sass,scss}`).styleFile(`packages/**/src/**/*.{sass,scss}`).styleFile("styles/**/*.{sass,scss}");
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
352
354
|
* Adds conventional less files.
|
|
353
355
|
*
|
|
354
356
|
* @returns
|
|
355
357
|
* This object.
|
|
356
|
-
*/
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
/**
|
|
358
|
+
*/ commonLessFiles() {
|
|
359
|
+
return this.styleFile(`src/**/*.less`).styleFile("packages/**/src/**/*.less").styleFile("styles/**/*.less");
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
361
362
|
* Adds conventional less files.
|
|
362
363
|
*
|
|
363
364
|
* @returns
|
|
364
365
|
* This object.
|
|
365
|
-
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
);
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
366
|
+
*/ commonHtmlFiles() {
|
|
367
|
+
const extensions = "html,htm";
|
|
368
|
+
return this.htmlFile(`src/**/*.{${extensions}}`).htmlFile(`packages/**/src/**/*.{${extensions}}`);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
373
371
|
* Adds conventional markdown files.
|
|
374
372
|
*
|
|
375
373
|
* @returns
|
|
376
374
|
* This object.
|
|
377
|
-
*/
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
/**
|
|
375
|
+
*/ commonMarkdownFiles() {
|
|
376
|
+
return this.markdownFile(`*.md`).markdownFile(`src/**/*.md`).markdownFile(`packages/**/*.md`);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
382
379
|
* Add conventional json files.
|
|
383
380
|
*
|
|
384
381
|
* @returns
|
|
385
382
|
* This object.
|
|
386
|
-
*/
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
/**
|
|
383
|
+
*/ commonJsonFiles() {
|
|
384
|
+
return this.jsonFile("*.json").jsonFile("src/**/*.json").jsonFile("packages/**/*.json").jsonFile(".config/*.json");
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
391
387
|
* Adds conventional yaml files.
|
|
392
388
|
*
|
|
393
389
|
* @returns
|
|
394
390
|
* This object.
|
|
395
|
-
*/
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
/**
|
|
391
|
+
*/ commonYamlFiles() {
|
|
392
|
+
const extensions = "yml,yaml";
|
|
393
|
+
return this.yamlFile(`*.{${extensions}}`).yamlFile(`src/**/*.{${extensions}}`).yamlFile(`packages/**/*.{${extensions}}`).yamlFile(`.config/*.{${extensions}}`).yamlFile(`.circleci/*.{${extensions}}`);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
401
396
|
* Adds conventional exclude files.
|
|
402
397
|
*
|
|
403
398
|
* @returns
|
|
404
399
|
* This object.
|
|
405
|
-
*/
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
/**
|
|
400
|
+
*/ commonExcludes() {
|
|
401
|
+
return this.excludeAll("**/CHANGELOG.md").excludeAll("**/dist/**").excludeAll("**/node_modules/**").excludeAll("package-lock.json").excludeAll("lerna.json").excludeAll("**/cspell.json");
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
410
404
|
* Returns the built linting options object.
|
|
411
405
|
*
|
|
412
406
|
* @returns
|
|
413
407
|
* A clone of the current linting options object.
|
|
414
|
-
*/
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
408
|
+
*/ build() {
|
|
409
|
+
return structuredClone(this.lint);
|
|
410
|
+
}
|
|
411
|
+
constructor(){
|
|
412
|
+
_define_property$1(this, "lint", {});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function _define_property(obj, key, value) {
|
|
417
|
+
if (key in obj) {
|
|
418
|
+
Object.defineProperty(obj, key, {
|
|
419
|
+
value: value,
|
|
420
|
+
enumerable: true,
|
|
421
|
+
configurable: true,
|
|
422
|
+
writable: true
|
|
423
|
+
});
|
|
424
|
+
} else {
|
|
425
|
+
obj[key] = value;
|
|
426
|
+
}
|
|
427
|
+
return obj;
|
|
418
428
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
/**
|
|
429
|
+
/**
|
|
430
|
+
* A builder for creating janitor options.
|
|
431
|
+
*/ class ZJanitorOptionsBuilder {
|
|
432
|
+
/**
|
|
424
433
|
* Sets the linting options for the janitor system.
|
|
425
434
|
*
|
|
426
435
|
* @param lint -
|
|
@@ -428,23 +437,22 @@ class ZJanitorOptionsBuilder {
|
|
|
428
437
|
*
|
|
429
438
|
* @returns
|
|
430
439
|
* This object.
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
/**
|
|
440
|
+
*/ lint(lint) {
|
|
441
|
+
this.options.lint = lint;
|
|
442
|
+
return this;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
437
445
|
* Builds the options object.
|
|
438
446
|
*
|
|
439
447
|
* @returns
|
|
440
448
|
* A clone of the current options object.
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
449
|
+
*/ build() {
|
|
450
|
+
return structuredClone(this.options);
|
|
451
|
+
}
|
|
452
|
+
constructor(){
|
|
453
|
+
_define_property(this, "options", {});
|
|
454
|
+
}
|
|
445
455
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
ZJanitorOptionsLintBuilder
|
|
449
|
-
};
|
|
456
|
+
|
|
457
|
+
export { ZJanitorOptionsBuilder, ZJanitorOptionsLintBuilder };
|
|
450
458
|
//# sourceMappingURL=index.js.map
|