@zthun/janitor-options 19.0.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/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2024 Anthony Bonta
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Janitor Config
2
+
3
+ Config file builders for the Janitor system.
package/dist/index.cjs ADDED
@@ -0,0 +1,374 @@
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
+ /**
24
+ * Sets the path to the config file for eslint.
25
+ *
26
+ * @param esConfig -
27
+ * The path to the config file for eslint.
28
+ *
29
+ * @returns
30
+ * This object.
31
+ */ esConfig(esConfig) {
32
+ this.lint.esConfig = esConfig;
33
+ return this;
34
+ }
35
+ /**
36
+ * Sets the path to the config file for htmlhint.
37
+ *
38
+ * @param htmlConfig -
39
+ * The path to the config file for htmlhint.
40
+ *
41
+ * @returns
42
+ * This object.
43
+ */ htmlConfig(htmlConfig) {
44
+ this.lint.htmlConfig = htmlConfig;
45
+ return this;
46
+ }
47
+ /**
48
+ * Sets the path to the config file for markdownlint.
49
+ *
50
+ * @param markdownConfig -
51
+ * The path to the config file for markdownlint.
52
+ *
53
+ * @returns
54
+ * This object.
55
+ */ markdownConfig(markdownConfig) {
56
+ this.lint.markdownConfig = markdownConfig;
57
+ return this;
58
+ }
59
+ /**
60
+ * Sets the path to the config file for prettier.
61
+ *
62
+ * @param prettyConfig -
63
+ * The path to the config file for prettier.
64
+ *
65
+ * @returns
66
+ * This object.
67
+ */ prettyConfig(prettyConfig) {
68
+ this.lint.prettyConfig = prettyConfig;
69
+ return this;
70
+ }
71
+ /**
72
+ * Sets the path to the config file for cspell.
73
+ *
74
+ * @param spellingConfig -
75
+ * The path to the config file for cspell.
76
+ *
77
+ * @returns
78
+ * This object.
79
+ */ spellingConfig(spellingConfig) {
80
+ this.lint.spellingConfig = spellingConfig;
81
+ return this;
82
+ }
83
+ /**
84
+ * Sets the path to the config file for stylelint.
85
+ *
86
+ * @param styleConfig -
87
+ * The path to the config file for stylelint.
88
+ *
89
+ * @returns
90
+ * This object.
91
+ */ styleConfig(styleConfig) {
92
+ this.lint.styleConfig = styleConfig;
93
+ return this;
94
+ }
95
+ /**
96
+ * Adds a list of globs to the list of files to lint with eslint.
97
+ *
98
+ * @param file -
99
+ * The file globs to lint with eslint.
100
+ *
101
+ * @returns
102
+ * This object.
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
+ /**
110
+ * Adds a list of globs to the list of files to lint with htmlhint.
111
+ *
112
+ * @param file -
113
+ * The file globs to lint with htmlhint.
114
+ *
115
+ * @returns
116
+ * This object.
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
+ /**
124
+ * Adds a list of globs to the list of files to lint with json.
125
+ *
126
+ * @param file -
127
+ * The file globs to lint with json.
128
+ *
129
+ * @returns
130
+ * This object.
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
+ /**
138
+ * Adds a list of globs to the list of files to lint with markdownlint.
139
+ *
140
+ * @param file -
141
+ * The globs to lint with markdownlint.
142
+ *
143
+ * @returns
144
+ * This object.
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
+ /**
152
+ * Adds a list of globs to the list of files to lint with prettier.
153
+ *
154
+ * @param file -
155
+ * The globs to lint with prettier.
156
+ *
157
+ * @returns
158
+ * This object.
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
+ /**
166
+ * Adds a list of globs to the list of files to lint with cspell.
167
+ *
168
+ * @param file -
169
+ * The file globs to lint with cspell.
170
+ *
171
+ * @returns
172
+ * This object.
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
+ /**
180
+ * Adds a list of globs to the list of files to lint with stylelint.
181
+ *
182
+ * @param file -
183
+ * The file globs to lint with stylelint.
184
+ *
185
+ * @returns
186
+ * This object.
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
+ /**
194
+ * Adds a list of globs to the list of files to lint with yaml.
195
+ *
196
+ * @param file -
197
+ * The file globs to lint with yaml.
198
+ *
199
+ * @returns
200
+ * This object.
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
+ /**
208
+ * Adds a list of globs to the list of files to exclude from linting with htmlhint.
209
+ *
210
+ * @param files -
211
+ * The file globs to exclude from linting with htmlhint.
212
+ *
213
+ * @returns
214
+ * This object.
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
+ /**
222
+ * Adds a list of globs to the list of files to exclude from linting with json.
223
+ *
224
+ * @param file -
225
+ * The globs to exclude from linting with json.
226
+ *
227
+ * @returns
228
+ * This object.
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
+ /**
236
+ * Adds a list of globs to the list of files to exclude from linting with markdownlint.
237
+ *
238
+ * @param file -
239
+ * The globs to exclude from linting with markdownlint.
240
+ *
241
+ * @returns
242
+ * This object.
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
+ /**
250
+ * Adds a list of globs to the list of files to exclude from linting with prettier.
251
+ *
252
+ * @param file -
253
+ * The globs to exclude from linting with prettier.
254
+ *
255
+ * @returns
256
+ * This object.
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
+ /**
264
+ * Adds a list of globs to the list of files to exclude from linting with cspell.
265
+ *
266
+ * @param file -
267
+ * The globs to exclude from linting with cspell.
268
+ *
269
+ * @returns
270
+ * This object.
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
+ /**
278
+ * Adds a single file glob to the list of files to exclude from linting with yaml.
279
+ *
280
+ * @param file -
281
+ * The file glob to exclude from linting with yaml.
282
+ *
283
+ * @returns
284
+ * This object.
285
+ */ yamlExclude(file = []) {
286
+ var _this_lint_yamlFilesExclude;
287
+ const excludes = (_this_lint_yamlFilesExclude = this.lint.yamlFilesExclude) !== null && _this_lint_yamlFilesExclude !== void 0 ? _this_lint_yamlFilesExclude : [];
288
+ this.lint.yamlFilesExclude = excludes.concat(file);
289
+ return this;
290
+ }
291
+ /**
292
+ * Adds a file to all exclusion lists.
293
+ *
294
+ * @param file -
295
+ * The file to exclude from all linting.
296
+ *
297
+ * @returns
298
+ * This object.
299
+ */ excludeAll(file = []) {
300
+ return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).yamlExclude(file);
301
+ }
302
+ /**
303
+ * Generates the spelling files based on the other files that have been set.
304
+ *
305
+ * @returns
306
+ * This object.
307
+ */ generateSpellingFiles() {
308
+ 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);
309
+ }
310
+ /**
311
+ * Generates the pretty files based on the other files that have been set.
312
+ *
313
+ * @returns
314
+ * This object.
315
+ */ generatePrettyFiles() {
316
+ 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);
317
+ }
318
+ /**
319
+ * Returns the built linting options object.
320
+ *
321
+ * @returns
322
+ * A clone of the current linting options object.
323
+ */ build() {
324
+ return structuredClone(this.lint);
325
+ }
326
+ constructor(){
327
+ _define_property$1(this, "lint", {});
328
+ }
329
+ }
330
+
331
+ function _define_property(obj, key, value) {
332
+ if (key in obj) {
333
+ Object.defineProperty(obj, key, {
334
+ value: value,
335
+ enumerable: true,
336
+ configurable: true,
337
+ writable: true
338
+ });
339
+ } else {
340
+ obj[key] = value;
341
+ }
342
+ return obj;
343
+ }
344
+ /**
345
+ * A builder for creating janitor options.
346
+ */ class ZJanitorOptionsBuilder {
347
+ /**
348
+ * Sets the linting options for the janitor system.
349
+ *
350
+ * @param lint -
351
+ * The linting options to set.
352
+ *
353
+ * @returns
354
+ * This object.
355
+ */ lint(lint) {
356
+ this.options.lint = lint;
357
+ return this;
358
+ }
359
+ /**
360
+ * Builds the options object.
361
+ *
362
+ * @returns
363
+ * A clone of the current options object.
364
+ */ build() {
365
+ return structuredClone(this.options);
366
+ }
367
+ constructor(){
368
+ _define_property(this, "options", {});
369
+ }
370
+ }
371
+
372
+ exports.ZJanitorOptionsBuilder = ZJanitorOptionsBuilder;
373
+ exports.ZJanitorOptionsLintBuilder = ZJanitorOptionsLintBuilder;
374
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/options/janitor-options-lint.mts","../src/options/janitor-options.mts"],"sourcesContent":["/**\n * Represents options for linting in the zthunworks janitor system.\n */\nexport interface IZJanitorOptionsLint {\n /**\n * The path to the config file for eslint.\n */\n esConfig?: string;\n /**\n * The path to the config file for htmlhint.\n */\n htmlConfig?: string;\n /**\n * The path to the config file for markdownlint.\n */\n markdownConfig?: string;\n /**\n * The path to the config file for prettier.\n */\n prettyConfig?: string;\n /**\n * The path to the config file for cspell.\n */\n spellingConfig?: string;\n /**\n * The path to the config file for stylelint.\n */\n styleConfig?: string;\n\n /**\n * The file globs to lint with eslint.\n */\n esFiles?: string[];\n /**\n * The file globs to lint with htmlhint.\n */\n htmlFiles?: string[];\n /**\n * The file globs to lint with json.\n */\n jsonFiles?: string[];\n /**\n * The file globs to lint with markdownlint.\n */\n markdownFiles?: string[];\n /**\n * The file globs to lint with prettier.\n */\n prettyFiles?: string[];\n /**\n * The file globs to lint with cspell.\n */\n spellingFiles?: string[];\n /**\n * The file globs to lint with stylelint.\n */\n styleFiles?: string[];\n /**\n * The file globs to lint with yaml.\n */\n yamlFiles?: string[];\n\n /**\n * The files globs to exclude from linting with htmlhint.\n */\n htmlFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with json.\n */\n jsonFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with markdownlint.\n */\n markdownFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with prettier.\n */\n prettyFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with cspell.\n */\n spellingFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with yaml.\n */\n yamlFilesExclude?: string[];\n}\n\n/**\n * A builder for creating linting options for the zthunworks janitor system.\n */\nexport class ZJanitorOptionsLintBuilder {\n private lint: IZJanitorOptionsLint = {};\n\n /**\n * Sets the path to the config file for eslint.\n *\n * @param esConfig -\n * The path to the config file for eslint.\n *\n * @returns\n * This object.\n */\n public esConfig(esConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.esConfig = esConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for htmlhint.\n *\n * @param htmlConfig -\n * The path to the config file for htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlConfig(htmlConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.htmlConfig = htmlConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for markdownlint.\n *\n * @param markdownConfig -\n * The path to the config file for markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownConfig(markdownConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.markdownConfig = markdownConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for prettier.\n *\n * @param prettyConfig -\n * The path to the config file for prettier.\n *\n * @returns\n * This object.\n */\n public prettyConfig(prettyConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.prettyConfig = prettyConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for cspell.\n *\n * @param spellingConfig -\n * The path to the config file for cspell.\n *\n * @returns\n * This object.\n */\n public spellingConfig(spellingConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.spellingConfig = spellingConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for stylelint.\n *\n * @param styleConfig -\n * The path to the config file for stylelint.\n *\n * @returns\n * This object.\n */\n public styleConfig(styleConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.styleConfig = styleConfig;\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with eslint.\n *\n * @param file -\n * The file globs to lint with eslint.\n *\n * @returns\n * This object.\n */\n public esFile(file: string | string[] = []) {\n const files = this.lint.esFiles ?? [];\n this.lint.esFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with htmlhint.\n *\n * @param file -\n * The file globs to lint with htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlFile(file: string | string[] = []) {\n const files = this.lint.htmlFiles ?? [];\n this.lint.htmlFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with json.\n *\n * @param file -\n * The file globs to lint with json.\n *\n * @returns\n * This object.\n */\n public jsonFile(file: string | string[] = []) {\n const files = this.lint.jsonFiles ?? [];\n this.lint.jsonFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with markdownlint.\n *\n * @param file -\n * The globs to lint with markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownFile(file: string | string[] = []) {\n const files = this.lint.markdownFiles ?? [];\n this.lint.markdownFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with prettier.\n *\n * @param file -\n * The globs to lint with prettier.\n *\n * @returns\n * This object.\n */\n public prettyFile(file: string | string[] = []) {\n const files = this.lint.prettyFiles ?? [];\n this.lint.prettyFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with cspell.\n *\n * @param file -\n * The file globs to lint with cspell.\n *\n * @returns\n * This object.\n */\n public spellingFile(file: string | string[] = []) {\n const files = this.lint.spellingFiles ?? [];\n this.lint.spellingFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with stylelint.\n *\n * @param file -\n * The file globs to lint with stylelint.\n *\n * @returns\n * This object.\n */\n public styleFile(file: string | string[] = []) {\n const files = this.lint.styleFiles ?? [];\n this.lint.styleFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with yaml.\n *\n * @param file -\n * The file globs to lint with yaml.\n *\n * @returns\n * This object.\n */\n public yamlFile(file: string | string[] = []) {\n const files = this.lint.yamlFiles ?? [];\n this.lint.yamlFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with htmlhint.\n *\n * @param files -\n * The file globs to exclude from linting with htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlExclude(files: string | string[] = []) {\n const excludes = this.lint.htmlFilesExclude ?? [];\n this.lint.htmlFilesExclude = excludes.concat(files);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with json.\n *\n * @param file -\n * The globs to exclude from linting with json.\n *\n * @returns\n * This object.\n */\n public jsonExclude(file: string | string[] = []) {\n const excludes = this.lint.jsonFilesExclude ?? [];\n this.lint.jsonFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with markdownlint.\n *\n * @param file -\n * The globs to exclude from linting with markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownExclude(file: string | string[] = []) {\n const excludes = this.lint.markdownFilesExclude ?? [];\n this.lint.markdownFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with prettier.\n *\n * @param file -\n * The globs to exclude from linting with prettier.\n *\n * @returns\n * This object.\n */\n public prettyExclude(file: string | string[] = []) {\n const excludes = this.lint.prettyFilesExclude ?? [];\n this.lint.prettyFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with cspell.\n *\n * @param file -\n * The globs to exclude from linting with cspell.\n *\n * @returns\n * This object.\n */\n public spellingExclude(file: string | string[] = []) {\n const excludes = this.lint.spellingFilesExclude ?? [];\n this.lint.spellingFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a single file glob to the list of files to exclude from linting with yaml.\n *\n * @param file -\n * The file glob to exclude from linting with yaml.\n *\n * @returns\n * This object.\n */\n public yamlExclude(file: string | string[] = []) {\n const excludes = this.lint.yamlFilesExclude ?? [];\n this.lint.yamlFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a file to all exclusion lists.\n *\n * @param file -\n * The file to exclude from all linting.\n *\n * @returns\n * This object.\n */\n public excludeAll(file: string | string[] = []) {\n return this.htmlExclude(file)\n .jsonExclude(file)\n .markdownExclude(file)\n .prettyExclude(file)\n .spellingExclude(file)\n .yamlExclude(file);\n }\n\n /**\n * Generates the spelling files based on the other files that have been set.\n *\n * @returns\n * This object.\n */\n public generateSpellingFiles() {\n return this.spellingFile(this.lint.esFiles)\n .spellingFile(this.lint.htmlFiles)\n .spellingFile(this.lint.jsonFiles)\n .spellingFile(this.lint.markdownFiles)\n .spellingFile(this.lint.styleFiles)\n .spellingFile(this.lint.yamlFiles);\n }\n\n /**\n * Generates the pretty files based on the other files that have been set.\n *\n * @returns\n * This object.\n */\n public generatePrettyFiles() {\n return this.prettyFile(this.lint.esFiles)\n .prettyFile(this.lint.htmlFiles)\n .prettyFile(this.lint.jsonFiles)\n .prettyFile(this.lint.markdownFiles)\n .prettyFile(this.lint.styleFiles)\n .prettyFile(this.lint.yamlFiles);\n }\n\n /**\n * Returns the built linting options object.\n *\n * @returns\n * A clone of the current linting options object.\n */\n public build() {\n return structuredClone(this.lint);\n }\n}\n","import { IZJanitorOptionsLint } from \"./janitor-options-lint.mjs\";\n\n/**\n * Options for the zthunworks janitor system.\n */\nexport interface IZJanitorOptions {\n /**\n * Linting options for janitor-lint.\n */\n lint?: IZJanitorOptionsLint;\n}\n\n/**\n * A builder for creating janitor options.\n */\nexport class ZJanitorOptionsBuilder {\n private options: IZJanitorOptions = {};\n\n /**\n * Sets the linting options for the janitor system.\n *\n * @param lint -\n * The linting options to set.\n *\n * @returns\n * This object.\n */\n public lint(lint: IZJanitorOptionsLint): ZJanitorOptionsBuilder {\n this.options.lint = lint;\n return this;\n }\n\n /**\n * Builds the options object.\n *\n * @returns\n * A clone of the current options object.\n */\n public build(): IZJanitorOptions {\n return structuredClone(this.options);\n }\n}\n"],"names":["_define_property","ZJanitorOptionsLintBuilder","esConfig","lint","htmlConfig","markdownConfig","prettyConfig","spellingConfig","styleConfig","esFile","file","files","esFiles","concat","htmlFile","htmlFiles","jsonFile","jsonFiles","markdownFile","markdownFiles","prettyFile","prettyFiles","spellingFile","spellingFiles","styleFile","styleFiles","yamlFile","yamlFiles","htmlExclude","excludes","htmlFilesExclude","jsonExclude","jsonFilesExclude","markdownExclude","markdownFilesExclude","prettyExclude","prettyFilesExclude","spellingExclude","spellingFilesExclude","yamlExclude","yamlFilesExclude","excludeAll","structuredClone","ZJanitorOptionsBuilder","options"],"mappings":";;;;AAAA;;AAEC,IAAA,SAAAA,kBAAA,CAAA,GAAA,EAAA,GAAA,EAAA,KAAA,EAAA;;;;;;;;;;;;;AAsFD;;AAEC,IACM,MAAMC,0BAAAA,CAAAA;AAGX;;;;;;;;MASOC,QAASA,CAAAA,QAAgB,EAA8B;AAC5D,QAAA,IAAI,CAACC,IAAI,CAACD,QAAQ,GAAGA,QAAAA;AACrB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;MASOE,UAAWA,CAAAA,UAAkB,EAA8B;AAChE,QAAA,IAAI,CAACD,IAAI,CAACC,UAAU,GAAGA,UAAAA;AACvB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;MASOC,cAAeA,CAAAA,cAAsB,EAA8B;AACxE,QAAA,IAAI,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UAAU,CACjCH,CAAAA,YAAY,CAAC,IAAI,CAACnB,IAAI,CAACwB,SAAS,CAAA;AACrC;AAEA;;;;;AAKC,MACD,mBAA6B,GAAA;QAC3B,OAAO,IAAI,CAACP,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACS,OAAO,CACrCQ,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACY,SAAS,EAC9BK,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACc,SAAS,CAC9BG,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACgB,aAAa,CAClCC,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACsB,UAAU,CAC/BL,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACwB,SAAS,CAAA;AACnC;AAEA;;;;;AAKC,MACD,KAAe,GAAA;QACb,OAAOe,eAAAA,CAAgB,IAAI,CAACvC,IAAI,CAAA;AAClC;;AAhWA,QAAAH,kBAAA,CAAA,IAAA,EAAQG,QAA6B,EAAC,CAAA;;AAiWxC;;;;;;;;;;;;;;;ACjbA;;AAEC,IACM,MAAMwC,sBAAAA,CAAAA;AAGX;;;;;;;;MASOxC,IAAKA,CAAAA,IAA0B,EAA0B;AAC9D,QAAA,IAAI,CAACyC,OAAO,CAACzC,IAAI,GAAGA,IAAAA;AACpB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;AAKC,MACD,KAAiC,GAAA;QAC/B,OAAOuC,eAAAA,CAAgB,IAAI,CAACE,OAAO,CAAA;AACrC;;AAxBA,QAAA,gBAAA,CAAA,IAAA,EAAQA,WAA4B,EAAC,CAAA;;AAyBvC;;;;;"}
@@ -0,0 +1,2 @@
1
+ export * from './options/janitor-options-lint.mjs';
2
+ export * from './options/janitor-options.mjs';
package/dist/index.js ADDED
@@ -0,0 +1,369 @@
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
+ /**
20
+ * Sets the path to the config file for eslint.
21
+ *
22
+ * @param esConfig -
23
+ * The path to the config file for eslint.
24
+ *
25
+ * @returns
26
+ * This object.
27
+ */ esConfig(esConfig) {
28
+ this.lint.esConfig = esConfig;
29
+ return this;
30
+ }
31
+ /**
32
+ * Sets the path to the config file for htmlhint.
33
+ *
34
+ * @param htmlConfig -
35
+ * The path to the config file for htmlhint.
36
+ *
37
+ * @returns
38
+ * This object.
39
+ */ htmlConfig(htmlConfig) {
40
+ this.lint.htmlConfig = htmlConfig;
41
+ return this;
42
+ }
43
+ /**
44
+ * Sets the path to the config file for markdownlint.
45
+ *
46
+ * @param markdownConfig -
47
+ * The path to the config file for markdownlint.
48
+ *
49
+ * @returns
50
+ * This object.
51
+ */ markdownConfig(markdownConfig) {
52
+ this.lint.markdownConfig = markdownConfig;
53
+ return this;
54
+ }
55
+ /**
56
+ * Sets the path to the config file for prettier.
57
+ *
58
+ * @param prettyConfig -
59
+ * The path to the config file for prettier.
60
+ *
61
+ * @returns
62
+ * This object.
63
+ */ prettyConfig(prettyConfig) {
64
+ this.lint.prettyConfig = prettyConfig;
65
+ return this;
66
+ }
67
+ /**
68
+ * Sets the path to the config file for cspell.
69
+ *
70
+ * @param spellingConfig -
71
+ * The path to the config file for cspell.
72
+ *
73
+ * @returns
74
+ * This object.
75
+ */ spellingConfig(spellingConfig) {
76
+ this.lint.spellingConfig = spellingConfig;
77
+ return this;
78
+ }
79
+ /**
80
+ * Sets the path to the config file for stylelint.
81
+ *
82
+ * @param styleConfig -
83
+ * The path to the config file for stylelint.
84
+ *
85
+ * @returns
86
+ * This object.
87
+ */ styleConfig(styleConfig) {
88
+ this.lint.styleConfig = styleConfig;
89
+ return this;
90
+ }
91
+ /**
92
+ * Adds a list of globs to the list of files to lint with eslint.
93
+ *
94
+ * @param file -
95
+ * The file globs to lint with eslint.
96
+ *
97
+ * @returns
98
+ * This object.
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
+ /**
106
+ * Adds a list of globs to the list of files to lint with htmlhint.
107
+ *
108
+ * @param file -
109
+ * The file globs to lint with htmlhint.
110
+ *
111
+ * @returns
112
+ * This object.
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
+ /**
120
+ * Adds a list of globs to the list of files to lint with json.
121
+ *
122
+ * @param file -
123
+ * The file globs to lint with json.
124
+ *
125
+ * @returns
126
+ * This object.
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
+ /**
134
+ * Adds a list of globs to the list of files to lint with markdownlint.
135
+ *
136
+ * @param file -
137
+ * The globs to lint with markdownlint.
138
+ *
139
+ * @returns
140
+ * This object.
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
+ /**
148
+ * Adds a list of globs to the list of files to lint with prettier.
149
+ *
150
+ * @param file -
151
+ * The globs to lint with prettier.
152
+ *
153
+ * @returns
154
+ * This object.
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
+ /**
162
+ * Adds a list of globs to the list of files to lint with cspell.
163
+ *
164
+ * @param file -
165
+ * The file globs to lint with cspell.
166
+ *
167
+ * @returns
168
+ * This object.
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
+ /**
176
+ * Adds a list of globs to the list of files to lint with stylelint.
177
+ *
178
+ * @param file -
179
+ * The file globs to lint with stylelint.
180
+ *
181
+ * @returns
182
+ * This object.
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
+ /**
190
+ * Adds a list of globs to the list of files to lint with yaml.
191
+ *
192
+ * @param file -
193
+ * The file globs to lint with yaml.
194
+ *
195
+ * @returns
196
+ * This object.
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
+ /**
204
+ * Adds a list of globs to the list of files to exclude from linting with htmlhint.
205
+ *
206
+ * @param files -
207
+ * The file globs to exclude from linting with htmlhint.
208
+ *
209
+ * @returns
210
+ * This object.
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
+ /**
218
+ * Adds a list of globs to the list of files to exclude from linting with json.
219
+ *
220
+ * @param file -
221
+ * The globs to exclude from linting with json.
222
+ *
223
+ * @returns
224
+ * This object.
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
+ /**
232
+ * Adds a list of globs to the list of files to exclude from linting with markdownlint.
233
+ *
234
+ * @param file -
235
+ * The globs to exclude from linting with markdownlint.
236
+ *
237
+ * @returns
238
+ * This object.
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
+ /**
246
+ * Adds a list of globs to the list of files to exclude from linting with prettier.
247
+ *
248
+ * @param file -
249
+ * The globs to exclude from linting with prettier.
250
+ *
251
+ * @returns
252
+ * This object.
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
+ /**
260
+ * Adds a list of globs to the list of files to exclude from linting with cspell.
261
+ *
262
+ * @param file -
263
+ * The globs to exclude from linting with cspell.
264
+ *
265
+ * @returns
266
+ * This object.
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
+ /**
274
+ * Adds a single file glob to the list of files to exclude from linting with yaml.
275
+ *
276
+ * @param file -
277
+ * The file glob to exclude from linting with yaml.
278
+ *
279
+ * @returns
280
+ * This object.
281
+ */ yamlExclude(file = []) {
282
+ var _this_lint_yamlFilesExclude;
283
+ const excludes = (_this_lint_yamlFilesExclude = this.lint.yamlFilesExclude) !== null && _this_lint_yamlFilesExclude !== void 0 ? _this_lint_yamlFilesExclude : [];
284
+ this.lint.yamlFilesExclude = excludes.concat(file);
285
+ return this;
286
+ }
287
+ /**
288
+ * Adds a file to all exclusion lists.
289
+ *
290
+ * @param file -
291
+ * The file to exclude from all linting.
292
+ *
293
+ * @returns
294
+ * This object.
295
+ */ excludeAll(file = []) {
296
+ return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).yamlExclude(file);
297
+ }
298
+ /**
299
+ * Generates the spelling files based on the other files that have been set.
300
+ *
301
+ * @returns
302
+ * This object.
303
+ */ generateSpellingFiles() {
304
+ 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);
305
+ }
306
+ /**
307
+ * Generates the pretty files based on the other files that have been set.
308
+ *
309
+ * @returns
310
+ * This object.
311
+ */ generatePrettyFiles() {
312
+ 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);
313
+ }
314
+ /**
315
+ * Returns the built linting options object.
316
+ *
317
+ * @returns
318
+ * A clone of the current linting options object.
319
+ */ build() {
320
+ return structuredClone(this.lint);
321
+ }
322
+ constructor(){
323
+ _define_property$1(this, "lint", {});
324
+ }
325
+ }
326
+
327
+ function _define_property(obj, key, value) {
328
+ if (key in obj) {
329
+ Object.defineProperty(obj, key, {
330
+ value: value,
331
+ enumerable: true,
332
+ configurable: true,
333
+ writable: true
334
+ });
335
+ } else {
336
+ obj[key] = value;
337
+ }
338
+ return obj;
339
+ }
340
+ /**
341
+ * A builder for creating janitor options.
342
+ */ class ZJanitorOptionsBuilder {
343
+ /**
344
+ * Sets the linting options for the janitor system.
345
+ *
346
+ * @param lint -
347
+ * The linting options to set.
348
+ *
349
+ * @returns
350
+ * This object.
351
+ */ lint(lint) {
352
+ this.options.lint = lint;
353
+ return this;
354
+ }
355
+ /**
356
+ * Builds the options object.
357
+ *
358
+ * @returns
359
+ * A clone of the current options object.
360
+ */ build() {
361
+ return structuredClone(this.options);
362
+ }
363
+ constructor(){
364
+ _define_property(this, "options", {});
365
+ }
366
+ }
367
+
368
+ export { ZJanitorOptionsBuilder, ZJanitorOptionsLintBuilder };
369
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/options/janitor-options-lint.mts","../src/options/janitor-options.mts"],"sourcesContent":["/**\n * Represents options for linting in the zthunworks janitor system.\n */\nexport interface IZJanitorOptionsLint {\n /**\n * The path to the config file for eslint.\n */\n esConfig?: string;\n /**\n * The path to the config file for htmlhint.\n */\n htmlConfig?: string;\n /**\n * The path to the config file for markdownlint.\n */\n markdownConfig?: string;\n /**\n * The path to the config file for prettier.\n */\n prettyConfig?: string;\n /**\n * The path to the config file for cspell.\n */\n spellingConfig?: string;\n /**\n * The path to the config file for stylelint.\n */\n styleConfig?: string;\n\n /**\n * The file globs to lint with eslint.\n */\n esFiles?: string[];\n /**\n * The file globs to lint with htmlhint.\n */\n htmlFiles?: string[];\n /**\n * The file globs to lint with json.\n */\n jsonFiles?: string[];\n /**\n * The file globs to lint with markdownlint.\n */\n markdownFiles?: string[];\n /**\n * The file globs to lint with prettier.\n */\n prettyFiles?: string[];\n /**\n * The file globs to lint with cspell.\n */\n spellingFiles?: string[];\n /**\n * The file globs to lint with stylelint.\n */\n styleFiles?: string[];\n /**\n * The file globs to lint with yaml.\n */\n yamlFiles?: string[];\n\n /**\n * The files globs to exclude from linting with htmlhint.\n */\n htmlFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with json.\n */\n jsonFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with markdownlint.\n */\n markdownFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with prettier.\n */\n prettyFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with cspell.\n */\n spellingFilesExclude?: string[];\n /**\n * The files globs to exclude from linting with yaml.\n */\n yamlFilesExclude?: string[];\n}\n\n/**\n * A builder for creating linting options for the zthunworks janitor system.\n */\nexport class ZJanitorOptionsLintBuilder {\n private lint: IZJanitorOptionsLint = {};\n\n /**\n * Sets the path to the config file for eslint.\n *\n * @param esConfig -\n * The path to the config file for eslint.\n *\n * @returns\n * This object.\n */\n public esConfig(esConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.esConfig = esConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for htmlhint.\n *\n * @param htmlConfig -\n * The path to the config file for htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlConfig(htmlConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.htmlConfig = htmlConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for markdownlint.\n *\n * @param markdownConfig -\n * The path to the config file for markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownConfig(markdownConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.markdownConfig = markdownConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for prettier.\n *\n * @param prettyConfig -\n * The path to the config file for prettier.\n *\n * @returns\n * This object.\n */\n public prettyConfig(prettyConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.prettyConfig = prettyConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for cspell.\n *\n * @param spellingConfig -\n * The path to the config file for cspell.\n *\n * @returns\n * This object.\n */\n public spellingConfig(spellingConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.spellingConfig = spellingConfig;\n return this;\n }\n\n /**\n * Sets the path to the config file for stylelint.\n *\n * @param styleConfig -\n * The path to the config file for stylelint.\n *\n * @returns\n * This object.\n */\n public styleConfig(styleConfig: string): ZJanitorOptionsLintBuilder {\n this.lint.styleConfig = styleConfig;\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with eslint.\n *\n * @param file -\n * The file globs to lint with eslint.\n *\n * @returns\n * This object.\n */\n public esFile(file: string | string[] = []) {\n const files = this.lint.esFiles ?? [];\n this.lint.esFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with htmlhint.\n *\n * @param file -\n * The file globs to lint with htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlFile(file: string | string[] = []) {\n const files = this.lint.htmlFiles ?? [];\n this.lint.htmlFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with json.\n *\n * @param file -\n * The file globs to lint with json.\n *\n * @returns\n * This object.\n */\n public jsonFile(file: string | string[] = []) {\n const files = this.lint.jsonFiles ?? [];\n this.lint.jsonFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with markdownlint.\n *\n * @param file -\n * The globs to lint with markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownFile(file: string | string[] = []) {\n const files = this.lint.markdownFiles ?? [];\n this.lint.markdownFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with prettier.\n *\n * @param file -\n * The globs to lint with prettier.\n *\n * @returns\n * This object.\n */\n public prettyFile(file: string | string[] = []) {\n const files = this.lint.prettyFiles ?? [];\n this.lint.prettyFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with cspell.\n *\n * @param file -\n * The file globs to lint with cspell.\n *\n * @returns\n * This object.\n */\n public spellingFile(file: string | string[] = []) {\n const files = this.lint.spellingFiles ?? [];\n this.lint.spellingFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with stylelint.\n *\n * @param file -\n * The file globs to lint with stylelint.\n *\n * @returns\n * This object.\n */\n public styleFile(file: string | string[] = []) {\n const files = this.lint.styleFiles ?? [];\n this.lint.styleFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to lint with yaml.\n *\n * @param file -\n * The file globs to lint with yaml.\n *\n * @returns\n * This object.\n */\n public yamlFile(file: string | string[] = []) {\n const files = this.lint.yamlFiles ?? [];\n this.lint.yamlFiles = files.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with htmlhint.\n *\n * @param files -\n * The file globs to exclude from linting with htmlhint.\n *\n * @returns\n * This object.\n */\n public htmlExclude(files: string | string[] = []) {\n const excludes = this.lint.htmlFilesExclude ?? [];\n this.lint.htmlFilesExclude = excludes.concat(files);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with json.\n *\n * @param file -\n * The globs to exclude from linting with json.\n *\n * @returns\n * This object.\n */\n public jsonExclude(file: string | string[] = []) {\n const excludes = this.lint.jsonFilesExclude ?? [];\n this.lint.jsonFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with markdownlint.\n *\n * @param file -\n * The globs to exclude from linting with markdownlint.\n *\n * @returns\n * This object.\n */\n public markdownExclude(file: string | string[] = []) {\n const excludes = this.lint.markdownFilesExclude ?? [];\n this.lint.markdownFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with prettier.\n *\n * @param file -\n * The globs to exclude from linting with prettier.\n *\n * @returns\n * This object.\n */\n public prettyExclude(file: string | string[] = []) {\n const excludes = this.lint.prettyFilesExclude ?? [];\n this.lint.prettyFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a list of globs to the list of files to exclude from linting with cspell.\n *\n * @param file -\n * The globs to exclude from linting with cspell.\n *\n * @returns\n * This object.\n */\n public spellingExclude(file: string | string[] = []) {\n const excludes = this.lint.spellingFilesExclude ?? [];\n this.lint.spellingFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a single file glob to the list of files to exclude from linting with yaml.\n *\n * @param file -\n * The file glob to exclude from linting with yaml.\n *\n * @returns\n * This object.\n */\n public yamlExclude(file: string | string[] = []) {\n const excludes = this.lint.yamlFilesExclude ?? [];\n this.lint.yamlFilesExclude = excludes.concat(file);\n return this;\n }\n\n /**\n * Adds a file to all exclusion lists.\n *\n * @param file -\n * The file to exclude from all linting.\n *\n * @returns\n * This object.\n */\n public excludeAll(file: string | string[] = []) {\n return this.htmlExclude(file)\n .jsonExclude(file)\n .markdownExclude(file)\n .prettyExclude(file)\n .spellingExclude(file)\n .yamlExclude(file);\n }\n\n /**\n * Generates the spelling files based on the other files that have been set.\n *\n * @returns\n * This object.\n */\n public generateSpellingFiles() {\n return this.spellingFile(this.lint.esFiles)\n .spellingFile(this.lint.htmlFiles)\n .spellingFile(this.lint.jsonFiles)\n .spellingFile(this.lint.markdownFiles)\n .spellingFile(this.lint.styleFiles)\n .spellingFile(this.lint.yamlFiles);\n }\n\n /**\n * Generates the pretty files based on the other files that have been set.\n *\n * @returns\n * This object.\n */\n public generatePrettyFiles() {\n return this.prettyFile(this.lint.esFiles)\n .prettyFile(this.lint.htmlFiles)\n .prettyFile(this.lint.jsonFiles)\n .prettyFile(this.lint.markdownFiles)\n .prettyFile(this.lint.styleFiles)\n .prettyFile(this.lint.yamlFiles);\n }\n\n /**\n * Returns the built linting options object.\n *\n * @returns\n * A clone of the current linting options object.\n */\n public build() {\n return structuredClone(this.lint);\n }\n}\n","import { IZJanitorOptionsLint } from \"./janitor-options-lint.mjs\";\n\n/**\n * Options for the zthunworks janitor system.\n */\nexport interface IZJanitorOptions {\n /**\n * Linting options for janitor-lint.\n */\n lint?: IZJanitorOptionsLint;\n}\n\n/**\n * A builder for creating janitor options.\n */\nexport class ZJanitorOptionsBuilder {\n private options: IZJanitorOptions = {};\n\n /**\n * Sets the linting options for the janitor system.\n *\n * @param lint -\n * The linting options to set.\n *\n * @returns\n * This object.\n */\n public lint(lint: IZJanitorOptionsLint): ZJanitorOptionsBuilder {\n this.options.lint = lint;\n return this;\n }\n\n /**\n * Builds the options object.\n *\n * @returns\n * A clone of the current options object.\n */\n public build(): IZJanitorOptions {\n return structuredClone(this.options);\n }\n}\n"],"names":["_define_property","ZJanitorOptionsLintBuilder","esConfig","lint","htmlConfig","markdownConfig","prettyConfig","spellingConfig","styleConfig","esFile","file","files","esFiles","concat","htmlFile","htmlFiles","jsonFile","jsonFiles","markdownFile","markdownFiles","prettyFile","prettyFiles","spellingFile","spellingFiles","styleFile","styleFiles","yamlFile","yamlFiles","htmlExclude","excludes","htmlFilesExclude","jsonExclude","jsonFilesExclude","markdownExclude","markdownFilesExclude","prettyExclude","prettyFilesExclude","spellingExclude","spellingFilesExclude","yamlExclude","yamlFilesExclude","excludeAll","structuredClone","ZJanitorOptionsBuilder","options"],"mappings":"AAAA;;AAEC,IAAA,SAAAA,kBAAA,CAAA,GAAA,EAAA,GAAA,EAAA,KAAA,EAAA;;;;;;;;;;;;;AAsFD;;AAEC,IACM,MAAMC,0BAAAA,CAAAA;AAGX;;;;;;;;MASOC,QAASA,CAAAA,QAAgB,EAA8B;AAC5D,QAAA,IAAI,CAACC,IAAI,CAACD,QAAQ,GAAGA,QAAAA;AACrB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;MASOE,UAAWA,CAAAA,UAAkB,EAA8B;AAChE,QAAA,IAAI,CAACD,IAAI,CAACC,UAAU,GAAGA,UAAAA;AACvB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;MASOC,cA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AAAA,YAAY,CAAC,IAAI,CAACnB,IAAI,CAACsB,UAAU,CACjCH,CAAAA,YAAY,CAAC,IAAI,CAACnB,IAAI,CAACwB,SAAS,CAAA;AACrC;AAEA;;;;;AAKC,MACD,mBAA6B,GAAA;QAC3B,OAAO,IAAI,CAACP,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACS,OAAO,CACrCQ,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACY,SAAS,EAC9BK,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACc,SAAS,CAC9BG,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACgB,aAAa,CAClCC,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACsB,UAAU,CAC/BL,CAAAA,UAAU,CAAC,IAAI,CAACjB,IAAI,CAACwB,SAAS,CAAA;AACnC;AAEA;;;;;AAKC,MACD,KAAe,GAAA;QACb,OAAOe,eAAAA,CAAgB,IAAI,CAACvC,IAAI,CAAA;AAClC;;AAhWA,QAAAH,kBAAA,CAAA,IAAA,EAAQG,QAA6B,EAAC,CAAA;;AAiWxC;;;;;;;;;;;;;;;ACjbA;;AAEC,IACM,MAAMwC,sBAAAA,CAAAA;AAGX;;;;;;;;MASOxC,IAAKA,CAAAA,IAA0B,EAA0B;AAC9D,QAAA,IAAI,CAACyC,OAAO,CAACzC,IAAI,GAAGA,IAAAA;AACpB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;AAKC,MACD,KAAiC,GAAA;QAC/B,OAAOuC,eAAAA,CAAgB,IAAI,CAACE,OAAO,CAAA;AACrC;;AAxBA,QAAA,gBAAA,CAAA,IAAA,EAAQA,WAA4B,EAAC,CAAA;;AAyBvC;;;;"}
@@ -0,0 +1,322 @@
1
+ /**
2
+ * Represents options for linting in the zthunworks janitor system.
3
+ */
4
+ export interface IZJanitorOptionsLint {
5
+ /**
6
+ * The path to the config file for eslint.
7
+ */
8
+ esConfig?: string;
9
+ /**
10
+ * The path to the config file for htmlhint.
11
+ */
12
+ htmlConfig?: string;
13
+ /**
14
+ * The path to the config file for markdownlint.
15
+ */
16
+ markdownConfig?: string;
17
+ /**
18
+ * The path to the config file for prettier.
19
+ */
20
+ prettyConfig?: string;
21
+ /**
22
+ * The path to the config file for cspell.
23
+ */
24
+ spellingConfig?: string;
25
+ /**
26
+ * The path to the config file for stylelint.
27
+ */
28
+ styleConfig?: string;
29
+ /**
30
+ * The file globs to lint with eslint.
31
+ */
32
+ esFiles?: string[];
33
+ /**
34
+ * The file globs to lint with htmlhint.
35
+ */
36
+ htmlFiles?: string[];
37
+ /**
38
+ * The file globs to lint with json.
39
+ */
40
+ jsonFiles?: string[];
41
+ /**
42
+ * The file globs to lint with markdownlint.
43
+ */
44
+ markdownFiles?: string[];
45
+ /**
46
+ * The file globs to lint with prettier.
47
+ */
48
+ prettyFiles?: string[];
49
+ /**
50
+ * The file globs to lint with cspell.
51
+ */
52
+ spellingFiles?: string[];
53
+ /**
54
+ * The file globs to lint with stylelint.
55
+ */
56
+ styleFiles?: string[];
57
+ /**
58
+ * The file globs to lint with yaml.
59
+ */
60
+ yamlFiles?: string[];
61
+ /**
62
+ * The files globs to exclude from linting with htmlhint.
63
+ */
64
+ htmlFilesExclude?: string[];
65
+ /**
66
+ * The files globs to exclude from linting with json.
67
+ */
68
+ jsonFilesExclude?: string[];
69
+ /**
70
+ * The files globs to exclude from linting with markdownlint.
71
+ */
72
+ markdownFilesExclude?: string[];
73
+ /**
74
+ * The files globs to exclude from linting with prettier.
75
+ */
76
+ prettyFilesExclude?: string[];
77
+ /**
78
+ * The files globs to exclude from linting with cspell.
79
+ */
80
+ spellingFilesExclude?: string[];
81
+ /**
82
+ * The files globs to exclude from linting with yaml.
83
+ */
84
+ yamlFilesExclude?: string[];
85
+ }
86
+ /**
87
+ * A builder for creating linting options for the zthunworks janitor system.
88
+ */
89
+ export declare class ZJanitorOptionsLintBuilder {
90
+ private lint;
91
+ /**
92
+ * Sets the path to the config file for eslint.
93
+ *
94
+ * @param esConfig -
95
+ * The path to the config file for eslint.
96
+ *
97
+ * @returns
98
+ * This object.
99
+ */
100
+ esConfig(esConfig: string): ZJanitorOptionsLintBuilder;
101
+ /**
102
+ * Sets the path to the config file for htmlhint.
103
+ *
104
+ * @param htmlConfig -
105
+ * The path to the config file for htmlhint.
106
+ *
107
+ * @returns
108
+ * This object.
109
+ */
110
+ htmlConfig(htmlConfig: string): ZJanitorOptionsLintBuilder;
111
+ /**
112
+ * Sets the path to the config file for markdownlint.
113
+ *
114
+ * @param markdownConfig -
115
+ * The path to the config file for markdownlint.
116
+ *
117
+ * @returns
118
+ * This object.
119
+ */
120
+ markdownConfig(markdownConfig: string): ZJanitorOptionsLintBuilder;
121
+ /**
122
+ * Sets the path to the config file for prettier.
123
+ *
124
+ * @param prettyConfig -
125
+ * The path to the config file for prettier.
126
+ *
127
+ * @returns
128
+ * This object.
129
+ */
130
+ prettyConfig(prettyConfig: string): ZJanitorOptionsLintBuilder;
131
+ /**
132
+ * Sets the path to the config file for cspell.
133
+ *
134
+ * @param spellingConfig -
135
+ * The path to the config file for cspell.
136
+ *
137
+ * @returns
138
+ * This object.
139
+ */
140
+ spellingConfig(spellingConfig: string): ZJanitorOptionsLintBuilder;
141
+ /**
142
+ * Sets the path to the config file for stylelint.
143
+ *
144
+ * @param styleConfig -
145
+ * The path to the config file for stylelint.
146
+ *
147
+ * @returns
148
+ * This object.
149
+ */
150
+ styleConfig(styleConfig: string): ZJanitorOptionsLintBuilder;
151
+ /**
152
+ * Adds a list of globs to the list of files to lint with eslint.
153
+ *
154
+ * @param file -
155
+ * The file globs to lint with eslint.
156
+ *
157
+ * @returns
158
+ * This object.
159
+ */
160
+ esFile(file?: string | string[]): this;
161
+ /**
162
+ * Adds a list of globs to the list of files to lint with htmlhint.
163
+ *
164
+ * @param file -
165
+ * The file globs to lint with htmlhint.
166
+ *
167
+ * @returns
168
+ * This object.
169
+ */
170
+ htmlFile(file?: string | string[]): this;
171
+ /**
172
+ * Adds a list of globs to the list of files to lint with json.
173
+ *
174
+ * @param file -
175
+ * The file globs to lint with json.
176
+ *
177
+ * @returns
178
+ * This object.
179
+ */
180
+ jsonFile(file?: string | string[]): this;
181
+ /**
182
+ * Adds a list of globs to the list of files to lint with markdownlint.
183
+ *
184
+ * @param file -
185
+ * The globs to lint with markdownlint.
186
+ *
187
+ * @returns
188
+ * This object.
189
+ */
190
+ markdownFile(file?: string | string[]): this;
191
+ /**
192
+ * Adds a list of globs to the list of files to lint with prettier.
193
+ *
194
+ * @param file -
195
+ * The globs to lint with prettier.
196
+ *
197
+ * @returns
198
+ * This object.
199
+ */
200
+ prettyFile(file?: string | string[]): this;
201
+ /**
202
+ * Adds a list of globs to the list of files to lint with cspell.
203
+ *
204
+ * @param file -
205
+ * The file globs to lint with cspell.
206
+ *
207
+ * @returns
208
+ * This object.
209
+ */
210
+ spellingFile(file?: string | string[]): this;
211
+ /**
212
+ * Adds a list of globs to the list of files to lint with stylelint.
213
+ *
214
+ * @param file -
215
+ * The file globs to lint with stylelint.
216
+ *
217
+ * @returns
218
+ * This object.
219
+ */
220
+ styleFile(file?: string | string[]): this;
221
+ /**
222
+ * Adds a list of globs to the list of files to lint with yaml.
223
+ *
224
+ * @param file -
225
+ * The file globs to lint with yaml.
226
+ *
227
+ * @returns
228
+ * This object.
229
+ */
230
+ yamlFile(file?: string | string[]): this;
231
+ /**
232
+ * Adds a list of globs to the list of files to exclude from linting with htmlhint.
233
+ *
234
+ * @param files -
235
+ * The file globs to exclude from linting with htmlhint.
236
+ *
237
+ * @returns
238
+ * This object.
239
+ */
240
+ htmlExclude(files?: string | string[]): this;
241
+ /**
242
+ * Adds a list of globs to the list of files to exclude from linting with json.
243
+ *
244
+ * @param file -
245
+ * The globs to exclude from linting with json.
246
+ *
247
+ * @returns
248
+ * This object.
249
+ */
250
+ jsonExclude(file?: string | string[]): this;
251
+ /**
252
+ * Adds a list of globs to the list of files to exclude from linting with markdownlint.
253
+ *
254
+ * @param file -
255
+ * The globs to exclude from linting with markdownlint.
256
+ *
257
+ * @returns
258
+ * This object.
259
+ */
260
+ markdownExclude(file?: string | string[]): this;
261
+ /**
262
+ * Adds a list of globs to the list of files to exclude from linting with prettier.
263
+ *
264
+ * @param file -
265
+ * The globs to exclude from linting with prettier.
266
+ *
267
+ * @returns
268
+ * This object.
269
+ */
270
+ prettyExclude(file?: string | string[]): this;
271
+ /**
272
+ * Adds a list of globs to the list of files to exclude from linting with cspell.
273
+ *
274
+ * @param file -
275
+ * The globs to exclude from linting with cspell.
276
+ *
277
+ * @returns
278
+ * This object.
279
+ */
280
+ spellingExclude(file?: string | string[]): this;
281
+ /**
282
+ * Adds a single file glob to the list of files to exclude from linting with yaml.
283
+ *
284
+ * @param file -
285
+ * The file glob to exclude from linting with yaml.
286
+ *
287
+ * @returns
288
+ * This object.
289
+ */
290
+ yamlExclude(file?: string | string[]): this;
291
+ /**
292
+ * Adds a file to all exclusion lists.
293
+ *
294
+ * @param file -
295
+ * The file to exclude from all linting.
296
+ *
297
+ * @returns
298
+ * This object.
299
+ */
300
+ excludeAll(file?: string | string[]): this;
301
+ /**
302
+ * Generates the spelling files based on the other files that have been set.
303
+ *
304
+ * @returns
305
+ * This object.
306
+ */
307
+ generateSpellingFiles(): this;
308
+ /**
309
+ * Generates the pretty files based on the other files that have been set.
310
+ *
311
+ * @returns
312
+ * This object.
313
+ */
314
+ generatePrettyFiles(): this;
315
+ /**
316
+ * Returns the built linting options object.
317
+ *
318
+ * @returns
319
+ * A clone of the current linting options object.
320
+ */
321
+ build(): IZJanitorOptionsLint;
322
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import { IZJanitorOptionsLint } from './janitor-options-lint.mjs';
2
+ /**
3
+ * Options for the zthunworks janitor system.
4
+ */
5
+ export interface IZJanitorOptions {
6
+ /**
7
+ * Linting options for janitor-lint.
8
+ */
9
+ lint?: IZJanitorOptionsLint;
10
+ }
11
+ /**
12
+ * A builder for creating janitor options.
13
+ */
14
+ export declare class ZJanitorOptionsBuilder {
15
+ private options;
16
+ /**
17
+ * Sets the linting options for the janitor system.
18
+ *
19
+ * @param lint -
20
+ * The linting options to set.
21
+ *
22
+ * @returns
23
+ * This object.
24
+ */
25
+ lint(lint: IZJanitorOptionsLint): ZJanitorOptionsBuilder;
26
+ /**
27
+ * Builds the options object.
28
+ *
29
+ * @returns
30
+ * A clone of the current options object.
31
+ */
32
+ build(): IZJanitorOptions;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@zthun/janitor-options",
3
+ "version": "19.0.0",
4
+ "description": "Option builders and interfaces for the zthunworks janitor system.",
5
+ "keywords": [
6
+ "linters"
7
+ ],
8
+ "type": "module",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/zthun/janitor",
13
+ "directory": "packages/janitor-options"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "types": "./dist/index.d.ts",
19
+ "main": "./dist/index.cjs",
20
+ "module": "./dist/index.js",
21
+ "exports": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "require": "./dist/index.cjs"
25
+ },
26
+ "scripts": {
27
+ "build": "vite build"
28
+ },
29
+ "author": "Anthony Bonta",
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "devDependencies": {
34
+ "@zthun/janitor-build-config": "^19.0.0",
35
+ "typescript": "~5.8.3",
36
+ "vite": "^6.3.5",
37
+ "vitest": "^3.1.4"
38
+ },
39
+ "gitHead": "8277288093dff6023427448ccf903d83912865b5"
40
+ }