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