@zthun/janitor-options 19.1.4 → 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +101 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +101 -1
- package/dist/index.js.map +1 -1
- package/dist/options/janitor-options-lint.d.mts +77 -0
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -264,6 +264,20 @@ class ZJanitorOptionsLintBuilder {
|
|
|
264
264
|
this.lint.spellingFilesExclude = excludes.concat(file);
|
|
265
265
|
return this;
|
|
266
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Adds a list of globs to the list of files to exclude from linting with stylelint.
|
|
269
|
+
*
|
|
270
|
+
* @param file -
|
|
271
|
+
* The globs to exclude from linting with stylelint.
|
|
272
|
+
*
|
|
273
|
+
* @returns
|
|
274
|
+
* This object.
|
|
275
|
+
*/
|
|
276
|
+
styleExclude(file = []) {
|
|
277
|
+
const excludes = this.lint.styleFilesExclude ?? [];
|
|
278
|
+
this.lint.styleFilesExclude = excludes.concat(file);
|
|
279
|
+
return this;
|
|
280
|
+
}
|
|
267
281
|
/**
|
|
268
282
|
* Adds a single file glob to the list of files to exclude from linting with yaml.
|
|
269
283
|
*
|
|
@@ -288,7 +302,7 @@ class ZJanitorOptionsLintBuilder {
|
|
|
288
302
|
* This object.
|
|
289
303
|
*/
|
|
290
304
|
excludeAll(file = []) {
|
|
291
|
-
return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).yamlExclude(file);
|
|
305
|
+
return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).styleExclude(file).yamlExclude(file);
|
|
292
306
|
}
|
|
293
307
|
/**
|
|
294
308
|
* Generates the spelling files based on the other files that have been set.
|
|
@@ -308,6 +322,92 @@ class ZJanitorOptionsLintBuilder {
|
|
|
308
322
|
generatePrettyFiles() {
|
|
309
323
|
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);
|
|
310
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Adds conventional es files.
|
|
327
|
+
*
|
|
328
|
+
* @returns
|
|
329
|
+
* This object
|
|
330
|
+
*/
|
|
331
|
+
commonEsFiles() {
|
|
332
|
+
const extensions = "js,cjs,mjs,ts,mts,jsx,tsx";
|
|
333
|
+
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}}`);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Adds conventional css files.
|
|
337
|
+
*
|
|
338
|
+
* @returns
|
|
339
|
+
* This object.
|
|
340
|
+
*/
|
|
341
|
+
commonCssFiles() {
|
|
342
|
+
return this.styleFile(`src/**/*.css`).styleFile(`packages/**/*.css`).styleFile("styles/**/*.css");
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Adds conventional sass files.
|
|
346
|
+
*
|
|
347
|
+
* @returns
|
|
348
|
+
* This object.
|
|
349
|
+
*/
|
|
350
|
+
commonSassFiles() {
|
|
351
|
+
return this.styleFile(`src/**/*.{sass,scss}`).styleFile(`packages/**/src/**/*.{sass,scss}`).styleFile("styles/**/*.{sass,scss}");
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Adds conventional less files.
|
|
355
|
+
*
|
|
356
|
+
* @returns
|
|
357
|
+
* This object.
|
|
358
|
+
*/
|
|
359
|
+
commonLessFiles() {
|
|
360
|
+
return this.styleFile(`src/**/*.less`).styleFile("packages/**/src/**/*.less").styleFile("styles/**/*.less");
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Adds conventional less files.
|
|
364
|
+
*
|
|
365
|
+
* @returns
|
|
366
|
+
* This object.
|
|
367
|
+
*/
|
|
368
|
+
commonHtmlFiles() {
|
|
369
|
+
const extensions = "html,htm";
|
|
370
|
+
return this.htmlFile(`src/**/*.{${extensions}}`).htmlFile(
|
|
371
|
+
`packages/**/src/**/*.{${extensions}}`
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Adds conventional markdown files.
|
|
376
|
+
*
|
|
377
|
+
* @returns
|
|
378
|
+
* This object.
|
|
379
|
+
*/
|
|
380
|
+
commonMarkdownFiles() {
|
|
381
|
+
return this.markdownFile("LICENSE").markdownFile(`*.md`).markdownFile(`src/**/*.md`).markdownFile(`packages/**/*.md`).markdownFile(`packages/**/LICENSE`);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Add conventional json files.
|
|
385
|
+
*
|
|
386
|
+
* @returns
|
|
387
|
+
* This object.
|
|
388
|
+
*/
|
|
389
|
+
commonJsonFiles() {
|
|
390
|
+
return this.jsonFile("*.json").jsonFile("src/**/*.json").jsonFile("packages/**/*.json").jsonFile(".config/*.json");
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Adds conventional yaml files.
|
|
394
|
+
*
|
|
395
|
+
* @returns
|
|
396
|
+
* This object.
|
|
397
|
+
*/
|
|
398
|
+
commonYamlFiles() {
|
|
399
|
+
const extensions = "yml,yaml";
|
|
400
|
+
return this.yamlFile(`*.{${extensions}}`).yamlFile(`src/**/*.{${extensions}}`).yamlFile(`packages/**/*.{${extensions}}`).yamlFile(`.config/*.{${extensions}}`).yamlFile(`.circleci/*.{${extensions}}`);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Adds conventional exclude files.
|
|
404
|
+
*
|
|
405
|
+
* @returns
|
|
406
|
+
* This object.
|
|
407
|
+
*/
|
|
408
|
+
commonExcludes() {
|
|
409
|
+
return this.excludeAll("**/CHANGELOG.md").excludeAll("**/dist/**").excludeAll("**/node_modules/**").excludeAll("package-lock.json").excludeAll("lerna.json").excludeAll("**/cspell.json");
|
|
410
|
+
}
|
|
311
411
|
/**
|
|
312
412
|
* Returns the built linting options object.
|
|
313
413
|
*
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +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 type { 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":[],"mappings":";;AA2FO,MAAM,2BAA2B;AAAA,EAAjC,cAAA;AACL,SAAQ,OAA6B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA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,EACpB,cAAc,IAAI,EAClB,gBAAgB,IAAI,EACpB,YAAY,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASd,wBAAwB;AAC7B,WAAO,KAAK,aAAa,KAAK,KAAK,OAAO,EACvC,aAAa,KAAK,KAAK,SAAS,EAChC,aAAa,KAAK,KAAK,SAAS,EAChC,aAAa,KAAK,KAAK,aAAa,EACpC,aAAa,KAAK,KAAK,UAAU,EACjC,aAAa,KAAK,KAAK,SAAS;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS9B,sBAAsB;AAC3B,WAAO,KAAK,WAAW,KAAK,KAAK,OAAO,EACrC,WAAW,KAAK,KAAK,SAAS,EAC9B,WAAW,KAAK,KAAK,SAAS,EAC9B,WAAW,KAAK,KAAK,aAAa,EAClC,WAAW,KAAK,KAAK,UAAU,EAC/B,WAAW,KAAK,KAAK,SAAS;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5B,QAAQ;AACN,WAAA,gBAAgB,KAAK,IAAI;AAAA,EAAA;AAEpC;AC9aO,MAAM,uBAAuB;AAAA,EAA7B,cAAA;AACL,SAAQ,UAA4B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,KAAK,MAAoD;AAC9D,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASF,QAA0B;AACxB,WAAA,gBAAgB,KAAK,OAAO;AAAA,EAAA;AAEvC;;;"}
|
|
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 to exclude from linting with stylelint.\n */\n styleFilesExclude?: 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 list of globs to the list of files to exclude from linting with stylelint.\n *\n * @param file -\n * The globs to exclude from linting with stylelint.\n *\n * @returns\n * This object.\n */\n public styleExclude(file: string | string[] = []) {\n const excludes = this.lint.styleFilesExclude ?? [];\n this.lint.styleFilesExclude = 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 .styleExclude(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 * Adds conventional es files.\n *\n * @returns\n * This object\n */\n public commonEsFiles() {\n const extensions = \"js,cjs,mjs,ts,mts,jsx,tsx\";\n\n return this.esFile(`*.{${extensions}}`)\n .esFile(`src/**/*.{${extensions}}`)\n .esFile(`features/**/*.{${extensions}}`)\n .esFile(`packages/**/src/**/*.{${extensions}}`)\n .esFile(`packages/**/features/**/*.{${extensions}}`)\n .esFile(`packages/*/vite.config.{${extensions}}`)\n .esFile(`packages/*/vitest.config.{${extensions}}`)\n .esFile(`.config/*.{${extensions}}`);\n }\n\n /**\n * Adds conventional css files.\n *\n * @returns\n * This object.\n */\n public commonCssFiles() {\n return this.styleFile(`src/**/*.css`)\n .styleFile(`packages/**/*.css`)\n .styleFile(\"styles/**/*.css\");\n }\n\n /**\n * Adds conventional sass files.\n *\n * @returns\n * This object.\n */\n public commonSassFiles() {\n return this.styleFile(`src/**/*.{sass,scss}`)\n .styleFile(`packages/**/src/**/*.{sass,scss}`)\n .styleFile(\"styles/**/*.{sass,scss}\");\n }\n\n /**\n * Adds conventional less files.\n *\n * @returns\n * This object.\n */\n public commonLessFiles() {\n return this.styleFile(`src/**/*.less`)\n .styleFile(\"packages/**/src/**/*.less\")\n .styleFile(\"styles/**/*.less\");\n }\n\n /**\n * Adds conventional less files.\n *\n * @returns\n * This object.\n */\n public commonHtmlFiles() {\n const extensions = \"html,htm\";\n return this.htmlFile(`src/**/*.{${extensions}}`).htmlFile(\n `packages/**/src/**/*.{${extensions}}`,\n );\n }\n\n /**\n * Adds conventional markdown files.\n *\n * @returns\n * This object.\n */\n public commonMarkdownFiles() {\n return this.markdownFile(\"LICENSE\")\n .markdownFile(`*.md`)\n .markdownFile(`src/**/*.md`)\n .markdownFile(`packages/**/*.md`)\n .markdownFile(`packages/**/LICENSE`);\n }\n\n /**\n * Add conventional json files.\n *\n * @returns\n * This object.\n */\n public commonJsonFiles() {\n return this.jsonFile(\"*.json\")\n .jsonFile(\"src/**/*.json\")\n .jsonFile(\"packages/**/*.json\")\n .jsonFile(\".config/*.json\");\n }\n\n /**\n * Adds conventional yaml files.\n *\n * @returns\n * This object.\n */\n public commonYamlFiles() {\n const extensions = \"yml,yaml\";\n return this.yamlFile(`*.{${extensions}}`)\n .yamlFile(`src/**/*.{${extensions}}`)\n .yamlFile(`packages/**/*.{${extensions}}`)\n .yamlFile(`.config/*.{${extensions}}`)\n .yamlFile(`.circleci/*.{${extensions}}`);\n }\n\n /**\n * Adds conventional exclude files.\n *\n * @returns\n * This object.\n */\n public commonExcludes() {\n return this.excludeAll(\"**/CHANGELOG.md\")\n .excludeAll(\"**/dist/**\")\n .excludeAll(\"**/node_modules/**\")\n .excludeAll(\"package-lock.json\")\n .excludeAll(\"lerna.json\")\n .excludeAll(\"**/cspell.json\");\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 type { 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":[],"mappings":";;AA+FO,MAAM,2BAA2B;AAAA,EAAjC,cAAA;AACL,SAAQ,OAA6B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW/B,SAAS,UAA8C;AAC5D,SAAK,KAAK,WAAW;AACd,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,WAAW,YAAgD;AAChE,SAAK,KAAK,aAAa;AAChB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,eAAe,gBAAoD;AACxE,SAAK,KAAK,iBAAiB;AACpB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,aAAa,cAAkD;AACpE,SAAK,KAAK,eAAe;AAClB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,eAAe,gBAAoD;AACxE,SAAK,KAAK,iBAAiB;AACpB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,YAAY,aAAiD;AAClE,SAAK,KAAK,cAAc;AACjB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,OAAO,OAA0B,IAAI;AAC1C,UAAM,QAAQ,KAAK,KAAK,WAAW,CAAC;AACpC,SAAK,KAAK,UAAU,MAAM,OAAO,IAAI;AAC9B,W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B,UAAM,aAAa;AACZ,WAAA,KAAK,SAAS,MAAM,UAAU,GAAG,EACrC,SAAS,aAAa,UAAU,GAAG,EACnC,SAAS,kBAAkB,UAAU,GAAG,EACxC,SAAS,cAAc,UAAU,GAAG,EACpC,SAAS,gBAAgB,UAAU,GAAG;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASpC,iBAAiB;AACtB,WAAO,KAAK,WAAW,iBAAiB,EACrC,WAAW,YAAY,EACvB,WAAW,oBAAoB,EAC/B,WAAW,mBAAmB,EAC9B,WAAW,YAAY,EACvB,WAAW,gBAAgB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASzB,QAAQ;AACN,WAAA,gBAAgB,KAAK,IAAI;AAAA,EAAA;AAEpC;AC/jBO,MAAM,uBAAuB;AAAA,EAA7B,cAAA;AACL,SAAQ,UAA4B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,KAAK,MAAoD;AAC9D,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASF,QAA0B;AACxB,WAAA,gBAAgB,KAAK,OAAO;AAAA,EAAA;AAEvC;;;"}
|
package/dist/index.js
CHANGED
|
@@ -262,6 +262,20 @@ class ZJanitorOptionsLintBuilder {
|
|
|
262
262
|
this.lint.spellingFilesExclude = excludes.concat(file);
|
|
263
263
|
return this;
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Adds a list of globs to the list of files to exclude from linting with stylelint.
|
|
267
|
+
*
|
|
268
|
+
* @param file -
|
|
269
|
+
* The globs to exclude from linting with stylelint.
|
|
270
|
+
*
|
|
271
|
+
* @returns
|
|
272
|
+
* This object.
|
|
273
|
+
*/
|
|
274
|
+
styleExclude(file = []) {
|
|
275
|
+
const excludes = this.lint.styleFilesExclude ?? [];
|
|
276
|
+
this.lint.styleFilesExclude = excludes.concat(file);
|
|
277
|
+
return this;
|
|
278
|
+
}
|
|
265
279
|
/**
|
|
266
280
|
* Adds a single file glob to the list of files to exclude from linting with yaml.
|
|
267
281
|
*
|
|
@@ -286,7 +300,7 @@ class ZJanitorOptionsLintBuilder {
|
|
|
286
300
|
* This object.
|
|
287
301
|
*/
|
|
288
302
|
excludeAll(file = []) {
|
|
289
|
-
return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).yamlExclude(file);
|
|
303
|
+
return this.htmlExclude(file).jsonExclude(file).markdownExclude(file).prettyExclude(file).spellingExclude(file).styleExclude(file).yamlExclude(file);
|
|
290
304
|
}
|
|
291
305
|
/**
|
|
292
306
|
* Generates the spelling files based on the other files that have been set.
|
|
@@ -306,6 +320,92 @@ class ZJanitorOptionsLintBuilder {
|
|
|
306
320
|
generatePrettyFiles() {
|
|
307
321
|
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);
|
|
308
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Adds conventional es files.
|
|
325
|
+
*
|
|
326
|
+
* @returns
|
|
327
|
+
* This object
|
|
328
|
+
*/
|
|
329
|
+
commonEsFiles() {
|
|
330
|
+
const extensions = "js,cjs,mjs,ts,mts,jsx,tsx";
|
|
331
|
+
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}}`);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Adds conventional css files.
|
|
335
|
+
*
|
|
336
|
+
* @returns
|
|
337
|
+
* This object.
|
|
338
|
+
*/
|
|
339
|
+
commonCssFiles() {
|
|
340
|
+
return this.styleFile(`src/**/*.css`).styleFile(`packages/**/*.css`).styleFile("styles/**/*.css");
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Adds conventional sass files.
|
|
344
|
+
*
|
|
345
|
+
* @returns
|
|
346
|
+
* This object.
|
|
347
|
+
*/
|
|
348
|
+
commonSassFiles() {
|
|
349
|
+
return this.styleFile(`src/**/*.{sass,scss}`).styleFile(`packages/**/src/**/*.{sass,scss}`).styleFile("styles/**/*.{sass,scss}");
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Adds conventional less files.
|
|
353
|
+
*
|
|
354
|
+
* @returns
|
|
355
|
+
* This object.
|
|
356
|
+
*/
|
|
357
|
+
commonLessFiles() {
|
|
358
|
+
return this.styleFile(`src/**/*.less`).styleFile("packages/**/src/**/*.less").styleFile("styles/**/*.less");
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Adds conventional less files.
|
|
362
|
+
*
|
|
363
|
+
* @returns
|
|
364
|
+
* This object.
|
|
365
|
+
*/
|
|
366
|
+
commonHtmlFiles() {
|
|
367
|
+
const extensions = "html,htm";
|
|
368
|
+
return this.htmlFile(`src/**/*.{${extensions}}`).htmlFile(
|
|
369
|
+
`packages/**/src/**/*.{${extensions}}`
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Adds conventional markdown files.
|
|
374
|
+
*
|
|
375
|
+
* @returns
|
|
376
|
+
* This object.
|
|
377
|
+
*/
|
|
378
|
+
commonMarkdownFiles() {
|
|
379
|
+
return this.markdownFile("LICENSE").markdownFile(`*.md`).markdownFile(`src/**/*.md`).markdownFile(`packages/**/*.md`).markdownFile(`packages/**/LICENSE`);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Add conventional json files.
|
|
383
|
+
*
|
|
384
|
+
* @returns
|
|
385
|
+
* This object.
|
|
386
|
+
*/
|
|
387
|
+
commonJsonFiles() {
|
|
388
|
+
return this.jsonFile("*.json").jsonFile("src/**/*.json").jsonFile("packages/**/*.json").jsonFile(".config/*.json");
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Adds conventional yaml files.
|
|
392
|
+
*
|
|
393
|
+
* @returns
|
|
394
|
+
* This object.
|
|
395
|
+
*/
|
|
396
|
+
commonYamlFiles() {
|
|
397
|
+
const extensions = "yml,yaml";
|
|
398
|
+
return this.yamlFile(`*.{${extensions}}`).yamlFile(`src/**/*.{${extensions}}`).yamlFile(`packages/**/*.{${extensions}}`).yamlFile(`.config/*.{${extensions}}`).yamlFile(`.circleci/*.{${extensions}}`);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Adds conventional exclude files.
|
|
402
|
+
*
|
|
403
|
+
* @returns
|
|
404
|
+
* This object.
|
|
405
|
+
*/
|
|
406
|
+
commonExcludes() {
|
|
407
|
+
return this.excludeAll("**/CHANGELOG.md").excludeAll("**/dist/**").excludeAll("**/node_modules/**").excludeAll("package-lock.json").excludeAll("lerna.json").excludeAll("**/cspell.json");
|
|
408
|
+
}
|
|
309
409
|
/**
|
|
310
410
|
* Returns the built linting options object.
|
|
311
411
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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 type { 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":[],"mappings":"AA2FO,MAAM,2BAA2B;AAAA,EAAjC,cAAA;AACL,SAAQ,OAA6B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW/B,SAAS,UAA8C;AAC5D,SAAK,KAAK,WAAW;AACd,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,WAAW,YAAgD;AAChE,SAAK,KAAK,aAAa;AAChB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,eAAe,gBAAoD;AACxE,SAAK,KAAK,iBAAiB;AACpB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,aAAa,cAAkD;AACpE,SAAK,KAAK,eAAe;AAClB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,eAAe,gBAAoD;AACxE,SAAK,KAAK,iBAAiB;AACpB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA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,WAAA,gBAAgB,KAAK,IAAI;AAAA,EAAA;AAEpC;AC9aO,MAAM,uBAAuB;AAAA,EAA7B,cAAA;AACL,SAAQ,UAA4B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,KAAK,MAAoD;AAC9D,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASF,QAA0B;AACxB,WAAA,gBAAgB,KAAK,OAAO;AAAA,EAAA;AAEvC;"}
|
|
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 to exclude from linting with stylelint.\n */\n styleFilesExclude?: 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 list of globs to the list of files to exclude from linting with stylelint.\n *\n * @param file -\n * The globs to exclude from linting with stylelint.\n *\n * @returns\n * This object.\n */\n public styleExclude(file: string | string[] = []) {\n const excludes = this.lint.styleFilesExclude ?? [];\n this.lint.styleFilesExclude = 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 .styleExclude(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 * Adds conventional es files.\n *\n * @returns\n * This object\n */\n public commonEsFiles() {\n const extensions = \"js,cjs,mjs,ts,mts,jsx,tsx\";\n\n return this.esFile(`*.{${extensions}}`)\n .esFile(`src/**/*.{${extensions}}`)\n .esFile(`features/**/*.{${extensions}}`)\n .esFile(`packages/**/src/**/*.{${extensions}}`)\n .esFile(`packages/**/features/**/*.{${extensions}}`)\n .esFile(`packages/*/vite.config.{${extensions}}`)\n .esFile(`packages/*/vitest.config.{${extensions}}`)\n .esFile(`.config/*.{${extensions}}`);\n }\n\n /**\n * Adds conventional css files.\n *\n * @returns\n * This object.\n */\n public commonCssFiles() {\n return this.styleFile(`src/**/*.css`)\n .styleFile(`packages/**/*.css`)\n .styleFile(\"styles/**/*.css\");\n }\n\n /**\n * Adds conventional sass files.\n *\n * @returns\n * This object.\n */\n public commonSassFiles() {\n return this.styleFile(`src/**/*.{sass,scss}`)\n .styleFile(`packages/**/src/**/*.{sass,scss}`)\n .styleFile(\"styles/**/*.{sass,scss}\");\n }\n\n /**\n * Adds conventional less files.\n *\n * @returns\n * This object.\n */\n public commonLessFiles() {\n return this.styleFile(`src/**/*.less`)\n .styleFile(\"packages/**/src/**/*.less\")\n .styleFile(\"styles/**/*.less\");\n }\n\n /**\n * Adds conventional less files.\n *\n * @returns\n * This object.\n */\n public commonHtmlFiles() {\n const extensions = \"html,htm\";\n return this.htmlFile(`src/**/*.{${extensions}}`).htmlFile(\n `packages/**/src/**/*.{${extensions}}`,\n );\n }\n\n /**\n * Adds conventional markdown files.\n *\n * @returns\n * This object.\n */\n public commonMarkdownFiles() {\n return this.markdownFile(\"LICENSE\")\n .markdownFile(`*.md`)\n .markdownFile(`src/**/*.md`)\n .markdownFile(`packages/**/*.md`)\n .markdownFile(`packages/**/LICENSE`);\n }\n\n /**\n * Add conventional json files.\n *\n * @returns\n * This object.\n */\n public commonJsonFiles() {\n return this.jsonFile(\"*.json\")\n .jsonFile(\"src/**/*.json\")\n .jsonFile(\"packages/**/*.json\")\n .jsonFile(\".config/*.json\");\n }\n\n /**\n * Adds conventional yaml files.\n *\n * @returns\n * This object.\n */\n public commonYamlFiles() {\n const extensions = \"yml,yaml\";\n return this.yamlFile(`*.{${extensions}}`)\n .yamlFile(`src/**/*.{${extensions}}`)\n .yamlFile(`packages/**/*.{${extensions}}`)\n .yamlFile(`.config/*.{${extensions}}`)\n .yamlFile(`.circleci/*.{${extensions}}`);\n }\n\n /**\n * Adds conventional exclude files.\n *\n * @returns\n * This object.\n */\n public commonExcludes() {\n return this.excludeAll(\"**/CHANGELOG.md\")\n .excludeAll(\"**/dist/**\")\n .excludeAll(\"**/node_modules/**\")\n .excludeAll(\"package-lock.json\")\n .excludeAll(\"lerna.json\")\n .excludeAll(\"**/cspell.json\");\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 type { 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":[],"mappings":"AA+FO,MAAM,2BAA2B;AAAA,EAAjC,cAAA;AACL,SAAQ,OAA6B,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW/B,SAAS,UAA8C;AAC5D,SAAK,KAAK,WAAW;AACd,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,WAAW,YAAgD;AAChE,SAAK,KAAK,aAAa;AAChB,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYF,eAAe,gBAAoD;AACxE,SAAK,KAAK,iBAAiB;AACpB,WAAA;AAAA,EAAA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9D,SAAK,QAAQ,OAAO;AACb,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASF,QAA0B;AACxB,WAAA,gBAAgB,KAAK,OAAO;AAAA,EAAA;AAEvC;"}
|
|
@@ -78,6 +78,10 @@ export interface IZJanitorOptionsLint {
|
|
|
78
78
|
* The files globs to exclude from linting with cspell.
|
|
79
79
|
*/
|
|
80
80
|
spellingFilesExclude?: string[];
|
|
81
|
+
/**
|
|
82
|
+
* The files to exclude from linting with stylelint.
|
|
83
|
+
*/
|
|
84
|
+
styleFilesExclude?: string[];
|
|
81
85
|
/**
|
|
82
86
|
* The files globs to exclude from linting with yaml.
|
|
83
87
|
*/
|
|
@@ -278,6 +282,16 @@ export declare class ZJanitorOptionsLintBuilder {
|
|
|
278
282
|
* This object.
|
|
279
283
|
*/
|
|
280
284
|
spellingExclude(file?: string | string[]): this;
|
|
285
|
+
/**
|
|
286
|
+
* Adds a list of globs to the list of files to exclude from linting with stylelint.
|
|
287
|
+
*
|
|
288
|
+
* @param file -
|
|
289
|
+
* The globs to exclude from linting with stylelint.
|
|
290
|
+
*
|
|
291
|
+
* @returns
|
|
292
|
+
* This object.
|
|
293
|
+
*/
|
|
294
|
+
styleExclude(file?: string | string[]): this;
|
|
281
295
|
/**
|
|
282
296
|
* Adds a single file glob to the list of files to exclude from linting with yaml.
|
|
283
297
|
*
|
|
@@ -312,6 +326,69 @@ export declare class ZJanitorOptionsLintBuilder {
|
|
|
312
326
|
* This object.
|
|
313
327
|
*/
|
|
314
328
|
generatePrettyFiles(): this;
|
|
329
|
+
/**
|
|
330
|
+
* Adds conventional es files.
|
|
331
|
+
*
|
|
332
|
+
* @returns
|
|
333
|
+
* This object
|
|
334
|
+
*/
|
|
335
|
+
commonEsFiles(): this;
|
|
336
|
+
/**
|
|
337
|
+
* Adds conventional css files.
|
|
338
|
+
*
|
|
339
|
+
* @returns
|
|
340
|
+
* This object.
|
|
341
|
+
*/
|
|
342
|
+
commonCssFiles(): this;
|
|
343
|
+
/**
|
|
344
|
+
* Adds conventional sass files.
|
|
345
|
+
*
|
|
346
|
+
* @returns
|
|
347
|
+
* This object.
|
|
348
|
+
*/
|
|
349
|
+
commonSassFiles(): this;
|
|
350
|
+
/**
|
|
351
|
+
* Adds conventional less files.
|
|
352
|
+
*
|
|
353
|
+
* @returns
|
|
354
|
+
* This object.
|
|
355
|
+
*/
|
|
356
|
+
commonLessFiles(): this;
|
|
357
|
+
/**
|
|
358
|
+
* Adds conventional less files.
|
|
359
|
+
*
|
|
360
|
+
* @returns
|
|
361
|
+
* This object.
|
|
362
|
+
*/
|
|
363
|
+
commonHtmlFiles(): this;
|
|
364
|
+
/**
|
|
365
|
+
* Adds conventional markdown files.
|
|
366
|
+
*
|
|
367
|
+
* @returns
|
|
368
|
+
* This object.
|
|
369
|
+
*/
|
|
370
|
+
commonMarkdownFiles(): this;
|
|
371
|
+
/**
|
|
372
|
+
* Add conventional json files.
|
|
373
|
+
*
|
|
374
|
+
* @returns
|
|
375
|
+
* This object.
|
|
376
|
+
*/
|
|
377
|
+
commonJsonFiles(): this;
|
|
378
|
+
/**
|
|
379
|
+
* Adds conventional yaml files.
|
|
380
|
+
*
|
|
381
|
+
* @returns
|
|
382
|
+
* This object.
|
|
383
|
+
*/
|
|
384
|
+
commonYamlFiles(): this;
|
|
385
|
+
/**
|
|
386
|
+
* Adds conventional exclude files.
|
|
387
|
+
*
|
|
388
|
+
* @returns
|
|
389
|
+
* This object.
|
|
390
|
+
*/
|
|
391
|
+
commonExcludes(): this;
|
|
315
392
|
/**
|
|
316
393
|
* Returns the built linting options object.
|
|
317
394
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zthun/janitor-options",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"description": "Option builders and interfaces for the zthunworks janitor system.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"linters"
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"dist"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@zthun/janitor-build-config": "^19.
|
|
34
|
+
"@zthun/janitor-build-config": "^19.2.0",
|
|
35
35
|
"typescript": "~5.8.3",
|
|
36
36
|
"vite": "^6.3.5",
|
|
37
|
-
"vitest": "^3.2.
|
|
37
|
+
"vitest": "^3.2.3"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "db77877e5b625c261b7d62f0d159b031fbda2e83"
|
|
40
40
|
}
|