@zthun/janitor-lint 19.0.0 → 19.1.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/cli.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  const usage = require('yargs');
5
- const janitorLint = require('./janitor-lint-CA0qEXKV.cjs');
5
+ const janitorLint = require('./janitor-lint-DtB_4fzZ.cjs');
6
6
 
7
7
  const args = usage("$0 [options]").alias("c", "config").describe("c", "Optional config file to use.").string("c").help().parse();
8
8
  const janitor = new janitorLint.ZJanitorLint(console);
package/dist/cli.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.cjs","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport usage from \"yargs\";\nimport { IZJanitorLintArgs } from \"./app/janitor-lint-args.mjs\";\nimport { ZJanitorLint } from \"./app/janitor-lint.mjs\";\n\nconst args: IZJanitorLintArgs = usage(\"$0 [options]\")\n .alias(\"c\", \"config\")\n .describe(\"c\", \"Optional config file to use.\")\n .string(\"c\")\n .help()\n .parse() as any;\nconst janitor = new ZJanitorLint(console);\njanitor.run(args).then((result) => (process.exitCode = result));\n"],"names":["args","usage","alias","describe","string","help","parse","janitor","ZJanitorLint","console","run","then","result","process","exitCode"],"mappings":";;;;;;AAMA,MAAMA,OAA0BC,KAAM,CAAA,cAAA,CAAA,CACnCC,KAAK,CAAC,KAAK,QACXC,CAAAA,CAAAA,QAAQ,CAAC,GAAA,EAAK,gCACdC,MAAM,CAAC,GACPC,CAAAA,CAAAA,IAAI,GACJC,KAAK,EAAA;AACR,MAAMC,OAAAA,GAAU,IAAIC,wBAAaC,CAAAA,OAAAA,CAAAA;AACjCF,OAAQG,CAAAA,GAAG,CAACV,IAAMW,CAAAA,CAAAA,IAAI,CAAC,CAACC,MAAAA,GAAYC,OAAQC,CAAAA,QAAQ,GAAGF,MAAAA,CAAAA;;"}
1
+ {"version":3,"file":"cli.cjs","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport usage from \"yargs\";\nimport type { IZJanitorLintArgs } from \"./app/janitor-lint-args.mjs\";\nimport { ZJanitorLint } from \"./app/janitor-lint.mjs\";\n\nconst args: IZJanitorLintArgs = usage(\"$0 [options]\")\n .alias(\"c\", \"config\")\n .describe(\"c\", \"Optional config file to use.\")\n .string(\"c\")\n .help()\n .parse() as any;\nconst janitor = new ZJanitorLint(console);\njanitor.run(args).then((result) => (process.exitCode = result));\n"],"names":["args","usage","alias","describe","string","help","parse","janitor","ZJanitorLint","console","run","then","result","process","exitCode"],"mappings":";;;;;;AAMA,MAAMA,OAA0BC,KAAM,CAAA,cAAA,CAAA,CACnCC,KAAK,CAAC,KAAK,QACXC,CAAAA,CAAAA,QAAQ,CAAC,GAAA,EAAK,gCACdC,MAAM,CAAC,GACPC,CAAAA,CAAAA,IAAI,GACJC,KAAK,EAAA;AACR,MAAMC,OAAAA,GAAU,IAAIC,wBAAaC,CAAAA,OAAAA,CAAAA;AACjCF,OAAQG,CAAAA,GAAG,CAACV,IAAMW,CAAAA,CAAAA,IAAI,CAAC,CAACC,MAAAA,GAAYC,OAAQC,CAAAA,QAAQ,GAAGF,MAAAA,CAAAA;;"}
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import usage from 'yargs';
3
- import { Z as ZJanitorLint } from './janitor-lint-QMZ00oXe.js';
3
+ import { Z as ZJanitorLint } from './janitor-lint-BxUYJFY5.js';
4
4
 
5
5
  const args = usage("$0 [options]").alias("c", "config").describe("c", "Optional config file to use.").string("c").help().parse();
6
6
  const janitor = new ZJanitorLint(console);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport usage from \"yargs\";\nimport { IZJanitorLintArgs } from \"./app/janitor-lint-args.mjs\";\nimport { ZJanitorLint } from \"./app/janitor-lint.mjs\";\n\nconst args: IZJanitorLintArgs = usage(\"$0 [options]\")\n .alias(\"c\", \"config\")\n .describe(\"c\", \"Optional config file to use.\")\n .string(\"c\")\n .help()\n .parse() as any;\nconst janitor = new ZJanitorLint(console);\njanitor.run(args).then((result) => (process.exitCode = result));\n"],"names":["args","usage","alias","describe","string","help","parse","janitor","ZJanitorLint","console","run","then","result","process","exitCode"],"mappings":";;;;AAMA,MAAMA,OAA0BC,KAAM,CAAA,cAAA,CAAA,CACnCC,KAAK,CAAC,KAAK,QACXC,CAAAA,CAAAA,QAAQ,CAAC,GAAA,EAAK,gCACdC,MAAM,CAAC,GACPC,CAAAA,CAAAA,IAAI,GACJC,KAAK,EAAA;AACR,MAAMC,OAAAA,GAAU,IAAIC,YAAaC,CAAAA,OAAAA,CAAAA;AACjCF,OAAQG,CAAAA,GAAG,CAACV,IAAMW,CAAAA,CAAAA,IAAI,CAAC,CAACC,MAAAA,GAAYC,OAAQC,CAAAA,QAAQ,GAAGF,MAAAA,CAAAA"}
1
+ {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport usage from \"yargs\";\nimport type { IZJanitorLintArgs } from \"./app/janitor-lint-args.mjs\";\nimport { ZJanitorLint } from \"./app/janitor-lint.mjs\";\n\nconst args: IZJanitorLintArgs = usage(\"$0 [options]\")\n .alias(\"c\", \"config\")\n .describe(\"c\", \"Optional config file to use.\")\n .string(\"c\")\n .help()\n .parse() as any;\nconst janitor = new ZJanitorLint(console);\njanitor.run(args).then((result) => (process.exitCode = result));\n"],"names":["args","usage","alias","describe","string","help","parse","janitor","ZJanitorLint","console","run","then","result","process","exitCode"],"mappings":";;;;AAMA,MAAMA,OAA0BC,KAAM,CAAA,cAAA,CAAA,CACnCC,KAAK,CAAC,KAAK,QACXC,CAAAA,CAAAA,QAAQ,CAAC,GAAA,EAAK,gCACdC,MAAM,CAAC,GACPC,CAAAA,CAAAA,IAAI,GACJC,KAAK,EAAA;AACR,MAAMC,OAAAA,GAAU,IAAIC,YAAaC,CAAAA,OAAAA,CAAAA;AACjCF,OAAQG,CAAAA,GAAG,CAACV,IAAMW,CAAAA,CAAAA,IAAI,CAAC,CAACC,MAAAA,GAAYC,OAAQC,CAAAA,QAAQ,GAAGF,MAAAA,CAAAA"}
@@ -9,5 +9,5 @@ export interface IZConfigDiscovery {
9
9
  * The path to the discovered configuration file
10
10
  * or null if no such configuration can be found.
11
11
  */
12
- search(): Promise<string>;
12
+ search(): Promise<string | null>;
13
13
  }
@@ -30,7 +30,7 @@ export declare class ZConfigReaderCosmic implements IZConfigReader, IZConfigDisc
30
30
  * @returns
31
31
  * A promise that resolves with the expanded configuration.
32
32
  */
33
- search(): Promise<any>;
33
+ search(): Promise<string | null>;
34
34
  /**
35
35
  * Reads the config file.
36
36
  *
@@ -40,5 +40,5 @@ export declare class ZConfigReaderCosmic implements IZConfigReader, IZConfigDisc
40
40
  * @returns
41
41
  * A promise that resolves the json object that represents the config.
42
42
  */
43
- read(config: string): Promise<any>;
43
+ read(config?: string): Promise<any>;
44
44
  }
@@ -14,5 +14,5 @@ export declare class ZConfigReaderPrettier implements IZConfigReader {
14
14
  * @returns
15
15
  * The options for the config file.
16
16
  */
17
- read(config: string): Promise<Options>;
17
+ read(config?: string): Promise<Options>;
18
18
  }
@@ -11,5 +11,5 @@ export interface IZConfigReader {
11
11
  * @returns
12
12
  * A promise that returns the content of the config file.
13
13
  */
14
- read(config: string): Promise<any>;
14
+ read(config?: string): Promise<any>;
15
15
  }
@@ -17,5 +17,5 @@ export interface IZContentLinter {
17
17
  * @returns
18
18
  * A resolved promise if the lint is successful, a rejected promise if not.
19
19
  */
20
- lint(content: string, contentPath: string, options: any, optionsPath: string): Promise<any>;
20
+ lint(content: string, contentPath: string, options?: any, optionsPath?: string): Promise<any>;
21
21
  }
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const janitorLint = require('./janitor-lint-CA0qEXKV.cjs');
5
+ const janitorLint = require('./janitor-lint-DtB_4fzZ.cjs');
6
6
 
7
7
  function _define_property(obj, key, value) {
8
8
  if (key in obj) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;;;;;;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { a as ZConfigExtender, b as ZConfigReaderCosmic, c as ZConfigReaderNull, d as ZConfigReaderPrettier, e as ZContentLinterHtml, f as ZContentLinterJson, g as ZContentLinterPretty, h as ZContentLinterYaml, Z as ZJanitorLint, i as ZLinterEs, j as ZLinterFile, k as ZLinterMarkdown, l as ZLinterReport, m as ZLinterSpelling, n as ZLinterStyle } from './janitor-lint-QMZ00oXe.js';
1
+ export { a as ZConfigExtender, b as ZConfigReaderCosmic, c as ZConfigReaderNull, d as ZConfigReaderPrettier, e as ZContentLinterHtml, f as ZContentLinterJson, g as ZContentLinterPretty, h as ZContentLinterYaml, Z as ZJanitorLint, i as ZLinterEs, j as ZLinterFile, k as ZLinterMarkdown, l as ZLinterReport, m as ZLinterSpelling, n as ZLinterStyle } from './janitor-lint-BxUYJFY5.js';
2
2
 
3
3
  function _define_property(obj, key, value) {
4
4
  if (key in obj) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;"}
@@ -94,7 +94,7 @@ function _define_property$9(obj, key, value) {
94
94
  * A promise that resolves the extended configuration.
95
95
  */ extend(config) {
96
96
  return _async_to_generator$d(function*() {
97
- if (!Object.hasOwnProperty.call(config, this.key)) {
97
+ if (config == null || !Object.hasOwnProperty.call(config, this.key)) {
98
98
  return config;
99
99
  }
100
100
  const extensions = config[this.key];
@@ -346,7 +346,7 @@ function _async_to_generator$a(fn) {
346
346
  paths: [
347
347
  cwd
348
348
  ]
349
- }) : null;
349
+ }) : undefined;
350
350
  const ops = {
351
351
  config: configFile
352
352
  };
@@ -1229,12 +1229,12 @@ function _define_property(obj, key, value) {
1229
1229
  const { jsonFiles, jsonFilesExclude, yamlFiles, yamlFilesExclude, markdownConfig, markdownFiles, markdownFilesExclude, esConfig, esFiles, styleConfig, styleFiles, htmlConfig, htmlFiles, htmlFilesExclude, spellingConfig, spellingFiles, spellingFilesExclude, prettyConfig, prettyFiles, prettyFilesExclude } = lint;
1230
1230
  if (jsonFiles) {
1231
1231
  this._logger.log(chalk.magenta.underline(`Linting json files from ${jsonFiles.length} globs.`));
1232
- current = yield this.jsonLint.lint(jsonFiles, null, jsonFilesExclude);
1232
+ current = yield this.jsonLint.lint(jsonFiles, undefined, jsonFilesExclude);
1233
1233
  result = result && current;
1234
1234
  }
1235
1235
  if (yamlFiles) {
1236
1236
  this._logger.log(chalk.magenta.underline(`Linting yaml files from ${yamlFiles.length} globs.`));
1237
- current = yield this.yamlLint.lint(yamlFiles, null, yamlFilesExclude);
1237
+ current = yield this.yamlLint.lint(yamlFiles, undefined, yamlFilesExclude);
1238
1238
  result = result && current;
1239
1239
  }
1240
1240
  if (markdownFiles) {
@@ -1244,12 +1244,12 @@ function _define_property(obj, key, value) {
1244
1244
  }
1245
1245
  if (esFiles) {
1246
1246
  this._logger.log(chalk.magenta.underline(`Linting ecmaScript files from ${esFiles.length} globs.`));
1247
- current = yield this.esLint.lint(esFiles, esConfig, null);
1247
+ current = yield this.esLint.lint(esFiles, esConfig, undefined);
1248
1248
  result = result && current;
1249
1249
  }
1250
1250
  if (styleFiles) {
1251
1251
  this._logger.log(chalk.magenta.underline(`Linting style files from ${styleFiles.length} globs.`));
1252
- current = yield this.styleLint.lint(styleFiles, styleConfig, null);
1252
+ current = yield this.styleLint.lint(styleFiles, styleConfig, undefined);
1253
1253
  result = result && current;
1254
1254
  }
1255
1255
  if (htmlFiles) {
@@ -1350,4 +1350,4 @@ function _define_property(obj, key, value) {
1350
1350
  }
1351
1351
 
1352
1352
  export { ZJanitorLint as Z, ZConfigExtender as a, ZConfigReaderCosmic as b, ZConfigReaderNull as c, ZConfigReaderPrettier as d, ZContentLinterHtml as e, ZContentLinterJson as f, ZContentLinterPretty as g, ZContentLinterYaml as h, ZLinterEs as i, ZLinterFile as j, ZLinterMarkdown as k, ZLinterReport as l, ZLinterSpelling as m, ZLinterStyle as n };
1353
- //# sourceMappingURL=janitor-lint-QMZ00oXe.js.map
1353
+ //# sourceMappingURL=janitor-lint-BxUYJFY5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"janitor-lint-BxUYJFY5.js","sources":["../src/config/config-resolve.mts","../src/config/config-extender.mts","../src/config/config-reader-cosmic.mts","../src/config/config-reader-null.mts","../src/config/config-reader-prettier.mts","../src/content/content-linter-html.mts","../src/content/content-linter-json.mts","../src/content/content-linter-pretty.mts","../src/content/content-linter-yaml.mts","../src/linter/linter-es.mts","../src/linter/linter-file.mts","../src/linter/linter-markdown.mts","../src/linter/linter-report.mts","../src/linter/linter-spelling.mts","../src/linter/linter-style.mts","../src/app/janitor-lint.mts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nexport function $require(id: string) {\n const require = createRequire(import.meta.url);\n return require(id);\n}\n\nexport function $resolve(id: string, options?: { paths?: string[] }) {\n const require = createRequire(import.meta.url);\n return require.resolve(id, options);\n}\n","import { $require } from \"./config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to build configs using an extends pattern.\n */\nexport interface IZConfigExtender {\n /**\n * Expands a configuration object.\n *\n * @param config -\n * The current configuration object.\n */\n extend(config: any): Promise<string>;\n}\n\n/**\n * Represents the standard extender.\n *\n * This extender works the same as how eslint extends their\n * configuration. You can pass a key that acts as the extends key which holds paths\n * to the extendable files/modules. Note that this class, unlike eslint, does not assume any naming\n * conventions and ONLY shared configurations are supported. You must pass the full path of the\n * configs when extending, and plugin based syntax is not recognized.\n *\n * It is always better to just use the extension methods of the actual\n * applications if those are available, but this can be used as a fallback or an\n * extension of behavior for child linters that do not support extendable configs.\n */\nexport class ZConfigExtender implements IZConfigExtender {\n /**\n * Initializes a new instance of this object.\n *\n * @param key\n * - The key to extend.\n */\n public constructor(public key = \"extends\") {}\n\n /**\n * Extends the configuration value.\n *\n * This is similar to how eslint works. This will do an\n * asynchronous require on each configuration under the key in the\n * config. If the key in the config is falsy, then the config is returned.\n *\n * The actual key in the config is deleted.\n *\n * @param config\n * - The config to extend.\n *\n * @returns\n * A promise that resolves the extended configuration.\n */\n public async extend(config: any): Promise<any> {\n if (config == null || !Object.hasOwnProperty.call(config, this.key)) {\n return config;\n }\n\n const extensions = config[this.key];\n const modules = Array.isArray(extensions) ? extensions : [extensions];\n const resolved = await Promise.all(modules.map((m) => this._read(m)));\n let updated = resolved.reduce(\n (last, current) => Object.assign({}, last, current),\n {},\n );\n updated = Object.assign({}, updated, config);\n delete updated[this.key];\n return updated;\n }\n\n /**\n * Reads a module recursively.\n *\n * @param module\n * - The module to read.\n *\n * @returns\n * A promise that resolves the extended inner module.\n */\n private async _read(module: string) {\n const data = $require(module);\n return await this.extend(data);\n }\n}\n","import { cosmiconfig } from \"cosmiconfig\";\n\nimport { resolve } from \"path\";\nimport type { IZConfigDiscovery } from \"./config-discovery.mjs\";\nimport type { IZConfigExtender } from \"./config-extender.mjs\";\nimport type { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a reader that uses the cosmiconfig standard for files.\n */\nexport class ZConfigReaderCosmic implements IZConfigReader, IZConfigDiscovery {\n /**\n * Initializes a new instance of this object.\n *\n * @param name -\n * The name of the application to load.\n * @param extender -\n * The extender to expand upon the read configuration.\n * @param paths -\n * The additional paths to read if cosmic config does not find a valid config. Remember that these\n * are paths, not modules in this case, so you can't load things from the node modules directory\n * using these values. These only affect the search for the config file, not the actual\n * read of the config.\n */\n public constructor(\n public name: string,\n public extender: IZConfigExtender,\n public paths: string[] = [],\n ) {}\n\n /**\n * Runs a search for the appropriate configuration file.\n *\n * The extension keyword is deleted from the config.\n *\n * @returns\n * A promise that resolves with the expanded configuration.\n */\n public async search() {\n const explorer = cosmiconfig(this.name, { searchStrategy: \"project\" });\n\n // The first step is the standard cosmiconfig\n // search to see if any of these paths exists.\n // These are highest priority.\n const searched = await explorer.search();\n\n if (searched) {\n return searched.filepath;\n }\n\n // Try our additional paths, if any.\n for (const path of this.paths) {\n const full = resolve(path);\n const result = await explorer.load(full).catch(() => null);\n\n if (result) {\n return result.filepath;\n }\n }\n\n return null;\n }\n\n /**\n * Reads the config file.\n *\n * @param config -\n * The optional configuration file. If this is null then the cosmiconfig path is searched on the name.\n *\n * @returns\n * A promise that resolves the json object that represents the config.\n */\n public async read(config?: string): Promise<any> {\n const configLoad = config ? Promise.resolve(config) : this.search();\n const configFile = await configLoad;\n\n if (!configFile) {\n return {};\n }\n\n const path = $resolve(configFile, { paths: [process.cwd()] });\n const buffer = await cosmiconfig(this.name).load(path);\n return await this.extender.extend(buffer!.config);\n }\n}\n","import type { IZConfigReader } from \"./config-reader.mjs\";\n\n/**\n * Represents a config reader that returns the empty options.\n */\nexport class ZConfigReaderNull implements IZConfigReader {\n /**\n * Returns a null resolved promise.\n *\n * @returns\n * A promise that resolves to null.\n */\n public async read(): Promise<any> {\n return null;\n }\n}\n","import { resolve } from \"path\";\nimport type { Options, ResolveConfigOptions } from \"prettier\";\nimport { resolveConfig } from \"prettier\";\nimport type { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a configuration reader for prettier.\n */\nexport class ZConfigReaderPrettier implements IZConfigReader {\n /**\n * Reads the configuration file.\n *\n * @param config -\n * The config module to load. If this value is falsy,\n * then prettier will be used to retrieve the configuration.\n *\n * @returns\n * The options for the config file.\n */\n public async read(config?: string): Promise<Options> {\n const cwd = process.cwd();\n const configFile = config ? $resolve(config, { paths: [cwd] }) : undefined;\n const ops: ResolveConfigOptions = { config: configFile };\n // This function seems to have a slight issue in that it needs one directory deeper than\n // the directory you want to start the search in. The documentation on this isn't exactly correct,\n // and it was this change, https://github.com/prettier/prettier/pull/15363/files#diff-6569a6bfe16237da3c47f035a6f3325a79e958507cf866a1bd703ae9210129b3,\n // that broke it.\n const options = await resolveConfig(\n resolve(process.cwd(), \"some-prettier-config\"),\n ops,\n );\n\n return options || {};\n }\n}\n","import type { FormatOptions } from \"htmlhint\";\nimport { HTMLHint } from \"htmlhint\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to hint html files.\n */\nexport class ZContentLinterHtml implements IZContentLinter {\n private readonly _formatOptions: FormatOptions = { colors: true };\n\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public lint(\n content: string,\n contentPath: string,\n options?: any,\n ): Promise<any> {\n const messages = HTMLHint.verify(content, options);\n\n if (messages.length > 0) {\n const logs = HTMLHint.format(messages, this._formatOptions);\n return Promise.reject(logs);\n }\n\n return Promise.resolve(`${contentPath} is lint free.`);\n }\n}\n","import type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents the linter for json files.\n */\nexport class ZContentLinterJson implements IZContentLinter {\n /**\n * Lints the collection of json files.\n *\n * @param contents -\n * The json file contents.\n */\n public async lint(contents: string): Promise<any> {\n return JSON.parse(contents);\n }\n}\n","import type { Options } from \"prettier\";\nimport { check, getFileInfo } from \"prettier\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to perform prettier checks on files.\n */\nexport class ZContentLinterPretty implements IZContentLinter {\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public async lint(\n content: string,\n contentPath: string,\n options?: Options,\n ): Promise<any> {\n const file = await getFileInfo(contentPath);\n const finalOptions = Object.assign(\n {},\n { parser: file.inferredParser },\n options,\n );\n const formatted = await check(content, finalOptions);\n\n if (!formatted) {\n return Promise.reject(`${contentPath} is not formatted.`);\n }\n\n return Promise.resolve(`${contentPath} is properly formatted.`);\n }\n}\n","import { load } from \"js-yaml\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents a linter for yml files.\n */\nexport class ZContentLinterYaml implements IZContentLinter {\n /**\n * Lints yml files.\n *\n * @param contents -\n * Yaml formatted string.\n *\n * @returns\n * A promise that resolves if successful, or rejects if failed.\n */\n public async lint(contents: string): Promise<any> {\n return load(contents);\n }\n}\n","import { ESLint } from \"eslint\";\nimport { every } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform eslint on javascript files.\n */\nexport class ZLinterEs implements IZLinter {\n /**\n * The factory that constructs a CLIEngine object.\n *\n * @param options -\n * The engine options.\n *\n * @returns\n * The engine that can be used to perform eslint.\n */\n public engineFactory: (options: ESLint.Options) => ESLint = (options) =>\n new ESLint(options);\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n *\n * @returns\n * A promise that resolves to true if the lint is\n * fully successful, and false if the lint\n * has errors.\n */\n public async lint(src: string[], config?: string): Promise<boolean> {\n const esOptions: ESLint.Options = {};\n\n if (config) {\n esOptions.overrideConfigFile = $resolve(config, {\n paths: [process.cwd()],\n });\n }\n\n try {\n const engine = this.engineFactory(esOptions);\n const formatter = await engine.loadFormatter();\n const report = await engine.lintFiles(src);\n const output = formatter.format(report);\n this._logger.log(output);\n return every(report, (r) => r.errorCount === 0);\n } catch (err) {\n this._logger.log(err);\n return false;\n }\n }\n}\n","import chalk from \"chalk\";\nimport { readFile } from \"fs\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { resolve } from \"path\";\nimport { promisify } from \"util\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport type { IZContentLinter } from \"../content/content-linter.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can lint files one at a time.\n */\nexport class ZLinterFile implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _contentLint -\n * The linter for an individual file.\n * @param _configReader -\n * The config reader.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _contentLint: IZContentLinter,\n private readonly _configReader: IZConfigReader,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const readFileAsync = promisify(readFile);\n let options = {};\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n try {\n options = await this._configReader.read(config);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n this._logger.log();\n\n let result = true;\n\n for (const file of files) {\n const fullFilePath = resolve(file);\n try {\n const content = await readFileAsync(fullFilePath, \"utf-8\");\n await this._contentLint.lint(content, fullFilePath, options, config);\n } catch (err) {\n result = false;\n this._format(fullFilePath, err);\n }\n }\n\n return result;\n }\n\n /**\n * Formats a file error to the logger.\n *\n * @param file -\n * The file that failed to parse.\n * @param err -\n * The error that occurred.Ø\n */\n private _format(file: string, err: any) {\n const fileFormat = `Errors in ${file}`;\n this._logger.error(chalk.green.underline(fileFormat));\n\n if (Array.isArray(err)) {\n err.forEach((log) => this._logger.error(chalk.red(log)));\n } else {\n this._logger.error(chalk.red(err));\n }\n }\n}\n","import chalk from \"chalk\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { some, values } from \"lodash-es\";\nimport type { Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter object that checks markdown.\n */\nexport class ZLinterMarkdown implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to write messages to.\n * @param _reader -\n * The configuration reader.\n */\n public constructor(\n private readonly _logger: Console,\n private readonly _reader: IZConfigReader,\n ) {}\n\n /**\n * Lints all files matched by the specified glob pattern.\n *\n * @param src -\n * The glob patterns to match and lint.\n * @param cfg -\n * The optional config for the linter.\n * @param exclude -\n * The glob patterns to exclude.\n *\n * @returns A promise that resolves to true if the linting is ok, and false if the linting fails.\n */\n public async lint(\n src: string[],\n cfg: string,\n exclude: string[] = [],\n ): Promise<boolean> {\n let config: any;\n\n try {\n config = await this._reader.read(cfg);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n const options: Options = { files, config };\n const result = await lint(options);\n this._logger.log(`${result.toString().trim()}`);\n return !some(values(result), (val) => val.length > 0);\n }\n}\n","import chalk from \"chalk\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { uniq } from \"lodash-es\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that will report on file globs, but will\n * pass the actual linting job to another linter.\n */\nexport class ZLinterReport implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _child -\n * The child linter to pass the operation off to.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _child: IZLinter,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n files = uniq(files);\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n return this._child.lint(src, config, exclude);\n }\n}\n","import chalk from \"chalk\";\nimport type { CSpellApplicationOptions, CSpellReporter, Issue } from \"cspell\";\nimport { lint } from \"cspell\";\nimport { noop } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform cspell on files.\n */\nexport class ZLinterSpelling implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n * @param exclude -\n * The list of file globs to exclude.\n *\n * @returns\n * A promise that resolves to true if the\n * lint is fully successful, and false if the lint\n * has errors.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: CSpellApplicationOptions = { exclude };\n\n if (config) {\n options.config = $resolve(config, { paths: [process.cwd()] });\n }\n\n const info = noop;\n const debug = noop;\n const error = noop;\n const progress = noop;\n const result = noop;\n\n const issue = (issue: Issue) => {\n const position = `${issue.row}:${issue.col}`;\n this._logger.log(\n `${chalk.green(issue.uri)}:${chalk.yellow(position)} - Unknown word (${chalk.red(issue.text)})`,\n );\n };\n\n const emitters: CSpellReporter = {\n info,\n debug,\n error,\n progress,\n issue,\n result,\n };\n const runResult = await lint(src, options, emitters);\n\n if (runResult.errors > 0 || runResult.issues > 0) {\n return false;\n }\n\n this._logger.log();\n return true;\n }\n}\n","import stylelint from \"stylelint\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter for stylelint.\n */\nexport class ZLinterStyle implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to log the output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the file globs through the stylelint application.\n *\n * @param content -\n * The list of globs to lint.\n * @param config -\n * The linter config file.\n *\n * @returns\n * A promise that, when resolved, returns true\n * if there are no lint errors, or\n * false if errors are present.\n */\n public async lint(content: string[], config?: string): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n };\n\n if (config) {\n options.configFile = $resolve(config, { paths: [process.cwd()] });\n }\n\n const result = await stylelint.lint(options);\n const verbose = await stylelint.formatters.verbose;\n\n if (result.errored) {\n const output = verbose(result.results, result);\n this._logger.log(output);\n return false;\n }\n\n this._logger.log(\"\");\n return true;\n }\n}\n","import type { IZJanitorOptions } from \"@zthun/janitor-options\";\nimport chalk from \"chalk\";\nimport { ZConfigExtender } from \"../config/config-extender.mjs\";\nimport { ZConfigReaderCosmic } from \"../config/config-reader-cosmic.mjs\";\nimport { ZConfigReaderNull } from \"../config/config-reader-null.mjs\";\nimport { ZConfigReaderPrettier } from \"../config/config-reader-prettier.mjs\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { ZContentLinterHtml } from \"../content/content-linter-html.mjs\";\nimport { ZContentLinterJson } from \"../content/content-linter-json.mjs\";\nimport { ZContentLinterPretty } from \"../content/content-linter-pretty.mjs\";\nimport { ZContentLinterYaml } from \"../content/content-linter-yaml.mjs\";\nimport { ZLinterEs } from \"../linter/linter-es.mjs\";\nimport { ZLinterFile } from \"../linter/linter-file.mjs\";\nimport { ZLinterMarkdown } from \"../linter/linter-markdown.mjs\";\nimport { ZLinterReport } from \"../linter/linter-report.mjs\";\nimport { ZLinterSpelling } from \"../linter/linter-spelling.mjs\";\nimport { ZLinterStyle } from \"../linter/linter-style.mjs\";\nimport type { IZLinter } from \"../linter/linter.mjs\";\nimport type { IZJanitorLintArgs } from \"./janitor-lint-args.mjs\";\n\n/**\n * Represents the main entry point object for the application.\n */\nexport class ZJanitorLint {\n /**\n * The linter for js files.\n */\n public esLint: IZLinter;\n\n /**\n * The linter for cspell. Useful for multiple file types.\n */\n public spellLint: IZLinter;\n\n /**\n * The linter for prettier formatting checks.\n */\n public prettyLint: IZLinter;\n\n /**\n * The linter for style files.\n */\n public styleLint: IZLinter;\n\n /**\n * The linter for html files.\n *\n * Currently, htmlhint has no support for cosmiconfig based paths, so we're going to\n * add them here.\n */\n public htmlHint: IZLinter;\n\n /**\n * The linter for json files.\n */\n public jsonLint: IZLinter;\n\n /**\n * The linter for yaml files.\n */\n public yamlLint: IZLinter;\n\n /**\n * The linter for markdown files.\n *\n * Markdownlint is a bit annoying with this. They\n * don't really fully support the cosmiconfig standard,\n * and they only support the config files that are named\n * .markdownlint.yaml, .markdownlint.json, and .markdownlint.cjs\n */\n public markdownLint: IZLinter;\n\n /**\n * The configuration reader.\n */\n public config: IZConfigReader;\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to use when formatting output.\n */\n public constructor(private readonly _logger: Console) {\n this.esLint = new ZLinterReport(\n new ZLinterEs(this._logger),\n this._logger,\n \"es\",\n );\n this.spellLint = new ZLinterReport(\n new ZLinterSpelling(this._logger),\n this._logger,\n \"various\",\n );\n this.prettyLint = new ZLinterFile(\n new ZContentLinterPretty(),\n new ZConfigReaderPrettier(),\n this._logger,\n \"pretty\",\n );\n this.styleLint = new ZLinterReport(\n new ZLinterStyle(this._logger),\n this._logger,\n \"style\",\n );\n this.htmlHint = new ZLinterFile(\n new ZContentLinterHtml(),\n new ZConfigReaderCosmic(\"htmlhint\", new ZConfigExtender()),\n this._logger,\n \"html\",\n );\n this.jsonLint = new ZLinterFile(\n new ZContentLinterJson(),\n new ZConfigReaderNull(),\n this._logger,\n \"json\",\n );\n this.yamlLint = new ZLinterFile(\n new ZContentLinterYaml(),\n new ZConfigReaderNull(),\n this._logger,\n \"yaml\",\n );\n this.markdownLint = new ZLinterReport(\n new ZLinterMarkdown(\n this._logger,\n new ZConfigReaderCosmic(\"markdownlint\", new ZConfigExtender(), [\n \".markdownlint.json\",\n \".markdownlint.yaml\",\n \".markdownlint.cjs\",\n ]),\n ),\n this._logger,\n \"markdown\",\n );\n this.config = new ZConfigReaderCosmic(\"janitor\", new ZConfigExtender());\n }\n\n /**\n * Runs the lint given the required options.\n *\n * @param options -\n * The lint options.\n *\n * @returns\n * A promise that returns 0 if all linting was successful,\n * and 1 if any of the linting failed.\n */\n public async lint(options: IZJanitorOptions): Promise<number> {\n let current = true;\n let result = true;\n const { lint = {} } = options;\n const {\n jsonFiles,\n jsonFilesExclude,\n yamlFiles,\n yamlFilesExclude,\n markdownConfig,\n markdownFiles,\n markdownFilesExclude,\n esConfig,\n esFiles,\n styleConfig,\n styleFiles,\n htmlConfig,\n htmlFiles,\n htmlFilesExclude,\n spellingConfig,\n spellingFiles,\n spellingFilesExclude,\n prettyConfig,\n prettyFiles,\n prettyFilesExclude,\n } = lint;\n\n if (jsonFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting json files from ${jsonFiles.length} globs.`,\n ),\n );\n current = await this.jsonLint.lint(\n jsonFiles,\n undefined,\n jsonFilesExclude,\n );\n result = result && current;\n }\n\n if (yamlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting yaml files from ${yamlFiles.length} globs.`,\n ),\n );\n current = await this.yamlLint.lint(\n yamlFiles,\n undefined,\n yamlFilesExclude,\n );\n result = result && current;\n }\n\n if (markdownFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting markdown files from ${markdownFiles.length} globs.`,\n ),\n );\n current = await this.markdownLint.lint(\n markdownFiles,\n markdownConfig,\n markdownFilesExclude,\n );\n result = result && current;\n }\n\n if (esFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting ecmaScript files from ${esFiles.length} globs.`,\n ),\n );\n current = await this.esLint.lint(esFiles, esConfig, undefined);\n result = result && current;\n }\n\n if (styleFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting style files from ${styleFiles.length} globs.`,\n ),\n );\n current = await this.styleLint.lint(styleFiles, styleConfig, undefined);\n result = result && current;\n }\n\n if (htmlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting html files from ${htmlFiles.length} globs.`,\n ),\n );\n current = await this.htmlHint.lint(\n htmlFiles,\n htmlConfig,\n htmlFilesExclude,\n );\n result = result && current;\n }\n\n if (spellingFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking spelling for ${spellingFiles.length} globs.`,\n ),\n );\n current = await this.spellLint.lint(\n spellingFiles,\n spellingConfig,\n spellingFilesExclude,\n );\n result = result && current;\n }\n\n if (prettyFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking formatting for ${prettyFiles.length} globs.`,\n ),\n );\n current = await this.prettyLint.lint(\n prettyFiles,\n prettyConfig,\n prettyFilesExclude,\n );\n result = result && current;\n }\n\n return result ? 0 : 1;\n }\n\n /**\n * Runs the application.\n *\n * @param args -\n * The command line arguments.\n *\n * @returns\n * A promise that returns 0 if all linting was\n * successful, and 1 if any of the linting failed.\n */\n public async run(args: IZJanitorLintArgs): Promise<number> {\n try {\n const options = await this.config.read(args.config);\n return this.lint(options);\n } catch (err) {\n this._logger.error(err);\n return 1;\n }\n }\n}\n"],"names":["$require","id","require","createRequire","url","$resolve","options","resolve","ZConfigExtender","extend","config","Object","hasOwnProperty","call","key","extensions","modules","Array","isArray","resolved","Promise","all","map","m","_read","updated","reduce","last","current","assign","module","data","ZConfigReaderCosmic","search","explorer","cosmiconfig","name","searchStrategy","searched","filepath","path","paths","full","result","load","catch","read","configLoad","configFile","process","cwd","buffer","extender","ZConfigReaderNull","ZConfigReaderPrettier","undefined","ops","resolveConfig","ZContentLinterHtml","content","contentPath","messages","HTMLHint","verify","length","logs","format","_formatOptions","reject","_define_property","colors","ZContentLinterJson","lint","contents","JSON","parse","ZContentLinterPretty","file","getFileInfo","finalOptions","parser","inferredParser","formatted","check","ZContentLinterYaml","ZLinterEs","src","esOptions","overrideConfigFile","engine","engineFactory","formatter","loadFormatter","report","lintFiles","output","_logger","log","every","r","errorCount","err","ESLint","ZLinterFile","exclude","readFileAsync","promisify","readFile","globOptions","dot","ignore","files","forEach","pattern","concat","sync","chalk","yellow","italic","_configReader","error","red","green","_type","fullFilePath","_contentLint","_format","fileFormat","underline","ZLinterMarkdown","cfg","_reader","toString","trim","some","values","val","ZLinterReport","uniq","_child","ZLinterSpelling","info","noop","debug","progress","issue","position","row","col","uri","text","emitters","runResult","errors","issues","ZLinterStyle","stylelint","verbose","formatters","errored","results","ZJanitorLint","jsonFiles","jsonFilesExclude","yamlFiles","yamlFilesExclude","markdownConfig","markdownFiles","markdownFilesExclude","esConfig","esFiles","styleConfig","styleFiles","htmlConfig","htmlFiles","htmlFilesExclude","spellingConfig","spellingFiles","spellingFilesExclude","prettyConfig","prettyFiles","prettyFilesExclude","magenta","jsonLint","yamlLint","markdownLint","esLint","styleLint","htmlHint","spellLint","prettyLint","run","args"],"mappings":";;;;;;;;;;;;;;;;AAEO,SAASA,SAASC,EAAU,EAAA;IACjC,MAAMC,OAAAA,GAAUC,aAAc,CAAA,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;A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AA,EAAA,IAAI,CAAC0C,OAAO,EACZ,QAAA,CAAA;AAEF,QAAA,IAAI,CAAC2F,SAAS,GAAG,IAAIlD,cACnB,IAAIkB,YAAAA,CAAa,IAAI,CAAC3D,OAAO,CAAA,EAC7B,IAAI,CAACA,OAAO,EACZ,OAAA,CAAA;AAEF,QAAA,IAAI,CAAC4F,QAAQ,GAAG,IAAIrF,YAClB,IAAI7C,kBAAAA,EAAAA,EACJ,IAAI1B,mBAAAA,CAAoB,YAAY,IAAIxB,eAAAA,EAAAA,CAAAA,EACxC,IAAI,CAACwF,OAAO,EACZ,MAAA,CAAA;AAEF,QAAA,IAAI,CAACuF,QAAQ,GAAG,IAAIhF,WAClB,CAAA,IAAIhC,kBACJ,EAAA,EAAA,IAAIlB,iBACJ,EAAA,EAAA,IAAI,CAAC2C,OAAO,EACZ,MAAA,CAAA;AAEF,QAAA,IAAI,CAACwF,QAAQ,GAAG,IAAIjF,WAClB,CAAA,IAAInB,kBACJ,EAAA,EAAA,IAAI/B,iBACJ,EAAA,EAAA,IAAI,CAAC2C,OAAO,EACZ,MAAA,CAAA;AAEF,QAAA,IAAI,CAACyF,YAAY,GAAG,IAAIhD,cACtB,IAAIR,eAAAA,CACF,IAAI,CAACjC,OAAO,EACZ,IAAIhE,mBAAoB,CAAA,cAAA,EAAgB,IAAIxB,eAAmB,EAAA,EAAA;AAC7D,YAAA,oBAAA;AACA,YAAA,oBAAA;AACA,YAAA;SACD,CAEH,CAAA,EAAA,IAAI,CAACwF,OAAO,EACZ,UAAA,CAAA;AAEF,QAAA,IAAI,CAACtF,MAAM,GAAG,IAAIsB,mBAAAA,CAAoB,WAAW,IAAIxB,eAAAA,EAAAA,CAAAA;AACvD;AAqKF;;;;"}
@@ -18,11 +18,11 @@ const stylelint = require('stylelint');
18
18
 
19
19
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
20
20
  function $require(id) {
21
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('janitor-lint-CA0qEXKV.cjs', document.baseURI).href)));
21
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('janitor-lint-DtB_4fzZ.cjs', document.baseURI).href)));
22
22
  return require$1(id);
23
23
  }
24
24
  function $resolve(id, options) {
25
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('janitor-lint-CA0qEXKV.cjs', document.baseURI).href)));
25
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('janitor-lint-DtB_4fzZ.cjs', document.baseURI).href)));
26
26
  return require$1.resolve(id, options);
27
27
  }
28
28
 
@@ -97,7 +97,7 @@ function _define_property$9(obj, key, value) {
97
97
  * A promise that resolves the extended configuration.
98
98
  */ extend(config) {
99
99
  return _async_to_generator$d(function*() {
100
- if (!Object.hasOwnProperty.call(config, this.key)) {
100
+ if (config == null || !Object.hasOwnProperty.call(config, this.key)) {
101
101
  return config;
102
102
  }
103
103
  const extensions = config[this.key];
@@ -349,7 +349,7 @@ function _async_to_generator$a(fn) {
349
349
  paths: [
350
350
  cwd
351
351
  ]
352
- }) : null;
352
+ }) : undefined;
353
353
  const ops = {
354
354
  config: configFile
355
355
  };
@@ -1232,12 +1232,12 @@ function _define_property(obj, key, value) {
1232
1232
  const { jsonFiles, jsonFilesExclude, yamlFiles, yamlFilesExclude, markdownConfig, markdownFiles, markdownFilesExclude, esConfig, esFiles, styleConfig, styleFiles, htmlConfig, htmlFiles, htmlFilesExclude, spellingConfig, spellingFiles, spellingFilesExclude, prettyConfig, prettyFiles, prettyFilesExclude } = lint;
1233
1233
  if (jsonFiles) {
1234
1234
  this._logger.log(chalk.magenta.underline(`Linting json files from ${jsonFiles.length} globs.`));
1235
- current = yield this.jsonLint.lint(jsonFiles, null, jsonFilesExclude);
1235
+ current = yield this.jsonLint.lint(jsonFiles, undefined, jsonFilesExclude);
1236
1236
  result = result && current;
1237
1237
  }
1238
1238
  if (yamlFiles) {
1239
1239
  this._logger.log(chalk.magenta.underline(`Linting yaml files from ${yamlFiles.length} globs.`));
1240
- current = yield this.yamlLint.lint(yamlFiles, null, yamlFilesExclude);
1240
+ current = yield this.yamlLint.lint(yamlFiles, undefined, yamlFilesExclude);
1241
1241
  result = result && current;
1242
1242
  }
1243
1243
  if (markdownFiles) {
@@ -1247,12 +1247,12 @@ function _define_property(obj, key, value) {
1247
1247
  }
1248
1248
  if (esFiles) {
1249
1249
  this._logger.log(chalk.magenta.underline(`Linting ecmaScript files from ${esFiles.length} globs.`));
1250
- current = yield this.esLint.lint(esFiles, esConfig, null);
1250
+ current = yield this.esLint.lint(esFiles, esConfig, undefined);
1251
1251
  result = result && current;
1252
1252
  }
1253
1253
  if (styleFiles) {
1254
1254
  this._logger.log(chalk.magenta.underline(`Linting style files from ${styleFiles.length} globs.`));
1255
- current = yield this.styleLint.lint(styleFiles, styleConfig, null);
1255
+ current = yield this.styleLint.lint(styleFiles, styleConfig, undefined);
1256
1256
  result = result && current;
1257
1257
  }
1258
1258
  if (htmlFiles) {
@@ -1367,4 +1367,4 @@ exports.ZLinterMarkdown = ZLinterMarkdown;
1367
1367
  exports.ZLinterReport = ZLinterReport;
1368
1368
  exports.ZLinterSpelling = ZLinterSpelling;
1369
1369
  exports.ZLinterStyle = ZLinterStyle;
1370
- //# sourceMappingURL=janitor-lint-CA0qEXKV.cjs.map
1370
+ //# sourceMappingURL=janitor-lint-DtB_4fzZ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"janitor-lint-DtB_4fzZ.cjs","sources":["../src/config/config-resolve.mts","../src/config/config-extender.mts","../src/config/config-reader-cosmic.mts","../src/config/config-reader-null.mts","../src/config/config-reader-prettier.mts","../src/content/content-linter-html.mts","../src/content/content-linter-json.mts","../src/content/content-linter-pretty.mts","../src/content/content-linter-yaml.mts","../src/linter/linter-es.mts","../src/linter/linter-file.mts","../src/linter/linter-markdown.mts","../src/linter/linter-report.mts","../src/linter/linter-spelling.mts","../src/linter/linter-style.mts","../src/app/janitor-lint.mts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nexport function $require(id: string) {\n const require = createRequire(import.meta.url);\n return require(id);\n}\n\nexport function $resolve(id: string, options?: { paths?: string[] }) {\n const require = createRequire(import.meta.url);\n return require.resolve(id, options);\n}\n","import { $require } from \"./config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to build configs using an extends pattern.\n */\nexport interface IZConfigExtender {\n /**\n * Expands a configuration object.\n *\n * @param config -\n * The current configuration object.\n */\n extend(config: any): Promise<string>;\n}\n\n/**\n * Represents the standard extender.\n *\n * This extender works the same as how eslint extends their\n * configuration. You can pass a key that acts as the extends key which holds paths\n * to the extendable files/modules. Note that this class, unlike eslint, does not assume any naming\n * conventions and ONLY shared configurations are supported. You must pass the full path of the\n * configs when extending, and plugin based syntax is not recognized.\n *\n * It is always better to just use the extension methods of the actual\n * applications if those are available, but this can be used as a fallback or an\n * extension of behavior for child linters that do not support extendable configs.\n */\nexport class ZConfigExtender implements IZConfigExtender {\n /**\n * Initializes a new instance of this object.\n *\n * @param key\n * - The key to extend.\n */\n public constructor(public key = \"extends\") {}\n\n /**\n * Extends the configuration value.\n *\n * This is similar to how eslint works. This will do an\n * asynchronous require on each configuration under the key in the\n * config. If the key in the config is falsy, then the config is returned.\n *\n * The actual key in the config is deleted.\n *\n * @param config\n * - The config to extend.\n *\n * @returns\n * A promise that resolves the extended configuration.\n */\n public async extend(config: any): Promise<any> {\n if (config == null || !Object.hasOwnProperty.call(config, this.key)) {\n return config;\n }\n\n const extensions = config[this.key];\n const modules = Array.isArray(extensions) ? extensions : [extensions];\n const resolved = await Promise.all(modules.map((m) => this._read(m)));\n let updated = resolved.reduce(\n (last, current) => Object.assign({}, last, current),\n {},\n );\n updated = Object.assign({}, updated, config);\n delete updated[this.key];\n return updated;\n }\n\n /**\n * Reads a module recursively.\n *\n * @param module\n * - The module to read.\n *\n * @returns\n * A promise that resolves the extended inner module.\n */\n private async _read(module: string) {\n const data = $require(module);\n return await this.extend(data);\n }\n}\n","import { cosmiconfig } from \"cosmiconfig\";\n\nimport { resolve } from \"path\";\nimport type { IZConfigDiscovery } from \"./config-discovery.mjs\";\nimport type { IZConfigExtender } from \"./config-extender.mjs\";\nimport type { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a reader that uses the cosmiconfig standard for files.\n */\nexport class ZConfigReaderCosmic implements IZConfigReader, IZConfigDiscovery {\n /**\n * Initializes a new instance of this object.\n *\n * @param name -\n * The name of the application to load.\n * @param extender -\n * The extender to expand upon the read configuration.\n * @param paths -\n * The additional paths to read if cosmic config does not find a valid config. Remember that these\n * are paths, not modules in this case, so you can't load things from the node modules directory\n * using these values. These only affect the search for the config file, not the actual\n * read of the config.\n */\n public constructor(\n public name: string,\n public extender: IZConfigExtender,\n public paths: string[] = [],\n ) {}\n\n /**\n * Runs a search for the appropriate configuration file.\n *\n * The extension keyword is deleted from the config.\n *\n * @returns\n * A promise that resolves with the expanded configuration.\n */\n public async search() {\n const explorer = cosmiconfig(this.name, { searchStrategy: \"project\" });\n\n // The first step is the standard cosmiconfig\n // search to see if any of these paths exists.\n // These are highest priority.\n const searched = await explorer.search();\n\n if (searched) {\n return searched.filepath;\n }\n\n // Try our additional paths, if any.\n for (const path of this.paths) {\n const full = resolve(path);\n const result = await explorer.load(full).catch(() => null);\n\n if (result) {\n return result.filepath;\n }\n }\n\n return null;\n }\n\n /**\n * Reads the config file.\n *\n * @param config -\n * The optional configuration file. If this is null then the cosmiconfig path is searched on the name.\n *\n * @returns\n * A promise that resolves the json object that represents the config.\n */\n public async read(config?: string): Promise<any> {\n const configLoad = config ? Promise.resolve(config) : this.search();\n const configFile = await configLoad;\n\n if (!configFile) {\n return {};\n }\n\n const path = $resolve(configFile, { paths: [process.cwd()] });\n const buffer = await cosmiconfig(this.name).load(path);\n return await this.extender.extend(buffer!.config);\n }\n}\n","import type { IZConfigReader } from \"./config-reader.mjs\";\n\n/**\n * Represents a config reader that returns the empty options.\n */\nexport class ZConfigReaderNull implements IZConfigReader {\n /**\n * Returns a null resolved promise.\n *\n * @returns\n * A promise that resolves to null.\n */\n public async read(): Promise<any> {\n return null;\n }\n}\n","import { resolve } from \"path\";\nimport type { Options, ResolveConfigOptions } from \"prettier\";\nimport { resolveConfig } from \"prettier\";\nimport type { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a configuration reader for prettier.\n */\nexport class ZConfigReaderPrettier implements IZConfigReader {\n /**\n * Reads the configuration file.\n *\n * @param config -\n * The config module to load. If this value is falsy,\n * then prettier will be used to retrieve the configuration.\n *\n * @returns\n * The options for the config file.\n */\n public async read(config?: string): Promise<Options> {\n const cwd = process.cwd();\n const configFile = config ? $resolve(config, { paths: [cwd] }) : undefined;\n const ops: ResolveConfigOptions = { config: configFile };\n // This function seems to have a slight issue in that it needs one directory deeper than\n // the directory you want to start the search in. The documentation on this isn't exactly correct,\n // and it was this change, https://github.com/prettier/prettier/pull/15363/files#diff-6569a6bfe16237da3c47f035a6f3325a79e958507cf866a1bd703ae9210129b3,\n // that broke it.\n const options = await resolveConfig(\n resolve(process.cwd(), \"some-prettier-config\"),\n ops,\n );\n\n return options || {};\n }\n}\n","import type { FormatOptions } from \"htmlhint\";\nimport { HTMLHint } from \"htmlhint\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to hint html files.\n */\nexport class ZContentLinterHtml implements IZContentLinter {\n private readonly _formatOptions: FormatOptions = { colors: true };\n\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public lint(\n content: string,\n contentPath: string,\n options?: any,\n ): Promise<any> {\n const messages = HTMLHint.verify(content, options);\n\n if (messages.length > 0) {\n const logs = HTMLHint.format(messages, this._formatOptions);\n return Promise.reject(logs);\n }\n\n return Promise.resolve(`${contentPath} is lint free.`);\n }\n}\n","import type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents the linter for json files.\n */\nexport class ZContentLinterJson implements IZContentLinter {\n /**\n * Lints the collection of json files.\n *\n * @param contents -\n * The json file contents.\n */\n public async lint(contents: string): Promise<any> {\n return JSON.parse(contents);\n }\n}\n","import type { Options } from \"prettier\";\nimport { check, getFileInfo } from \"prettier\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to perform prettier checks on files.\n */\nexport class ZContentLinterPretty implements IZContentLinter {\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public async lint(\n content: string,\n contentPath: string,\n options?: Options,\n ): Promise<any> {\n const file = await getFileInfo(contentPath);\n const finalOptions = Object.assign(\n {},\n { parser: file.inferredParser },\n options,\n );\n const formatted = await check(content, finalOptions);\n\n if (!formatted) {\n return Promise.reject(`${contentPath} is not formatted.`);\n }\n\n return Promise.resolve(`${contentPath} is properly formatted.`);\n }\n}\n","import { load } from \"js-yaml\";\nimport type { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents a linter for yml files.\n */\nexport class ZContentLinterYaml implements IZContentLinter {\n /**\n * Lints yml files.\n *\n * @param contents -\n * Yaml formatted string.\n *\n * @returns\n * A promise that resolves if successful, or rejects if failed.\n */\n public async lint(contents: string): Promise<any> {\n return load(contents);\n }\n}\n","import { ESLint } from \"eslint\";\nimport { every } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform eslint on javascript files.\n */\nexport class ZLinterEs implements IZLinter {\n /**\n * The factory that constructs a CLIEngine object.\n *\n * @param options -\n * The engine options.\n *\n * @returns\n * The engine that can be used to perform eslint.\n */\n public engineFactory: (options: ESLint.Options) => ESLint = (options) =>\n new ESLint(options);\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n *\n * @returns\n * A promise that resolves to true if the lint is\n * fully successful, and false if the lint\n * has errors.\n */\n public async lint(src: string[], config?: string): Promise<boolean> {\n const esOptions: ESLint.Options = {};\n\n if (config) {\n esOptions.overrideConfigFile = $resolve(config, {\n paths: [process.cwd()],\n });\n }\n\n try {\n const engine = this.engineFactory(esOptions);\n const formatter = await engine.loadFormatter();\n const report = await engine.lintFiles(src);\n const output = formatter.format(report);\n this._logger.log(output);\n return every(report, (r) => r.errorCount === 0);\n } catch (err) {\n this._logger.log(err);\n return false;\n }\n }\n}\n","import chalk from \"chalk\";\nimport { readFile } from \"fs\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { resolve } from \"path\";\nimport { promisify } from \"util\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport type { IZContentLinter } from \"../content/content-linter.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can lint files one at a time.\n */\nexport class ZLinterFile implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _contentLint -\n * The linter for an individual file.\n * @param _configReader -\n * The config reader.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _contentLint: IZContentLinter,\n private readonly _configReader: IZConfigReader,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const readFileAsync = promisify(readFile);\n let options = {};\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n try {\n options = await this._configReader.read(config);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n this._logger.log();\n\n let result = true;\n\n for (const file of files) {\n const fullFilePath = resolve(file);\n try {\n const content = await readFileAsync(fullFilePath, \"utf-8\");\n await this._contentLint.lint(content, fullFilePath, options, config);\n } catch (err) {\n result = false;\n this._format(fullFilePath, err);\n }\n }\n\n return result;\n }\n\n /**\n * Formats a file error to the logger.\n *\n * @param file -\n * The file that failed to parse.\n * @param err -\n * The error that occurred.Ø\n */\n private _format(file: string, err: any) {\n const fileFormat = `Errors in ${file}`;\n this._logger.error(chalk.green.underline(fileFormat));\n\n if (Array.isArray(err)) {\n err.forEach((log) => this._logger.error(chalk.red(log)));\n } else {\n this._logger.error(chalk.red(err));\n }\n }\n}\n","import chalk from \"chalk\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { some, values } from \"lodash-es\";\nimport type { Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter object that checks markdown.\n */\nexport class ZLinterMarkdown implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to write messages to.\n * @param _reader -\n * The configuration reader.\n */\n public constructor(\n private readonly _logger: Console,\n private readonly _reader: IZConfigReader,\n ) {}\n\n /**\n * Lints all files matched by the specified glob pattern.\n *\n * @param src -\n * The glob patterns to match and lint.\n * @param cfg -\n * The optional config for the linter.\n * @param exclude -\n * The glob patterns to exclude.\n *\n * @returns A promise that resolves to true if the linting is ok, and false if the linting fails.\n */\n public async lint(\n src: string[],\n cfg: string,\n exclude: string[] = [],\n ): Promise<boolean> {\n let config: any;\n\n try {\n config = await this._reader.read(cfg);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n const options: Options = { files, config };\n const result = await lint(options);\n this._logger.log(`${result.toString().trim()}`);\n return !some(values(result), (val) => val.length > 0);\n }\n}\n","import chalk from \"chalk\";\nimport type { GlobOptionsWithFileTypesFalse } from \"glob\";\nimport { sync } from \"glob\";\nimport { uniq } from \"lodash-es\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that will report on file globs, but will\n * pass the actual linting job to another linter.\n */\nexport class ZLinterReport implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _child -\n * The child linter to pass the operation off to.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _child: IZLinter,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n files = uniq(files);\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n return this._child.lint(src, config, exclude);\n }\n}\n","import chalk from \"chalk\";\nimport type { CSpellApplicationOptions, CSpellReporter, Issue } from \"cspell\";\nimport { lint } from \"cspell\";\nimport { noop } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform cspell on files.\n */\nexport class ZLinterSpelling implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n * @param exclude -\n * The list of file globs to exclude.\n *\n * @returns\n * A promise that resolves to true if the\n * lint is fully successful, and false if the lint\n * has errors.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: CSpellApplicationOptions = { exclude };\n\n if (config) {\n options.config = $resolve(config, { paths: [process.cwd()] });\n }\n\n const info = noop;\n const debug = noop;\n const error = noop;\n const progress = noop;\n const result = noop;\n\n const issue = (issue: Issue) => {\n const position = `${issue.row}:${issue.col}`;\n this._logger.log(\n `${chalk.green(issue.uri)}:${chalk.yellow(position)} - Unknown word (${chalk.red(issue.text)})`,\n );\n };\n\n const emitters: CSpellReporter = {\n info,\n debug,\n error,\n progress,\n issue,\n result,\n };\n const runResult = await lint(src, options, emitters);\n\n if (runResult.errors > 0 || runResult.issues > 0) {\n return false;\n }\n\n this._logger.log();\n return true;\n }\n}\n","import stylelint from \"stylelint\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport type { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter for stylelint.\n */\nexport class ZLinterStyle implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to log the output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the file globs through the stylelint application.\n *\n * @param content -\n * The list of globs to lint.\n * @param config -\n * The linter config file.\n *\n * @returns\n * A promise that, when resolved, returns true\n * if there are no lint errors, or\n * false if errors are present.\n */\n public async lint(content: string[], config?: string): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n };\n\n if (config) {\n options.configFile = $resolve(config, { paths: [process.cwd()] });\n }\n\n const result = await stylelint.lint(options);\n const verbose = await stylelint.formatters.verbose;\n\n if (result.errored) {\n const output = verbose(result.results, result);\n this._logger.log(output);\n return false;\n }\n\n this._logger.log(\"\");\n return true;\n }\n}\n","import type { IZJanitorOptions } from \"@zthun/janitor-options\";\nimport chalk from \"chalk\";\nimport { ZConfigExtender } from \"../config/config-extender.mjs\";\nimport { ZConfigReaderCosmic } from \"../config/config-reader-cosmic.mjs\";\nimport { ZConfigReaderNull } from \"../config/config-reader-null.mjs\";\nimport { ZConfigReaderPrettier } from \"../config/config-reader-prettier.mjs\";\nimport type { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { ZContentLinterHtml } from \"../content/content-linter-html.mjs\";\nimport { ZContentLinterJson } from \"../content/content-linter-json.mjs\";\nimport { ZContentLinterPretty } from \"../content/content-linter-pretty.mjs\";\nimport { ZContentLinterYaml } from \"../content/content-linter-yaml.mjs\";\nimport { ZLinterEs } from \"../linter/linter-es.mjs\";\nimport { ZLinterFile } from \"../linter/linter-file.mjs\";\nimport { ZLinterMarkdown } from \"../linter/linter-markdown.mjs\";\nimport { ZLinterReport } from \"../linter/linter-report.mjs\";\nimport { ZLinterSpelling } from \"../linter/linter-spelling.mjs\";\nimport { ZLinterStyle } from \"../linter/linter-style.mjs\";\nimport type { IZLinter } from \"../linter/linter.mjs\";\nimport type { IZJanitorLintArgs } from \"./janitor-lint-args.mjs\";\n\n/**\n * Represents the main entry point object for the application.\n */\nexport class ZJanitorLint {\n /**\n * The linter for js files.\n */\n public esLint: IZLinter;\n\n /**\n * The linter for cspell. Useful for multiple file types.\n */\n public spellLint: IZLinter;\n\n /**\n * The linter for prettier formatting checks.\n */\n public prettyLint: IZLinter;\n\n /**\n * The linter for style files.\n */\n public styleLint: IZLinter;\n\n /**\n * The linter for html files.\n *\n * Currently, htmlhint has no support for cosmiconfig based paths, so we're going to\n * add them here.\n */\n public htmlHint: IZLinter;\n\n /**\n * The linter for json files.\n */\n public jsonLint: IZLinter;\n\n /**\n * The linter for yaml files.\n */\n public yamlLint: IZLinter;\n\n /**\n * The linter for markdown files.\n *\n * Markdownlint is a bit annoying with this. They\n * don't really fully support the cosmiconfig standard,\n * and they only support the config files that are named\n * .markdownlint.yaml, .markdownlint.json, and .markdownlint.cjs\n */\n public markdownLint: IZLinter;\n\n /**\n * The configuration reader.\n */\n public config: IZConfigReader;\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to use when formatting output.\n */\n public constructor(private readonly _logger: Console) {\n this.esLint = new ZLinterReport(\n new ZLinterEs(this._logger),\n this._logger,\n \"es\",\n );\n this.spellLint = new ZLinterReport(\n new ZLinterSpelling(this._logger),\n this._logger,\n \"various\",\n );\n this.prettyLint = new ZLinterFile(\n new ZContentLinterPretty(),\n new ZConfigReaderPrettier(),\n this._logger,\n \"pretty\",\n );\n this.styleLint = new ZLinterReport(\n new ZLinterStyle(this._logger),\n this._logger,\n \"style\",\n );\n this.htmlHint = new ZLinterFile(\n new ZContentLinterHtml(),\n new ZConfigReaderCosmic(\"htmlhint\", new ZConfigExtender()),\n this._logger,\n \"html\",\n );\n this.jsonLint = new ZLinterFile(\n new ZContentLinterJson(),\n new ZConfigReaderNull(),\n this._logger,\n \"json\",\n );\n this.yamlLint = new ZLinterFile(\n new ZContentLinterYaml(),\n new ZConfigReaderNull(),\n this._logger,\n \"yaml\",\n );\n this.markdownLint = new ZLinterReport(\n new ZLinterMarkdown(\n this._logger,\n new ZConfigReaderCosmic(\"markdownlint\", new ZConfigExtender(), [\n \".markdownlint.json\",\n \".markdownlint.yaml\",\n \".markdownlint.cjs\",\n ]),\n ),\n this._logger,\n \"markdown\",\n );\n this.config = new ZConfigReaderCosmic(\"janitor\", new ZConfigExtender());\n }\n\n /**\n * Runs the lint given the required options.\n *\n * @param options -\n * The lint options.\n *\n * @returns\n * A promise that returns 0 if all linting was successful,\n * and 1 if any of the linting failed.\n */\n public async lint(options: IZJanitorOptions): Promise<number> {\n let current = true;\n let result = true;\n const { lint = {} } = options;\n const {\n jsonFiles,\n jsonFilesExclude,\n yamlFiles,\n yamlFilesExclude,\n markdownConfig,\n markdownFiles,\n markdownFilesExclude,\n esConfig,\n esFiles,\n styleConfig,\n styleFiles,\n htmlConfig,\n htmlFiles,\n htmlFilesExclude,\n spellingConfig,\n spellingFiles,\n spellingFilesExclude,\n prettyConfig,\n prettyFiles,\n prettyFilesExclude,\n } = lint;\n\n if (jsonFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting json files from ${jsonFiles.length} globs.`,\n ),\n );\n current = await this.jsonLint.lint(\n jsonFiles,\n undefined,\n jsonFilesExclude,\n );\n result = result && current;\n }\n\n if (yamlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting yaml files from ${yamlFiles.length} globs.`,\n ),\n );\n current = await this.yamlLint.lint(\n yamlFiles,\n undefined,\n yamlFilesExclude,\n );\n result = result && current;\n }\n\n if (markdownFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting markdown files from ${markdownFiles.length} globs.`,\n ),\n );\n current = await this.markdownLint.lint(\n markdownFiles,\n markdownConfig,\n markdownFilesExclude,\n );\n result = result && current;\n }\n\n if (esFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting ecmaScript files from ${esFiles.length} globs.`,\n ),\n );\n current = await this.esLint.lint(esFiles, esConfig, undefined);\n result = result && current;\n }\n\n if (styleFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting style files from ${styleFiles.length} globs.`,\n ),\n );\n current = await this.styleLint.lint(styleFiles, styleConfig, undefined);\n result = result && current;\n }\n\n if (htmlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting html files from ${htmlFiles.length} globs.`,\n ),\n );\n current = await this.htmlHint.lint(\n htmlFiles,\n htmlConfig,\n htmlFilesExclude,\n );\n result = result && current;\n }\n\n if (spellingFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking spelling for ${spellingFiles.length} globs.`,\n ),\n );\n current = await this.spellLint.lint(\n spellingFiles,\n spellingConfig,\n spellingFilesExclude,\n );\n result = result && current;\n }\n\n if (prettyFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking formatting for ${prettyFiles.length} globs.`,\n ),\n );\n current = await this.prettyLint.lint(\n prettyFiles,\n prettyConfig,\n prettyFilesExclude,\n );\n result = result && current;\n }\n\n return result ? 0 : 1;\n }\n\n /**\n * Runs the application.\n *\n * @param args -\n * The command line arguments.\n *\n * @returns\n * A promise that returns 0 if all linting was\n * successful, and 1 if any of the linting failed.\n */\n public async run(args: IZJanitorLintArgs): Promise<number> {\n try {\n const options = await this.config.read(args.config);\n return this.lint(options);\n } catch (err) {\n this._logger.error(err);\n return 1;\n }\n }\n}\n"],"names":["$require","id","require","createRequire","$resolve","options","resolve","ZConfigExtender","extend","config","Object","hasOwnProperty","call","key","extensions","modules","Array","isArray","resolved","Promise","all","map","m","_read","updated","reduce","last","current","assign","module","data","ZConfigReaderCosmic","search","explorer","cosmiconfig","name","searchStrategy","searched","filepath","path","paths","full","result","load","catch","read","configLoad","configFile","process","cwd","buffer","extender","ZConfigReaderNull","ZConfigReaderPrettier","undefined","ops","resolveConfig","ZContentLinterHtml","content","contentPath","messages","HTMLHint","verify","length","logs","format","_formatOptions","reject","_define_property","colors","ZContentLinterJson","lint","contents","JSON","parse","ZContentLinterPretty","file","getFileInfo","finalOptions","parser","inferredParser","formatted","check","ZContentLinterYaml","ZLinterEs","src","esOptions","overrideConfigFile","engine","engineFactory","formatter","loadFormatter","report","lintFiles","output","_logger","log","every","r","errorCount","err","ESLint","ZLinterFile","exclude","readFileAsync","promisify","readFile","globOptions","dot","ignore","files","forEach","pattern","concat","sync","chalk","yellow","italic","_configReader","error","red","green","_type","fullFilePath","_contentLint","_format","fileFormat","underline","ZLinterMarkdown","cfg","_reader","toString","trim","some","values","val","ZLinterReport","uniq","_child","ZLinterSpelling","info","noop","debug","progress","issue","position","row","col","uri","text","emitters","runResult","errors","issues","ZLinterStyle","stylelint","verbose","formatters","errored","results","ZJanitorLint","jsonFiles","jsonFilesExclude","yamlFiles","yamlFilesExclude","markdownConfig","markdownFiles","markdownFilesExclude","esConfig","esFiles","styleConfig","styleFiles","htmlConfig","htmlFiles","htmlFilesExclude","spellingConfig","spellingFiles","spellingFilesExclude","prettyConfig","prettyFiles","prettyFilesExclude","magenta","jsonLint","yamlLint","markdownLint","esLint","styleLint","htmlHint","spellLint","prettyLint","run","args"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,SAASA,SAASC,EAAU,EAAA;IACjC,MAAMC,SAAAA,GAAUC,yBAAc,CAAA,2QAAe,CAAA;AAC7C,IAAA,OAAOD,SAAQD,CAAAA,EAAAA,CAAAA;AACjB;AAEO,SAASG,QAAAA,CAASH,EAAU,EAAEI,OAA8B,EAAA;IACjE,MAAMH,SAAAA,GAAUC,yBAAc,CAAA,2QAAe,CAAA;IAC7C,OAAOD,SAAAA,CAAQI,OAAO,CAACL,EAAII,EAAAA,OAAAA,CAAAA;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;AAYC,IACM,MAAME,eAAAA,CAAAA;AASX;;;;;;;;;;;;;;MAeaC,OAAOC,MA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AI,CAACuF,QAAQ,GAAG,IAAIhF,WAClB,CAAA,IAAIhC,kBACJ,EAAA,EAAA,IAAIlB,iBACJ,EAAA,EAAA,IAAI,CAAC2C,OAAO,EACZ,MAAA,CAAA;AAEF,QAAA,IAAI,CAACwF,QAAQ,GAAG,IAAIjF,WAClB,CAAA,IAAInB,kBACJ,EAAA,EAAA,IAAI/B,iBACJ,EAAA,EAAA,IAAI,CAAC2C,OAAO,EACZ,MAAA,CAAA;AAEF,QAAA,IAAI,CAACyF,YAAY,GAAG,IAAIhD,cACtB,IAAIR,eAAAA,CACF,IAAI,CAACjC,OAAO,EACZ,IAAIhE,mBAAoB,CAAA,cAAA,EAAgB,IAAIxB,eAAmB,EAAA,EAAA;AAC7D,YAAA,oBAAA;AACA,YAAA,oBAAA;AACA,YAAA;SACD,CAEH,CAAA,EAAA,IAAI,CAACwF,OAAO,EACZ,UAAA,CAAA;AAEF,QAAA,IAAI,CAACtF,MAAM,GAAG,IAAIsB,mBAAAA,CAAoB,WAAW,IAAIxB,eAAAA,EAAAA,CAAAA;AACvD;AAqKF;;;;;;;;;;;;;;;;;;"}
@@ -35,5 +35,5 @@ export declare class ZLinterEs implements IZLinter {
35
35
  * fully successful, and false if the lint
36
36
  * has errors.
37
37
  */
38
- lint(src: string[], config: string): Promise<boolean>;
38
+ lint(src: string[], config?: string): Promise<boolean>;
39
39
  }
@@ -1,6 +1,6 @@
1
1
  import { IZConfigReader } from '../config/config-reader.mjs';
2
- import { IZLinter } from './linter.mjs';
3
2
  import { IZContentLinter } from '../content/content-linter.mjs';
3
+ import { IZLinter } from './linter.mjs';
4
4
  /**
5
5
  * Represents an object that can lint files one at a time.
6
6
  */
@@ -24,5 +24,5 @@ export declare class ZLinterStyle implements IZLinter {
24
24
  * if there are no lint errors, or
25
25
  * false if errors are present.
26
26
  */
27
- lint(content: string[], config: string): Promise<boolean>;
27
+ lint(content: string[], config?: string): Promise<boolean>;
28
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/janitor-lint",
3
- "version": "19.0.0",
3
+ "version": "19.1.0",
4
4
  "description": "Style checks with tools for web projects using common rules.",
5
5
  "keywords": [
6
6
  "linters"
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "author": "Anthony Bonta",
35
35
  "dependencies": {
36
- "@zthun/janitor-options": "^19.0.0",
36
+ "@zthun/janitor-options": "^19.1.0",
37
37
  "chalk": "^5.4.1",
38
38
  "cosmiconfig": "^9.0.0",
39
39
  "cspell": "^9.0.2",
40
40
  "eslint": "^9.28.0",
41
41
  "glob": "^11.0.2",
42
- "htmlhint": "^1.3.0",
42
+ "htmlhint": "^1.5.1",
43
43
  "js-yaml": "^4.1.0",
44
44
  "lodash-es": "^4.17.21",
45
45
  "markdownlint": "~0.38.0",
@@ -51,11 +51,11 @@
51
51
  "dist"
52
52
  ],
53
53
  "devDependencies": {
54
- "@zthun/janitor-build-config": "^19.0.0",
54
+ "@zthun/janitor-build-config": "^19.1.0",
55
55
  "typescript": "~5.8.3",
56
56
  "vite": "^6.3.5",
57
- "vitest": "^3.1.4",
57
+ "vitest": "^3.2.2",
58
58
  "vitest-mock-extended": "^3.1.0"
59
59
  },
60
- "gitHead": "8277288093dff6023427448ccf903d83912865b5"
60
+ "gitHead": "bffd8ac7224b5b19ac3e60a0f6a339a1d4e3a0e1"
61
61
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"janitor-lint-CA0qEXKV.cjs","sources":["../src/config/config-resolve.mts","../src/config/config-extender.mts","../src/config/config-reader-cosmic.mts","../src/config/config-reader-null.mts","../src/config/config-reader-prettier.mts","../src/content/content-linter-html.mts","../src/content/content-linter-json.mts","../src/content/content-linter-pretty.mts","../src/content/content-linter-yaml.mts","../src/linter/linter-es.mts","../src/linter/linter-file.mts","../src/linter/linter-markdown.mts","../src/linter/linter-report.mts","../src/linter/linter-spelling.mts","../src/linter/linter-style.mts","../src/app/janitor-lint.mts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nexport function $require(id: string) {\n const require = createRequire(import.meta.url);\n return require(id);\n}\n\nexport function $resolve(id: string, options?: { paths?: string[] }) {\n const require = createRequire(import.meta.url);\n return require.resolve(id, options);\n}\n","import { $require } from \"./config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to build configs using an extends pattern.\n */\nexport interface IZConfigExtender {\n /**\n * Expands a configuration object.\n *\n * @param config -\n * The current configuration object.\n */\n extend(config: any): Promise<string>;\n}\n\n/**\n * Represents the standard extender.\n *\n * This extender works the same as how eslint extends their\n * configuration. You can pass a key that acts as the extends key which holds paths\n * to the extendable files/modules. Note that this class, unlike eslint, does not assume any naming\n * conventions and ONLY shared configurations are supported. You must pass the full path of the\n * configs when extending, and plugin based syntax is not recognized.\n *\n * It is always better to just use the extension methods of the actual\n * applications if those are available, but this can be used as a fallback or an\n * extension of behavior for child linters that do not support extendable configs.\n */\nexport class ZConfigExtender implements IZConfigExtender {\n /**\n * Initializes a new instance of this object.\n *\n * @param key\n * - The key to extend.\n */\n public constructor(public key = \"extends\") {}\n\n /**\n * Extends the configuration value.\n *\n * This is similar to how eslint works. This will do an\n * asynchronous require on each configuration under the key in the\n * config. If the key in the config is falsy, then the config is returned.\n *\n * The actual key in the config is deleted.\n *\n * @param config\n * - The config to extend.\n *\n * @returns\n * A promise that resolves the extended configuration.\n */\n public async extend(config: any): Promise<any> {\n if (!Object.hasOwnProperty.call(config, this.key)) {\n return config;\n }\n\n const extensions = config[this.key];\n const modules = Array.isArray(extensions) ? extensions : [extensions];\n const resolved = await Promise.all(modules.map((m) => this._read(m)));\n let updated = resolved.reduce(\n (last, current) => Object.assign({}, last, current),\n {},\n );\n updated = Object.assign({}, updated, config);\n delete updated[this.key];\n return updated;\n }\n\n /**\n * Reads a module recursively.\n *\n * @param module\n * - The module to read.\n *\n * @returns\n * A promise that resolves the extended inner module.\n */\n private async _read(module: string) {\n const data = $require(module);\n return await this.extend(data);\n }\n}\n","import { cosmiconfig } from \"cosmiconfig\";\n\nimport { resolve } from \"path\";\nimport { IZConfigDiscovery } from \"./config-discovery.mjs\";\nimport { IZConfigExtender } from \"./config-extender.mjs\";\nimport { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a reader that uses the cosmiconfig standard for files.\n */\nexport class ZConfigReaderCosmic implements IZConfigReader, IZConfigDiscovery {\n /**\n * Initializes a new instance of this object.\n *\n * @param name -\n * The name of the application to load.\n * @param extender -\n * The extender to expand upon the read configuration.\n * @param paths -\n * The additional paths to read if cosmic config does not find a valid config. Remember that these\n * are paths, not modules in this case, so you can't load things from the node modules directory\n * using these values. These only affect the search for the config file, not the actual\n * read of the config.\n */\n public constructor(\n public name: string,\n public extender: IZConfigExtender,\n public paths: string[] = [],\n ) {}\n\n /**\n * Runs a search for the appropriate configuration file.\n *\n * The extension keyword is deleted from the config.\n *\n * @returns\n * A promise that resolves with the expanded configuration.\n */\n public async search() {\n const explorer = cosmiconfig(this.name, { searchStrategy: \"project\" });\n\n // The first step is the standard cosmiconfig\n // search to see if any of these paths exists.\n // These are highest priority.\n const searched = await explorer.search();\n\n if (searched) {\n return searched.filepath;\n }\n\n // Try our additional paths, if any.\n for (const path of this.paths) {\n const full = resolve(path);\n const result = await explorer.load(full).catch(() => null);\n\n if (result) {\n return result.filepath;\n }\n }\n\n return null;\n }\n\n /**\n * Reads the config file.\n *\n * @param config -\n * The optional configuration file. If this is null then the cosmiconfig path is searched on the name.\n *\n * @returns\n * A promise that resolves the json object that represents the config.\n */\n public async read(config: string): Promise<any> {\n const configLoad = config ? Promise.resolve(config) : this.search();\n const configFile = await configLoad;\n\n if (!configFile) {\n return {};\n }\n\n const path = $resolve(configFile, { paths: [process.cwd()] });\n const buffer = await cosmiconfig(this.name).load(path);\n return await this.extender.extend(buffer.config);\n }\n}\n","import { IZConfigReader } from \"./config-reader.mjs\";\n\n/**\n * Represents a config reader that returns the empty options.\n */\nexport class ZConfigReaderNull implements IZConfigReader {\n /**\n * Returns a null resolved promise.\n *\n * @returns\n * A promise that resolves to null.\n */\n public async read(): Promise<any> {\n return null;\n }\n}\n","import { Options, resolveConfig, ResolveConfigOptions } from \"prettier\";\nimport { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\nimport { resolve } from \"path\";\n\n/**\n * Represents a configuration reader for prettier.\n */\nexport class ZConfigReaderPrettier implements IZConfigReader {\n /**\n * Reads the configuration file.\n *\n * @param config -\n * The config module to load. If this value is falsy,\n * then prettier will be used to retrieve the configuration.\n *\n * @returns\n * The options for the config file.\n */\n public async read(config: string): Promise<Options> {\n const cwd = process.cwd();\n const configFile = config ? $resolve(config, { paths: [cwd] }) : null;\n const ops: ResolveConfigOptions = { config: configFile };\n // This function seems to have a slight issue in that it needs one directory deeper than\n // the directory you want to start the search in. The documentation on this isn't exactly correct,\n // and it was this change, https://github.com/prettier/prettier/pull/15363/files#diff-6569a6bfe16237da3c47f035a6f3325a79e958507cf866a1bd703ae9210129b3,\n // that broke it.\n const options = await resolveConfig(\n resolve(process.cwd(), \"some-prettier-config\"),\n ops,\n );\n\n return options || {};\n }\n}\n","import { HTMLHint, FormatOptions } from \"htmlhint\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to hint html files.\n */\nexport class ZContentLinterHtml implements IZContentLinter {\n private readonly _formatOptions: FormatOptions = { colors: true };\n\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public lint(\n content: string,\n contentPath: string,\n options?: any,\n ): Promise<any> {\n const messages = HTMLHint.verify(content, options);\n\n if (messages.length > 0) {\n const logs = HTMLHint.format(messages, this._formatOptions);\n return Promise.reject(logs);\n }\n\n return Promise.resolve(`${contentPath} is lint free.`);\n }\n}\n","import { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents the linter for json files.\n */\nexport class ZContentLinterJson implements IZContentLinter {\n /**\n * Lints the collection of json files.\n *\n * @param contents -\n * The json file contents.\n */\n public async lint(contents: string): Promise<any> {\n return JSON.parse(contents);\n }\n}\n","import { check, getFileInfo, Options } from \"prettier\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to perform prettier checks on files.\n */\nexport class ZContentLinterPretty implements IZContentLinter {\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public async lint(\n content: string,\n contentPath: string,\n options?: Options,\n ): Promise<any> {\n const file = await getFileInfo(contentPath);\n const finalOptions = Object.assign(\n {},\n { parser: file.inferredParser },\n options,\n );\n const formatted = await check(content, finalOptions);\n\n if (!formatted) {\n return Promise.reject(`${contentPath} is not formatted.`);\n }\n\n return Promise.resolve(`${contentPath} is properly formatted.`);\n }\n}\n","import { load } from \"js-yaml\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents a linter for yml files.\n */\nexport class ZContentLinterYaml implements IZContentLinter {\n /**\n * Lints yml files.\n *\n * @param contents -\n * Yaml formatted string.\n *\n * @returns\n * A promise that resolves if successful, or rejects if failed.\n */\n public async lint(contents: string): Promise<any> {\n return load(contents);\n }\n}\n","import { ESLint } from \"eslint\";\nimport { every } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform eslint on javascript files.\n */\nexport class ZLinterEs implements IZLinter {\n /**\n * The factory that constructs a CLIEngine object.\n *\n * @param options -\n * The engine options.\n *\n * @returns\n * The engine that can be used to perform eslint.\n */\n public engineFactory: (options: ESLint.Options) => ESLint = (options) =>\n new ESLint(options);\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n *\n * @returns\n * A promise that resolves to true if the lint is\n * fully successful, and false if the lint\n * has errors.\n */\n public async lint(src: string[], config: string): Promise<boolean> {\n const esOptions: ESLint.Options = {};\n\n if (config) {\n esOptions.overrideConfigFile = $resolve(config, {\n paths: [process.cwd()],\n });\n }\n\n try {\n const engine = this.engineFactory(esOptions);\n const formatter = await engine.loadFormatter();\n const report = await engine.lintFiles(src);\n const output = formatter.format(report);\n this._logger.log(output);\n return every(report, (r) => r.errorCount === 0);\n } catch (err) {\n this._logger.log(err);\n return false;\n }\n }\n}\n","import chalk from \"chalk\";\nimport { readFile } from \"fs\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { resolve } from \"path\";\nimport { promisify } from \"util\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { IZContentLinter } from \"../content/content-linter.mjs\";\n\n/**\n * Represents an object that can lint files one at a time.\n */\nexport class ZLinterFile implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _contentLint -\n * The linter for an individual file.\n * @param _configReader -\n * The config reader.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _contentLint: IZContentLinter,\n private readonly _configReader: IZConfigReader,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const readFileAsync = promisify(readFile);\n let options = {};\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n try {\n options = await this._configReader.read(config);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n this._logger.log();\n\n let result = true;\n\n for (const file of files) {\n const fullFilePath = resolve(file);\n try {\n const content = await readFileAsync(fullFilePath, \"utf-8\");\n await this._contentLint.lint(content, fullFilePath, options, config);\n } catch (err) {\n result = false;\n this._format(fullFilePath, err);\n }\n }\n\n return result;\n }\n\n /**\n * Formats a file error to the logger.\n *\n * @param file -\n * The file that failed to parse.\n * @param err -\n * The error that occurred.Ø\n */\n private _format(file: string, err: any) {\n const fileFormat = `Errors in ${file}`;\n this._logger.error(chalk.green.underline(fileFormat));\n\n if (Array.isArray(err)) {\n err.forEach((log) => this._logger.error(chalk.red(log)));\n } else {\n this._logger.error(chalk.red(err));\n }\n }\n}\n","import chalk from \"chalk\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { some, values } from \"lodash-es\";\nimport { Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter object that checks markdown.\n */\nexport class ZLinterMarkdown implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to write messages to.\n * @param _reader -\n * The configuration reader.\n */\n public constructor(\n private readonly _logger: Console,\n private readonly _reader: IZConfigReader,\n ) {}\n\n /**\n * Lints all files matched by the specified glob pattern.\n *\n * @param src -\n * The glob patterns to match and lint.\n * @param cfg -\n * The optional config for the linter.\n * @param exclude -\n * The glob patterns to exclude.\n *\n * @returns A promise that resolves to true if the linting is ok, and false if the linting fails.\n */\n public async lint(\n src: string[],\n cfg: string,\n exclude: string[] = [],\n ): Promise<boolean> {\n let config: any;\n\n try {\n config = await this._reader.read(cfg);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n const options: Options = { files, config };\n const result = await lint(options);\n this._logger.log(`${result.toString().trim()}`);\n return !some(values(result), (val) => val.length > 0);\n }\n}\n","import chalk from \"chalk\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { uniq } from \"lodash-es\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that will report on file globs, but will\n * pass the actual linting job to another linter.\n */\nexport class ZLinterReport implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _child -\n * The child linter to pass the operation off to.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _child: IZLinter,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n files = uniq(files);\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n return this._child.lint(src, config, exclude);\n }\n}\n","import chalk from \"chalk\";\nimport { CSpellApplicationOptions, CSpellReporter, Issue, lint } from \"cspell\";\nimport { noop } from \"lodash-es\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to perform cspell on files.\n */\nexport class ZLinterSpelling implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n * @param exclude -\n * The list of file globs to exclude.\n *\n * @returns\n * A promise that resolves to true if the\n * lint is fully successful, and false if the lint\n * has errors.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: CSpellApplicationOptions = { exclude };\n\n if (config) {\n options.config = $resolve(config, { paths: [process.cwd()] });\n }\n\n const info = noop;\n const debug = noop;\n const error = noop;\n const progress = noop;\n const result = noop;\n\n const issue = (issue: Issue) => {\n const position = `${issue.row}:${issue.col}`;\n this._logger.log(\n `${chalk.green(issue.uri)}:${chalk.yellow(position)} - Unknown word (${chalk.red(issue.text)})`,\n );\n };\n\n const emitters: CSpellReporter = {\n info,\n debug,\n error,\n progress,\n issue,\n result,\n };\n const runResult = await lint(src, options, emitters);\n\n if (runResult.errors > 0 || runResult.issues > 0) {\n return false;\n }\n\n this._logger.log();\n return true;\n }\n}\n","import stylelint from \"stylelint\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\n\n/**\n * Represents a linter for stylelint.\n */\nexport class ZLinterStyle implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to log the output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the file globs through the stylelint application.\n *\n * @param content -\n * The list of globs to lint.\n * @param config -\n * The linter config file.\n *\n * @returns\n * A promise that, when resolved, returns true\n * if there are no lint errors, or\n * false if errors are present.\n */\n public async lint(content: string[], config: string): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n };\n\n if (config) {\n options.configFile = $resolve(config, { paths: [process.cwd()] });\n }\n\n const result = await stylelint.lint(options);\n const verbose = await stylelint.formatters.verbose;\n\n if (result.errored) {\n const output = verbose(result.results, result);\n this._logger.log(output);\n return false;\n }\n\n this._logger.log(\"\");\n return true;\n }\n}\n","import { IZJanitorOptions } from \"@zthun/janitor-options\";\nimport chalk from \"chalk\";\nimport { ZConfigExtender } from \"../config/config-extender.mjs\";\nimport { ZConfigReaderCosmic } from \"../config/config-reader-cosmic.mjs\";\nimport { ZConfigReaderNull } from \"../config/config-reader-null.mjs\";\nimport { ZConfigReaderPrettier } from \"../config/config-reader-prettier.mjs\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { ZContentLinterHtml } from \"../content/content-linter-html.mjs\";\nimport { ZContentLinterJson } from \"../content/content-linter-json.mjs\";\nimport { ZContentLinterPretty } from \"../content/content-linter-pretty.mjs\";\nimport { ZContentLinterYaml } from \"../content/content-linter-yaml.mjs\";\nimport { ZLinterEs } from \"../linter/linter-es.mjs\";\nimport { ZLinterFile } from \"../linter/linter-file.mjs\";\nimport { ZLinterMarkdown } from \"../linter/linter-markdown.mjs\";\nimport { ZLinterReport } from \"../linter/linter-report.mjs\";\nimport { ZLinterSpelling } from \"../linter/linter-spelling.mjs\";\nimport { ZLinterStyle } from \"../linter/linter-style.mjs\";\nimport { IZLinter } from \"../linter/linter.mjs\";\nimport { IZJanitorLintArgs } from \"./janitor-lint-args.mjs\";\n\n/**\n * Represents the main entry point object for the application.\n */\nexport class ZJanitorLint {\n /**\n * The linter for js files.\n */\n public esLint: IZLinter;\n\n /**\n * The linter for cspell. Useful for multiple file types.\n */\n public spellLint: IZLinter;\n\n /**\n * The linter for prettier formatting checks.\n */\n public prettyLint: IZLinter;\n\n /**\n * The linter for style files.\n */\n public styleLint: IZLinter;\n\n /**\n * The linter for html files.\n *\n * Currently, htmlhint has no support for cosmiconfig based paths, so we're going to\n * add them here.\n */\n public htmlHint: IZLinter;\n\n /**\n * The linter for json files.\n */\n public jsonLint: IZLinter;\n\n /**\n * The linter for yaml files.\n */\n public yamlLint: IZLinter;\n\n /**\n * The linter for markdown files.\n *\n * Markdownlint is a bit annoying with this. They\n * don't really fully support the cosmiconfig standard,\n * and they only support the config files that are named\n * .markdownlint.yaml, .markdownlint.json, and .markdownlint.cjs\n */\n public markdownLint: IZLinter;\n\n /**\n * The configuration reader.\n */\n public config: IZConfigReader;\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to use when formatting output.\n */\n public constructor(private readonly _logger: Console) {\n this.esLint = new ZLinterReport(\n new ZLinterEs(this._logger),\n this._logger,\n \"es\",\n );\n this.spellLint = new ZLinterReport(\n new ZLinterSpelling(this._logger),\n this._logger,\n \"various\",\n );\n this.prettyLint = new ZLinterFile(\n new ZContentLinterPretty(),\n new ZConfigReaderPrettier(),\n this._logger,\n \"pretty\",\n );\n this.styleLint = new ZLinterReport(\n new ZLinterStyle(this._logger),\n this._logger,\n \"style\",\n );\n this.htmlHint = new ZLinterFile(\n new ZContentLinterHtml(),\n new ZConfigReaderCosmic(\"htmlhint\", new ZConfigExtender()),\n this._logger,\n \"html\",\n );\n this.jsonLint = new ZLinterFile(\n new ZContentLinterJson(),\n new ZConfigReaderNull(),\n this._logger,\n \"json\",\n );\n this.yamlLint = new ZLinterFile(\n new ZContentLinterYaml(),\n new ZConfigReaderNull(),\n this._logger,\n \"yaml\",\n );\n this.markdownLint = new ZLinterReport(\n new ZLinterMarkdown(\n this._logger,\n new ZConfigReaderCosmic(\"markdownlint\", new ZConfigExtender(), [\n \".markdownlint.json\",\n \".markdownlint.yaml\",\n \".markdownlint.cjs\",\n ]),\n ),\n this._logger,\n \"markdown\",\n );\n this.config = new ZConfigReaderCosmic(\"janitor\", new ZConfigExtender());\n }\n\n /**\n * Runs the lint given the required options.\n *\n * @param options -\n * The lint options.\n *\n * @returns\n * A promise that returns 0 if all linting was successful,\n * and 1 if any of the linting failed.\n */\n public async lint(options: IZJanitorOptions): Promise<number> {\n let current = true;\n let result = true;\n const { lint = {} } = options;\n const {\n jsonFiles,\n jsonFilesExclude,\n yamlFiles,\n yamlFilesExclude,\n markdownConfig,\n markdownFiles,\n markdownFilesExclude,\n esConfig,\n esFiles,\n styleConfig,\n styleFiles,\n htmlConfig,\n htmlFiles,\n htmlFilesExclude,\n spellingConfig,\n spellingFiles,\n spellingFilesExclude,\n prettyConfig,\n prettyFiles,\n prettyFilesExclude,\n } = lint;\n\n if (jsonFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting json files from ${jsonFiles.length} globs.`,\n ),\n );\n current = await this.jsonLint.lint(jsonFiles, null, jsonFilesExclude);\n result = result && current;\n }\n\n if (yamlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting yaml files from ${yamlFiles.length} globs.`,\n ),\n );\n current = await this.yamlLint.lint(yamlFiles, null, yamlFilesExclude);\n result = result && current;\n }\n\n if (markdownFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting markdown files from ${markdownFiles.length} globs.`,\n ),\n );\n current = await this.markdownLint.lint(\n markdownFiles,\n markdownConfig,\n markdownFilesExclude,\n );\n result = result && current;\n }\n\n if (esFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting ecmaScript files from ${esFiles.length} globs.`,\n ),\n );\n current = await this.esLint.lint(esFiles, esConfig, null);\n result = result && current;\n }\n\n if (styleFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting style files from ${styleFiles.length} globs.`,\n ),\n );\n current = await this.styleLint.lint(styleFiles, styleConfig, null);\n result = result && current;\n }\n\n if (htmlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting html files from ${htmlFiles.length} globs.`,\n ),\n );\n current = await this.htmlHint.lint(\n htmlFiles,\n htmlConfig,\n htmlFilesExclude,\n );\n result = result && current;\n }\n\n if (spellingFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking spelling for ${spellingFiles.length} globs.`,\n ),\n );\n current = await this.spellLint.lint(\n spellingFiles,\n spellingConfig,\n spellingFilesExclude,\n );\n result = result && current;\n }\n\n if (prettyFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking formatting for ${prettyFiles.length} globs.`,\n ),\n );\n current = await this.prettyLint.lint(\n prettyFiles,\n prettyConfig,\n prettyFilesExclude,\n );\n result = result && current;\n }\n\n return result ? 0 : 1;\n }\n\n /**\n * Runs the application.\n *\n * @param args -\n * The command line arguments.\n *\n * @returns\n * A promise that returns 0 if all linting was\n * successful, and 1 if any of the linting failed.\n */\n public async run(args: IZJanitorLintArgs): Promise<number> {\n try {\n const options = await this.config.read(args.config);\n return this.lint(options);\n } catch (err) {\n this._logger.error(err);\n return 1;\n }\n }\n}\n"],"names":["$require","id","require","createRequire","$resolve","options","resolve","ZConfigExtender","extend","config","Object","hasOwnProperty","call","key","extensions","modules","Array","isArray","resolved","Promise","all","map","m","_read","updated","reduce","last","current","assign","module","data","ZConfigReaderCosmic","search","explorer","cosmiconfig","name","searchStrategy","searched","filepath","path","paths","full","result","load","catch","read","configLoad","configFile","process","cwd","buffer","extender","ZConfigReaderNull","ZConfigReaderPrettier","ops","resolveConfig","ZContentLinterHtml","content","contentPath","messages","HTMLHint","verify","length","logs","format","_formatOptions","reject","_define_property","colors","ZContentLinterJson","lint","contents","JSON","parse","ZContentLinterPretty","file","getFileInfo","finalOptions","parser","inferredParser","formatted","check","ZContentLinterYaml","ZLinterEs","src","esOptions","overrideConfigFile","engine","engineFactory","formatter","loadFormatter","report","lintFiles","output","_logger","log","every","r","errorCount","err","ESLint","ZLinterFile","exclude","readFileAsync","promisify","readFile","globOptions","dot","ignore","files","forEach","pattern","concat","sync","chalk","yellow","italic","_configReader","error","red","green","_type","fullFilePath","_contentLint","_format","fileFormat","underline","ZLinterMarkdown","cfg","_reader","toString","trim","some","values","val","ZLinterReport","uniq","_child","ZLinterSpelling","info","noop","debug","progress","issue","position","row","col","uri","text","emitters","runResult","errors","issues","ZLinterStyle","stylelint","verbose","formatters","errored","results","ZJanitorLint","jsonFiles","jsonFilesExclude","yamlFiles","yamlFilesExclude","markdownConfig","markdownFiles","markdownFilesExclude","esConfig","esFiles","styleConfig","styleFiles","htmlConfig","htmlFiles","htmlFilesExclude","spellingConfig","spellingFiles","spellingFilesExclude","prettyConfig","prettyFiles","prettyFilesExclude","magenta","jsonLint","yamlLint","markdownLint","esLint","styleLint","htmlHint","spellLint","prettyLint","run","args"],"mappings":";;;;;;;;;;;;;;;;;;;AAEO,SAASA,SAASC,EAAU,EAAA;IACjC,MAAMC,SAAAA,GAAUC,yBAAc,CAAA,2QAAe,CAAA;AAC7C,IAAA,OAAOD,SAAQD,CAAAA,EAAAA,CAAAA;AACjB;AAEO,SAASG,QAAAA,CAASH,EAAU,EAAEI,OAA8B,EAAA;IACjE,MAAMH,SAAAA,GAAUC,yBAAc,CAAA,2QAAe,CAAA;IAC7C,OAAOD,SAAAA,CAAQI,OAAO,CAACL,EAAII,EAAAA,OAAAA,CAAAA;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;AAYC,IACM,MAAME,eAAAA,CAAAA;AASX;;;;;;;;;;;;;;MAeaC,OAAOC,MAAW,EAAA;;YAC7B,IAAI,CAACC,MAAOC,CAAAA,cAAc,CAACC,IAAI,CAACH,MAAQ,EAAA,IAAI,CAACI,GAAG,CAAG,EAAA;gBACjD,OAAOJ,MAAAA;AACT;AAEA,YAAA,MAAMK,aAAaL,MAAM,CAAC,IAAI,CAACI,GAAG,CAAC;AACnC,YAAA,MAAME,OAAUC,GAAAA,KAAAA,CAAMC,OAAO,CAACH,cAAcA,UAAa,GAAA;AAACA,gBAAAA;AAAW,aAAA;AACrE,YAAA,MAAMI,QAAW,GAAA,MAAMC,OAAQC,CAAAA,GAAG,CAACL,OAAAA,CAAQM,GAAG,CAAC,CAACC,CAAAA,GAAM,IAAI,CAACC,KAAK,CAACD,CAAAA,CAAAA,CAAAA,CAAAA;AACjE,YAAA,IAAIE,OAAUN,GAAAA,QAAAA,CAASO,MAAM,CAC3B,CAACC,IAAMC,EAAAA,OAAAA,GAAYjB,MAAOkB,C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,IAAIxB,eAAAA,EAAAA,CAAAA;AACvD;AA6JF;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"janitor-lint-QMZ00oXe.js","sources":["../src/config/config-resolve.mts","../src/config/config-extender.mts","../src/config/config-reader-cosmic.mts","../src/config/config-reader-null.mts","../src/config/config-reader-prettier.mts","../src/content/content-linter-html.mts","../src/content/content-linter-json.mts","../src/content/content-linter-pretty.mts","../src/content/content-linter-yaml.mts","../src/linter/linter-es.mts","../src/linter/linter-file.mts","../src/linter/linter-markdown.mts","../src/linter/linter-report.mts","../src/linter/linter-spelling.mts","../src/linter/linter-style.mts","../src/app/janitor-lint.mts"],"sourcesContent":["import { createRequire } from \"node:module\";\n\nexport function $require(id: string) {\n const require = createRequire(import.meta.url);\n return require(id);\n}\n\nexport function $resolve(id: string, options?: { paths?: string[] }) {\n const require = createRequire(import.meta.url);\n return require.resolve(id, options);\n}\n","import { $require } from \"./config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to build configs using an extends pattern.\n */\nexport interface IZConfigExtender {\n /**\n * Expands a configuration object.\n *\n * @param config -\n * The current configuration object.\n */\n extend(config: any): Promise<string>;\n}\n\n/**\n * Represents the standard extender.\n *\n * This extender works the same as how eslint extends their\n * configuration. You can pass a key that acts as the extends key which holds paths\n * to the extendable files/modules. Note that this class, unlike eslint, does not assume any naming\n * conventions and ONLY shared configurations are supported. You must pass the full path of the\n * configs when extending, and plugin based syntax is not recognized.\n *\n * It is always better to just use the extension methods of the actual\n * applications if those are available, but this can be used as a fallback or an\n * extension of behavior for child linters that do not support extendable configs.\n */\nexport class ZConfigExtender implements IZConfigExtender {\n /**\n * Initializes a new instance of this object.\n *\n * @param key\n * - The key to extend.\n */\n public constructor(public key = \"extends\") {}\n\n /**\n * Extends the configuration value.\n *\n * This is similar to how eslint works. This will do an\n * asynchronous require on each configuration under the key in the\n * config. If the key in the config is falsy, then the config is returned.\n *\n * The actual key in the config is deleted.\n *\n * @param config\n * - The config to extend.\n *\n * @returns\n * A promise that resolves the extended configuration.\n */\n public async extend(config: any): Promise<any> {\n if (!Object.hasOwnProperty.call(config, this.key)) {\n return config;\n }\n\n const extensions = config[this.key];\n const modules = Array.isArray(extensions) ? extensions : [extensions];\n const resolved = await Promise.all(modules.map((m) => this._read(m)));\n let updated = resolved.reduce(\n (last, current) => Object.assign({}, last, current),\n {},\n );\n updated = Object.assign({}, updated, config);\n delete updated[this.key];\n return updated;\n }\n\n /**\n * Reads a module recursively.\n *\n * @param module\n * - The module to read.\n *\n * @returns\n * A promise that resolves the extended inner module.\n */\n private async _read(module: string) {\n const data = $require(module);\n return await this.extend(data);\n }\n}\n","import { cosmiconfig } from \"cosmiconfig\";\n\nimport { resolve } from \"path\";\nimport { IZConfigDiscovery } from \"./config-discovery.mjs\";\nimport { IZConfigExtender } from \"./config-extender.mjs\";\nimport { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\n\n/**\n * Represents a reader that uses the cosmiconfig standard for files.\n */\nexport class ZConfigReaderCosmic implements IZConfigReader, IZConfigDiscovery {\n /**\n * Initializes a new instance of this object.\n *\n * @param name -\n * The name of the application to load.\n * @param extender -\n * The extender to expand upon the read configuration.\n * @param paths -\n * The additional paths to read if cosmic config does not find a valid config. Remember that these\n * are paths, not modules in this case, so you can't load things from the node modules directory\n * using these values. These only affect the search for the config file, not the actual\n * read of the config.\n */\n public constructor(\n public name: string,\n public extender: IZConfigExtender,\n public paths: string[] = [],\n ) {}\n\n /**\n * Runs a search for the appropriate configuration file.\n *\n * The extension keyword is deleted from the config.\n *\n * @returns\n * A promise that resolves with the expanded configuration.\n */\n public async search() {\n const explorer = cosmiconfig(this.name, { searchStrategy: \"project\" });\n\n // The first step is the standard cosmiconfig\n // search to see if any of these paths exists.\n // These are highest priority.\n const searched = await explorer.search();\n\n if (searched) {\n return searched.filepath;\n }\n\n // Try our additional paths, if any.\n for (const path of this.paths) {\n const full = resolve(path);\n const result = await explorer.load(full).catch(() => null);\n\n if (result) {\n return result.filepath;\n }\n }\n\n return null;\n }\n\n /**\n * Reads the config file.\n *\n * @param config -\n * The optional configuration file. If this is null then the cosmiconfig path is searched on the name.\n *\n * @returns\n * A promise that resolves the json object that represents the config.\n */\n public async read(config: string): Promise<any> {\n const configLoad = config ? Promise.resolve(config) : this.search();\n const configFile = await configLoad;\n\n if (!configFile) {\n return {};\n }\n\n const path = $resolve(configFile, { paths: [process.cwd()] });\n const buffer = await cosmiconfig(this.name).load(path);\n return await this.extender.extend(buffer.config);\n }\n}\n","import { IZConfigReader } from \"./config-reader.mjs\";\n\n/**\n * Represents a config reader that returns the empty options.\n */\nexport class ZConfigReaderNull implements IZConfigReader {\n /**\n * Returns a null resolved promise.\n *\n * @returns\n * A promise that resolves to null.\n */\n public async read(): Promise<any> {\n return null;\n }\n}\n","import { Options, resolveConfig, ResolveConfigOptions } from \"prettier\";\nimport { IZConfigReader } from \"./config-reader.mjs\";\nimport { $resolve } from \"./config-resolve.mjs\";\nimport { resolve } from \"path\";\n\n/**\n * Represents a configuration reader for prettier.\n */\nexport class ZConfigReaderPrettier implements IZConfigReader {\n /**\n * Reads the configuration file.\n *\n * @param config -\n * The config module to load. If this value is falsy,\n * then prettier will be used to retrieve the configuration.\n *\n * @returns\n * The options for the config file.\n */\n public async read(config: string): Promise<Options> {\n const cwd = process.cwd();\n const configFile = config ? $resolve(config, { paths: [cwd] }) : null;\n const ops: ResolveConfigOptions = { config: configFile };\n // This function seems to have a slight issue in that it needs one directory deeper than\n // the directory you want to start the search in. The documentation on this isn't exactly correct,\n // and it was this change, https://github.com/prettier/prettier/pull/15363/files#diff-6569a6bfe16237da3c47f035a6f3325a79e958507cf866a1bd703ae9210129b3,\n // that broke it.\n const options = await resolveConfig(\n resolve(process.cwd(), \"some-prettier-config\"),\n ops,\n );\n\n return options || {};\n }\n}\n","import { HTMLHint, FormatOptions } from \"htmlhint\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to hint html files.\n */\nexport class ZContentLinterHtml implements IZContentLinter {\n private readonly _formatOptions: FormatOptions = { colors: true };\n\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public lint(\n content: string,\n contentPath: string,\n options?: any,\n ): Promise<any> {\n const messages = HTMLHint.verify(content, options);\n\n if (messages.length > 0) {\n const logs = HTMLHint.format(messages, this._formatOptions);\n return Promise.reject(logs);\n }\n\n return Promise.resolve(`${contentPath} is lint free.`);\n }\n}\n","import { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents the linter for json files.\n */\nexport class ZContentLinterJson implements IZContentLinter {\n /**\n * Lints the collection of json files.\n *\n * @param contents -\n * The json file contents.\n */\n public async lint(contents: string): Promise<any> {\n return JSON.parse(contents);\n }\n}\n","import { check, getFileInfo, Options } from \"prettier\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents an object that can be used to perform prettier checks on files.\n */\nexport class ZContentLinterPretty implements IZContentLinter {\n /**\n * Lints the content.\n *\n * @param content -\n * The content to check.\n * @param contentPath -\n * The path of the content data.\n * @param options -\n * The htmlhint options.\n *\n * @returns\n * A promise that resolves if the content is lint free, and rejects if it has lint errors.\n */\n public async lint(\n content: string,\n contentPath: string,\n options?: Options,\n ): Promise<any> {\n const file = await getFileInfo(contentPath);\n const finalOptions = Object.assign(\n {},\n { parser: file.inferredParser },\n options,\n );\n const formatted = await check(content, finalOptions);\n\n if (!formatted) {\n return Promise.reject(`${contentPath} is not formatted.`);\n }\n\n return Promise.resolve(`${contentPath} is properly formatted.`);\n }\n}\n","import { load } from \"js-yaml\";\nimport { IZContentLinter } from \"./content-linter.mjs\";\n\n/**\n * Represents a linter for yml files.\n */\nexport class ZContentLinterYaml implements IZContentLinter {\n /**\n * Lints yml files.\n *\n * @param contents -\n * Yaml formatted string.\n *\n * @returns\n * A promise that resolves if successful, or rejects if failed.\n */\n public async lint(contents: string): Promise<any> {\n return load(contents);\n }\n}\n","import { ESLint } from \"eslint\";\nimport { every } from \"lodash-es\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that can be used to perform eslint on javascript files.\n */\nexport class ZLinterEs implements IZLinter {\n /**\n * The factory that constructs a CLIEngine object.\n *\n * @param options -\n * The engine options.\n *\n * @returns\n * The engine that can be used to perform eslint.\n */\n public engineFactory: (options: ESLint.Options) => ESLint = (options) =>\n new ESLint(options);\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n *\n * @returns\n * A promise that resolves to true if the lint is\n * fully successful, and false if the lint\n * has errors.\n */\n public async lint(src: string[], config: string): Promise<boolean> {\n const esOptions: ESLint.Options = {};\n\n if (config) {\n esOptions.overrideConfigFile = $resolve(config, {\n paths: [process.cwd()],\n });\n }\n\n try {\n const engine = this.engineFactory(esOptions);\n const formatter = await engine.loadFormatter();\n const report = await engine.lintFiles(src);\n const output = formatter.format(report);\n this._logger.log(output);\n return every(report, (r) => r.errorCount === 0);\n } catch (err) {\n this._logger.log(err);\n return false;\n }\n }\n}\n","import chalk from \"chalk\";\nimport { readFile } from \"fs\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { resolve } from \"path\";\nimport { promisify } from \"util\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { IZContentLinter } from \"../content/content-linter.mjs\";\n\n/**\n * Represents an object that can lint files one at a time.\n */\nexport class ZLinterFile implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _contentLint -\n * The linter for an individual file.\n * @param _configReader -\n * The config reader.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _contentLint: IZContentLinter,\n private readonly _configReader: IZConfigReader,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const readFileAsync = promisify(readFile);\n let options = {};\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n try {\n options = await this._configReader.read(config);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n this._logger.log();\n\n let result = true;\n\n for (const file of files) {\n const fullFilePath = resolve(file);\n try {\n const content = await readFileAsync(fullFilePath, \"utf-8\");\n await this._contentLint.lint(content, fullFilePath, options, config);\n } catch (err) {\n result = false;\n this._format(fullFilePath, err);\n }\n }\n\n return result;\n }\n\n /**\n * Formats a file error to the logger.\n *\n * @param file -\n * The file that failed to parse.\n * @param err -\n * The error that occurred.Ø\n */\n private _format(file: string, err: any) {\n const fileFormat = `Errors in ${file}`;\n this._logger.error(chalk.green.underline(fileFormat));\n\n if (Array.isArray(err)) {\n err.forEach((log) => this._logger.error(chalk.red(log)));\n } else {\n this._logger.error(chalk.red(err));\n }\n }\n}\n","import chalk from \"chalk\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { some, values } from \"lodash-es\";\nimport { Options } from \"markdownlint\";\nimport { lint } from \"markdownlint/promise\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a linter object that checks markdown.\n */\nexport class ZLinterMarkdown implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to write messages to.\n * @param _reader -\n * The configuration reader.\n */\n public constructor(\n private readonly _logger: Console,\n private readonly _reader: IZConfigReader,\n ) {}\n\n /**\n * Lints all files matched by the specified glob pattern.\n *\n * @param src -\n * The glob patterns to match and lint.\n * @param cfg -\n * The optional config for the linter.\n * @param exclude -\n * The glob patterns to exclude.\n *\n * @returns A promise that resolves to true if the linting is ok, and false if the linting fails.\n */\n public async lint(\n src: string[],\n cfg: string,\n exclude: string[] = [],\n ): Promise<boolean> {\n let config: any;\n\n try {\n config = await this._reader.read(cfg);\n } catch (err) {\n this._logger.error(chalk.red(err));\n return false;\n }\n\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n\n const options: Options = { files, config };\n const result = await lint(options);\n this._logger.log(`${result.toString().trim()}`);\n return !some(values(result), (val) => val.length > 0);\n }\n}\n","import chalk from \"chalk\";\nimport { GlobOptionsWithFileTypesFalse, sync } from \"glob\";\nimport { uniq } from \"lodash-es\";\nimport { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents an object that will report on file globs, but will\n * pass the actual linting job to another linter.\n */\nexport class ZLinterReport implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _child -\n * The child linter to pass the operation off to.\n * @param _logger -\n * The logger to use.\n * @param _type -\n * The file type.\n */\n public constructor(\n private readonly _child: IZLinter,\n private readonly _logger: Console,\n private readonly _type: string,\n ) {}\n\n /**\n * Lints the collection of json files.\n *\n * @param src -\n * The file list of blobs to lint.\n * @param config -\n * The optional path to the config file.\n * @param exclude -\n * The list of globs to exclude.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const globOptions: GlobOptionsWithFileTypesFalse = {\n dot: true,\n ignore: exclude,\n };\n\n let files: string[] = [];\n src.forEach(\n (pattern) => (files = files.concat(sync(pattern, globOptions))),\n );\n files = uniq(files);\n\n if (files.length === 0) {\n this._logger.log(chalk.yellow.italic(\"No globs matched any files.\"));\n return true;\n }\n\n this._logger.log(\n chalk.green.italic(\n `Checking syntax for ${files.length} ${this._type} files.`,\n ),\n );\n return this._child.lint(src, config, exclude);\n }\n}\n","import chalk from \"chalk\";\nimport { CSpellApplicationOptions, CSpellReporter, Issue, lint } from \"cspell\";\nimport { noop } from \"lodash-es\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\n\n/**\n * Represents an object that can be used to perform cspell on files.\n */\nexport class ZLinterSpelling implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the lint given the specified config and source files.\n *\n * @param src -\n * The list of files globs to lint.\n * @param config -\n * The optional lint config file.\n * @param exclude -\n * The list of file globs to exclude.\n *\n * @returns\n * A promise that resolves to true if the\n * lint is fully successful, and false if the lint\n * has errors.\n */\n public async lint(\n src: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: CSpellApplicationOptions = { exclude };\n\n if (config) {\n options.config = $resolve(config, { paths: [process.cwd()] });\n }\n\n const info = noop;\n const debug = noop;\n const error = noop;\n const progress = noop;\n const result = noop;\n\n const issue = (issue: Issue) => {\n const position = `${issue.row}:${issue.col}`;\n this._logger.log(\n `${chalk.green(issue.uri)}:${chalk.yellow(position)} - Unknown word (${chalk.red(issue.text)})`,\n );\n };\n\n const emitters: CSpellReporter = {\n info,\n debug,\n error,\n progress,\n issue,\n result,\n };\n const runResult = await lint(src, options, emitters);\n\n if (runResult.errors > 0 || runResult.issues > 0) {\n return false;\n }\n\n this._logger.log();\n return true;\n }\n}\n","import stylelint from \"stylelint\";\nimport { IZLinter } from \"./linter.mjs\";\nimport { $resolve } from \"../config/config-resolve.mjs\";\n\n/**\n * Represents a linter for stylelint.\n */\nexport class ZLinterStyle implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to log the output to.\n */\n public constructor(private readonly _logger: Console) {}\n\n /**\n * Runs the file globs through the stylelint application.\n *\n * @param content -\n * The list of globs to lint.\n * @param config -\n * The linter config file.\n *\n * @returns\n * A promise that, when resolved, returns true\n * if there are no lint errors, or\n * false if errors are present.\n */\n public async lint(content: string[], config: string): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n };\n\n if (config) {\n options.configFile = $resolve(config, { paths: [process.cwd()] });\n }\n\n const result = await stylelint.lint(options);\n const verbose = await stylelint.formatters.verbose;\n\n if (result.errored) {\n const output = verbose(result.results, result);\n this._logger.log(output);\n return false;\n }\n\n this._logger.log(\"\");\n return true;\n }\n}\n","import { IZJanitorOptions } from \"@zthun/janitor-options\";\nimport chalk from \"chalk\";\nimport { ZConfigExtender } from \"../config/config-extender.mjs\";\nimport { ZConfigReaderCosmic } from \"../config/config-reader-cosmic.mjs\";\nimport { ZConfigReaderNull } from \"../config/config-reader-null.mjs\";\nimport { ZConfigReaderPrettier } from \"../config/config-reader-prettier.mjs\";\nimport { IZConfigReader } from \"../config/config-reader.mjs\";\nimport { ZContentLinterHtml } from \"../content/content-linter-html.mjs\";\nimport { ZContentLinterJson } from \"../content/content-linter-json.mjs\";\nimport { ZContentLinterPretty } from \"../content/content-linter-pretty.mjs\";\nimport { ZContentLinterYaml } from \"../content/content-linter-yaml.mjs\";\nimport { ZLinterEs } from \"../linter/linter-es.mjs\";\nimport { ZLinterFile } from \"../linter/linter-file.mjs\";\nimport { ZLinterMarkdown } from \"../linter/linter-markdown.mjs\";\nimport { ZLinterReport } from \"../linter/linter-report.mjs\";\nimport { ZLinterSpelling } from \"../linter/linter-spelling.mjs\";\nimport { ZLinterStyle } from \"../linter/linter-style.mjs\";\nimport { IZLinter } from \"../linter/linter.mjs\";\nimport { IZJanitorLintArgs } from \"./janitor-lint-args.mjs\";\n\n/**\n * Represents the main entry point object for the application.\n */\nexport class ZJanitorLint {\n /**\n * The linter for js files.\n */\n public esLint: IZLinter;\n\n /**\n * The linter for cspell. Useful for multiple file types.\n */\n public spellLint: IZLinter;\n\n /**\n * The linter for prettier formatting checks.\n */\n public prettyLint: IZLinter;\n\n /**\n * The linter for style files.\n */\n public styleLint: IZLinter;\n\n /**\n * The linter for html files.\n *\n * Currently, htmlhint has no support for cosmiconfig based paths, so we're going to\n * add them here.\n */\n public htmlHint: IZLinter;\n\n /**\n * The linter for json files.\n */\n public jsonLint: IZLinter;\n\n /**\n * The linter for yaml files.\n */\n public yamlLint: IZLinter;\n\n /**\n * The linter for markdown files.\n *\n * Markdownlint is a bit annoying with this. They\n * don't really fully support the cosmiconfig standard,\n * and they only support the config files that are named\n * .markdownlint.yaml, .markdownlint.json, and .markdownlint.cjs\n */\n public markdownLint: IZLinter;\n\n /**\n * The configuration reader.\n */\n public config: IZConfigReader;\n\n /**\n * Initializes a new instance of this object.\n *\n * @param _logger -\n * The logger to use when formatting output.\n */\n public constructor(private readonly _logger: Console) {\n this.esLint = new ZLinterReport(\n new ZLinterEs(this._logger),\n this._logger,\n \"es\",\n );\n this.spellLint = new ZLinterReport(\n new ZLinterSpelling(this._logger),\n this._logger,\n \"various\",\n );\n this.prettyLint = new ZLinterFile(\n new ZContentLinterPretty(),\n new ZConfigReaderPrettier(),\n this._logger,\n \"pretty\",\n );\n this.styleLint = new ZLinterReport(\n new ZLinterStyle(this._logger),\n this._logger,\n \"style\",\n );\n this.htmlHint = new ZLinterFile(\n new ZContentLinterHtml(),\n new ZConfigReaderCosmic(\"htmlhint\", new ZConfigExtender()),\n this._logger,\n \"html\",\n );\n this.jsonLint = new ZLinterFile(\n new ZContentLinterJson(),\n new ZConfigReaderNull(),\n this._logger,\n \"json\",\n );\n this.yamlLint = new ZLinterFile(\n new ZContentLinterYaml(),\n new ZConfigReaderNull(),\n this._logger,\n \"yaml\",\n );\n this.markdownLint = new ZLinterReport(\n new ZLinterMarkdown(\n this._logger,\n new ZConfigReaderCosmic(\"markdownlint\", new ZConfigExtender(), [\n \".markdownlint.json\",\n \".markdownlint.yaml\",\n \".markdownlint.cjs\",\n ]),\n ),\n this._logger,\n \"markdown\",\n );\n this.config = new ZConfigReaderCosmic(\"janitor\", new ZConfigExtender());\n }\n\n /**\n * Runs the lint given the required options.\n *\n * @param options -\n * The lint options.\n *\n * @returns\n * A promise that returns 0 if all linting was successful,\n * and 1 if any of the linting failed.\n */\n public async lint(options: IZJanitorOptions): Promise<number> {\n let current = true;\n let result = true;\n const { lint = {} } = options;\n const {\n jsonFiles,\n jsonFilesExclude,\n yamlFiles,\n yamlFilesExclude,\n markdownConfig,\n markdownFiles,\n markdownFilesExclude,\n esConfig,\n esFiles,\n styleConfig,\n styleFiles,\n htmlConfig,\n htmlFiles,\n htmlFilesExclude,\n spellingConfig,\n spellingFiles,\n spellingFilesExclude,\n prettyConfig,\n prettyFiles,\n prettyFilesExclude,\n } = lint;\n\n if (jsonFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting json files from ${jsonFiles.length} globs.`,\n ),\n );\n current = await this.jsonLint.lint(jsonFiles, null, jsonFilesExclude);\n result = result && current;\n }\n\n if (yamlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting yaml files from ${yamlFiles.length} globs.`,\n ),\n );\n current = await this.yamlLint.lint(yamlFiles, null, yamlFilesExclude);\n result = result && current;\n }\n\n if (markdownFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting markdown files from ${markdownFiles.length} globs.`,\n ),\n );\n current = await this.markdownLint.lint(\n markdownFiles,\n markdownConfig,\n markdownFilesExclude,\n );\n result = result && current;\n }\n\n if (esFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting ecmaScript files from ${esFiles.length} globs.`,\n ),\n );\n current = await this.esLint.lint(esFiles, esConfig, null);\n result = result && current;\n }\n\n if (styleFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting style files from ${styleFiles.length} globs.`,\n ),\n );\n current = await this.styleLint.lint(styleFiles, styleConfig, null);\n result = result && current;\n }\n\n if (htmlFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Linting html files from ${htmlFiles.length} globs.`,\n ),\n );\n current = await this.htmlHint.lint(\n htmlFiles,\n htmlConfig,\n htmlFilesExclude,\n );\n result = result && current;\n }\n\n if (spellingFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking spelling for ${spellingFiles.length} globs.`,\n ),\n );\n current = await this.spellLint.lint(\n spellingFiles,\n spellingConfig,\n spellingFilesExclude,\n );\n result = result && current;\n }\n\n if (prettyFiles) {\n this._logger.log(\n chalk.magenta.underline(\n `Checking formatting for ${prettyFiles.length} globs.`,\n ),\n );\n current = await this.prettyLint.lint(\n prettyFiles,\n prettyConfig,\n prettyFilesExclude,\n );\n result = result && current;\n }\n\n return result ? 0 : 1;\n }\n\n /**\n * Runs the application.\n *\n * @param args -\n * The command line arguments.\n *\n * @returns\n * A promise that returns 0 if all linting was\n * successful, and 1 if any of the linting failed.\n */\n public async run(args: IZJanitorLintArgs): Promise<number> {\n try {\n const options = await this.config.read(args.config);\n return this.lint(options);\n } catch (err) {\n this._logger.error(err);\n return 1;\n }\n }\n}\n"],"names":["$require","id","require","createRequire","url","$resolve","options","resolve","ZConfigExtender","extend","config","Object","hasOwnProperty","call","key","extensions","modules","Array","isArray","resolved","Promise","all","map","m","_read","updated","reduce","last","current","assign","module","data","ZConfigReaderCosmic","search","explorer","cosmiconfig","name","searchStrategy","searched","filepath","path","paths","full","result","load","catch","read","configLoad","configFile","process","cwd","buffer","extender","ZConfigReaderNull","ZConfigReaderPrettier","ops","resolveConfig","ZContentLinterHtml","content","contentPath","messages","HTMLHint","verify","length","logs","format","_formatOptions","reject","_define_property","colors","ZContentLinterJson","lint","contents","JSON","parse","ZContentLinterPretty","file","getFileInfo","finalOptions","parser","inferredParser","formatted","check","ZContentLinterYaml","ZLinterEs","src","esOptions","overrideConfigFile","engine","engineFactory","formatter","loadFormatter","report","lintFiles","output","_logger","log","every","r","errorCount","err","ESLint","ZLinterFile","exclude","readFileAsync","promisify","readFile","globOptions","dot","ignore","files","forEach","pattern","concat","sync","chalk","yellow","italic","_configReader","error","red","green","_type","fullFilePath","_contentLint","_format","fileFormat","underline","ZLinterMarkdown","cfg","_reader","toString","trim","some","values","val","ZLinterReport","uniq","_child","ZLinterSpelling","info","noop","debug","progress","issue","position","row","col","uri","text","emitters","runResult","errors","issues","ZLinterStyle","stylelint","verbose","formatters","errored","results","ZJanitorLint","jsonFiles","jsonFilesExclude","yamlFiles","yamlFilesExclude","markdownConfig","markdownFiles","markdownFilesExclude","esConfig","esFiles","styleConfig","styleFiles","htmlConfig","htmlFiles","htmlFilesExclude","spellingConfig","spellingFiles","spellingFilesExclude","prettyConfig","prettyFiles","prettyFilesExclude","magenta","jsonLint","yamlLint","markdownLint","esLint","styleLint","htmlHint","spellLint","prettyLint","run","args"],"mappings":";;;;;;;;;;;;;;;;AAEO,SAASA,SAASC,EAAU,EAAA;IACjC,MAAMC,OAAAA,GAAUC,aAAc,CAAA,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAC7C,IAAA,OAAOF,OAAQD,CAAAA,EAAAA,CAAAA;AACjB;AAEO,SAASI,QAAAA,CAASJ,EAAU,EAAEK,OAA8B,EAAA;IACjE,MAAMJ,OAAAA,GAAUC,aAAc,CAAA,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;IAC7C,OAAOF,OAAAA,CAAQK,OAAO,CAACN,EAAIK,EAAAA,OAAAA,CAAAA;AAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACKA;;;;;;;;;;;;AAYC,IACM,MAAME,eAAAA,CAAAA;AASX;;;;;;;;;;;;;;MAeaC,OAAOC,MAAW,EAAA;;YAC7B,IAAI,CAACC,MAAOC,CAAAA,cAAc,CAACC,IAAI,CAACH,MAAQ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