@zthun/janitor-lint 19.1.5 → 19.2.1

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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  const usage = require("yargs");
4
- const janitorLint = require("./janitor-lint-mpfQFQY6.cjs");
4
+ const janitorLint = require("./janitor-lint-Cq53L9m4.cjs");
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 janitorLint.ZJanitorLint(console);
7
7
  janitor.run(args).then((result) => process.exitCode = result);
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-DDCzTq1u.js";
3
+ import { Z as ZJanitorLint } from "./janitor-lint-qkTWaEzl.js";
4
4
  const args = usage("$0 [options]").alias("c", "config").describe("c", "Optional config file to use.").string("c").help().parse();
5
5
  const janitor = new ZJanitorLint(console);
6
6
  janitor.run(args).then((result) => process.exitCode = result);
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const janitorLint = require("./janitor-lint-mpfQFQY6.cjs");
3
+ const janitorLint = require("./janitor-lint-Cq53L9m4.cjs");
4
4
  class ZLinterSilent {
5
5
  /**
6
6
  * Initializes a new instance of this object.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, b, c, d, e, f, g, h, Z, i, j, k, l, m, n } from "./janitor-lint-DDCzTq1u.js";
1
+ import { a, b, c, d, e, f, g, h, Z, i, j, k, l, m, n } from "./janitor-lint-qkTWaEzl.js";
2
2
  class ZLinterSilent {
3
3
  /**
4
4
  * Initializes a new instance of this object.
@@ -16,11 +16,11 @@ const cspell = require("cspell");
16
16
  const stylelint = require("stylelint");
17
17
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
18
18
  function $require(id) {
19
- const require$1 = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("janitor-lint-mpfQFQY6.cjs", document.baseURI).href);
19
+ const require$1 = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("janitor-lint-Cq53L9m4.cjs", document.baseURI).href);
20
20
  return require$1(id);
21
21
  }
22
22
  function $resolve(id, options) {
23
- const require$1 = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("janitor-lint-mpfQFQY6.cjs", document.baseURI).href);
23
+ const require$1 = node_module.createRequire(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("janitor-lint-Cq53L9m4.cjs", document.baseURI).href);
24
24
  return require$1.resolve(id, options);
25
25
  }
26
26
  class ZConfigExtender {
@@ -276,7 +276,9 @@ class ZLinterEs {
276
276
  * has errors.
277
277
  */
278
278
  async lint(src, config) {
279
- const esOptions = {};
279
+ const esOptions = {
280
+ errorOnUnmatchedPattern: false
281
+ };
280
282
  if (config) {
281
283
  esOptions.overrideConfigFile = $resolve(config, {
282
284
  paths: [process.cwd()]
@@ -551,15 +553,18 @@ class ZLinterStyle {
551
553
  * The list of globs to lint.
552
554
  * @param config -
553
555
  * The linter config file.
556
+ * @param exclude
557
+ * The globs to exclude.
554
558
  *
555
559
  * @returns
556
560
  * A promise that, when resolved, returns true
557
561
  * if there are no lint errors, or
558
562
  * false if errors are present.
559
563
  */
560
- async lint(content, config) {
564
+ async lint(content, config, exclude) {
561
565
  const options = {
562
- files: content
566
+ files: content,
567
+ ignorePattern: exclude
563
568
  };
564
569
  if (config) {
565
570
  options.configFile = $resolve(config, { paths: [process.cwd()] });
@@ -663,6 +668,7 @@ class ZJanitorLint {
663
668
  esFiles,
664
669
  styleConfig,
665
670
  styleFiles,
671
+ styleFilesExclude,
666
672
  htmlConfig,
667
673
  htmlFiles,
668
674
  htmlFilesExclude,
@@ -727,7 +733,11 @@ class ZJanitorLint {
727
733
  `Linting style files from ${styleFiles.length} globs.`
728
734
  )
729
735
  );
730
- current = await this.styleLint.lint(styleFiles, styleConfig, void 0);
736
+ current = await this.styleLint.lint(
737
+ styleFiles,
738
+ styleConfig,
739
+ styleFilesExclude
740
+ );
731
741
  result = result && current;
732
742
  }
733
743
  if (htmlFiles) {
@@ -806,4 +816,4 @@ exports.ZLinterMarkdown = ZLinterMarkdown;
806
816
  exports.ZLinterReport = ZLinterReport;
807
817
  exports.ZLinterSpelling = ZLinterSpelling;
808
818
  exports.ZLinterStyle = ZLinterStyle;
809
- //# sourceMappingURL=janitor-lint-mpfQFQY6.cjs.map
819
+ //# sourceMappingURL=janitor-lint-Cq53L9m4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"janitor-lint-Cq53L9m4.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 errorOnUnmatchedPattern: false,\n };\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 * @param exclude\n * The globs to exclude.\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(\n content: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n ignorePattern: exclude,\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 styleFilesExclude,\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(\n styleFiles,\n styleConfig,\n styleFilesExclude,\n );\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","createRequire","module","cosmiconfig","path","resolve","resolveConfig","HTMLHint","getFileInfo","check","load","ESLint","every","promisify","readFile","sync","lint","some","values","uniq","noop","issue"],"mappings":";;;;;;;;;;;;;;;;;AAEO,SAAS,SAAS,IAAY;AAC7B,QAAAA,YAAUC,YAAc,gRAAe;AAC7C,SAAOD,UAAQ,EAAE;AACnB;AAEgB,SAAA,SAAS,IAAY,SAAgC;AAC7D,QAAAA,YAAUC,YAAc,gRAAe;AACtC,SAAAD,UAAQ,QAAQ,IAAI,OAAO;AACpC;ACkBO,MAAM,gBAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhD,YAAmB,MAAM,WAAW;AAAjB,SAAA,MAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiB1B,MAAa,OAAO,QAA2B;AACzC,QAAA,UAAU,QAAQ,CAAC,OAAO,eAAe,KAAK,QAAQ,KAAK,GAAG,GAAG;AAC5D,aAAA;AAAA,IAAA;AA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AAU;AAAA,QAC7B;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,eAAS,UAAU;AAAA,IAAA;AAGrB,QAAI,aAAa;AACf,WAAK,QAAQ;AAAA,QACX,MAAM,QAAQ;AAAA,UACZ,2BAA2B,YAAY,MAAM;AAAA,QAAA;AAAA,MAEjD;AACU,gBAAA,MAAM,KAAK,WAAW;AAAA,QAC9B;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,eAAS,UAAU;AAAA,IAAA;AAGrB,WAAO,SAAS,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAatB,MAAa,IAAI,MAA0C;AACrD,QAAA;AACF,YAAM,UAAU,MAAM,KAAK,OAAO,KAAK,KAAK,MAAM;AAC3C,aAAA,KAAK,KAAK,OAAO;AAAA,aACjB,KAAK;AACP,WAAA,QAAQ,MAAM,GAAG;AACf,aAAA;AAAA,IAAA;AAAA,EACT;AAEJ;;;;;;;;;;;;;;;;"}
@@ -274,7 +274,9 @@ class ZLinterEs {
274
274
  * has errors.
275
275
  */
276
276
  async lint(src, config) {
277
- const esOptions = {};
277
+ const esOptions = {
278
+ errorOnUnmatchedPattern: false
279
+ };
278
280
  if (config) {
279
281
  esOptions.overrideConfigFile = $resolve(config, {
280
282
  paths: [process.cwd()]
@@ -549,15 +551,18 @@ class ZLinterStyle {
549
551
  * The list of globs to lint.
550
552
  * @param config -
551
553
  * The linter config file.
554
+ * @param exclude
555
+ * The globs to exclude.
552
556
  *
553
557
  * @returns
554
558
  * A promise that, when resolved, returns true
555
559
  * if there are no lint errors, or
556
560
  * false if errors are present.
557
561
  */
558
- async lint(content, config) {
562
+ async lint(content, config, exclude) {
559
563
  const options = {
560
- files: content
564
+ files: content,
565
+ ignorePattern: exclude
561
566
  };
562
567
  if (config) {
563
568
  options.configFile = $resolve(config, { paths: [process.cwd()] });
@@ -661,6 +666,7 @@ class ZJanitorLint {
661
666
  esFiles,
662
667
  styleConfig,
663
668
  styleFiles,
669
+ styleFilesExclude,
664
670
  htmlConfig,
665
671
  htmlFiles,
666
672
  htmlFilesExclude,
@@ -725,7 +731,11 @@ class ZJanitorLint {
725
731
  `Linting style files from ${styleFiles.length} globs.`
726
732
  )
727
733
  );
728
- current = await this.styleLint.lint(styleFiles, styleConfig, void 0);
734
+ current = await this.styleLint.lint(
735
+ styleFiles,
736
+ styleConfig,
737
+ styleFilesExclude
738
+ );
729
739
  result = result && current;
730
740
  }
731
741
  if (htmlFiles) {
@@ -806,4 +816,4 @@ export {
806
816
  ZLinterSpelling as m,
807
817
  ZLinterStyle as n
808
818
  };
809
- //# sourceMappingURL=janitor-lint-DDCzTq1u.js.map
819
+ //# sourceMappingURL=janitor-lint-qkTWaEzl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"janitor-lint-qkTWaEzl.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 errorOnUnmatchedPattern: false,\n };\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 * @param exclude\n * The globs to exclude.\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(\n content: string[],\n config?: string,\n exclude?: string[],\n ): Promise<boolean> {\n const options: Partial<stylelint.LinterOptions> = {\n files: content,\n ignorePattern: exclude,\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 styleFilesExclude,\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(\n styleFiles,\n styleConfig,\n styleFilesExclude,\n );\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","issue","lint"],"mappings":";;;;;;;;;;;;;;;AAEO,SAAS,SAAS,IAAY;AAC7B,QAAAA,WAAU,cAAc,YAAY,GAAG;AAC7C,SAAOA,SAAQ,EAAE;AACnB;AAEgB,SAAA,SAAS,IAAY,SAAgC;AAC7D,QAAAA,WAAU,cAAc,YAAY,GAAG;AACtC,SAAAA,SAAQ,QAAQ,IAAI,OAAO;AACpC;ACkBO,MAAM,gBAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhD,YAAmB,MAAM,WAAW;AAAjB,SAAA,MAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiB1B,MAAa,OAAO,QAA2B;AACzC,QAAA,UAAU,QAAQ,CAAC,OAAO,eAAe,KAAK,QAAQ,KAAK,GAAG,GAAG;AAC5D,aAAA;AAAA,IAAA;AAGH,UAAA,aAAa,OAAO,KAAK,GAAG;AAClC,UAAM,UAAU,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,UAAU;AACpE,UAAM,WAAW,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC;AACpE,QAAI,UAAU,SAAS;AAAA,MACrB,CAAC,MAAM,YAAY,OAAO,OAAO,CAAC,GAAG,MAAM,OAAO;AAAA,MAClD,CAAA;AAAA,IACF;AACA,cAAU,OAAO,OAAO,CAAA,G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M;AAC3C,aAAA,KAAK,KAAK,OAAO;AAAA,aACjB,KAAK;AACP,WAAA,QAAQ,MAAM,GAAG;AACf,aAAA;AAAA,IAAA;AAAA,EACT;AAEJ;"}
@@ -18,11 +18,13 @@ export declare class ZLinterStyle implements IZLinter {
18
18
  * The list of globs to lint.
19
19
  * @param config -
20
20
  * The linter config file.
21
+ * @param exclude
22
+ * The globs to exclude.
21
23
  *
22
24
  * @returns
23
25
  * A promise that, when resolved, returns true
24
26
  * if there are no lint errors, or
25
27
  * false if errors are present.
26
28
  */
27
- lint(content: string[], config?: string): Promise<boolean>;
29
+ lint(content: string[], config?: string, exclude?: string[]): Promise<boolean>;
28
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/janitor-lint",
3
- "version": "19.1.5",
3
+ "version": "19.2.1",
4
4
  "description": "Style checks with tools for web projects using common rules.",
5
5
  "keywords": [
6
6
  "linters"
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "author": "Anthony Bonta",
35
35
  "dependencies": {
36
- "@zthun/janitor-options": "^19.1.5",
36
+ "@zthun/janitor-options": "^19.2.1",
37
37
  "chalk": "^5.4.1",
38
38
  "cosmiconfig": "^9.0.0",
39
39
  "cspell": "^9.0.2",
@@ -51,11 +51,11 @@
51
51
  "dist"
52
52
  ],
53
53
  "devDependencies": {
54
- "@zthun/janitor-build-config": "^19.1.5",
54
+ "@zthun/janitor-build-config": "^19.2.0",
55
55
  "typescript": "~5.8.3",
56
56
  "vite": "^6.3.5",
57
57
  "vitest": "^3.2.3",
58
58
  "vitest-mock-extended": "^3.1.0"
59
59
  },
60
- "gitHead": "a571625a655dcb48271b8a26dcf3dcad556f3b52"
60
+ "gitHead": "79d93b2652312219f44613e8aed4de9e22d6906f"
61
61
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"janitor-lint-DDCzTq1u.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","issue","lint"],"mappings":";;;;;;;;;;;;;;;AAEO,SAAS,SAAS,IAAY;AAC7B,QAAAA,WAAU,cAAc,YAAY,GAAG;AAC7C,SAAOA,SAAQ,EAAE;AACnB;AAEgB,SAAA,SAAS,IAAY,SAAgC;AAC7D,QAAAA,WAAU,cAAc,YAAY,GAAG;AACtC,SAAAA,SAAQ,QAAQ,IAAI,OAAO;AACpC;ACkBO,MAAM,gBAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhD,YAAmB,MAAM,WAAW;AAAjB,SAAA,MAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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A;AAGrB,QAAI,aAAa;AACf,WAAK,QAAQ;AAAA,QACX,MAAM,QAAQ;AAAA,UACZ,2BAA2B,YAAY,MAAM;AAAA,QAAA;AAAA,MAEjD;AACU,gBAAA,MAAM,KAAK,WAAW;AAAA,QAC9B;AAAA,QACA;AAAA,QACA;AAAA,MACF;AACA,eAAS,UAAU;AAAA,IAAA;AAGrB,WAAO,SAAS,IAAI;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAatB,MAAa,IAAI,MAA0C;AACrD,QAAA;AACF,YAAM,UAAU,MAAM,KAAK,OAAO,KAAK,KAAK,MAAM;AAC3C,aAAA,KAAK,KAAK,OAAO;AAAA,aACjB,KAAK;AACP,WAAA,QAAQ,MAAM,GAAG;AACf,aAAA;AAAA,IAAA;AAAA,EACT;AAEJ;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"janitor-lint-mpfQFQY6.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","createRequire","module","cosmiconfig","path","resolve","resolveConfig","HTMLHint","getFileInfo","check","load","ESLint","every","promisify","readFile","sync","lint","some","values","uniq","noop","issue"],"mappings":";;;;;;;;;;;;;;;;;AAEO,SAAS,SAAS,IAAY;AAC7B,QAAAA,YAAUC,YAAc,gRAAe;AAC7C,SAAOD,UAAQ,EAAE;AACnB;AAEgB,SAAA,SAAS,IAAY,SAAgC;AAC7D,QAAAA,YAAUC,YAAc,gRAAe;AACtC,SAAAD,UAAQ,QAAQ,IAAI,OAAO;AACpC;ACkBO,MAAM,gBAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhD,YAAmB,MAAM,WAAW;AAAjB,SAAA,MAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiB1B,MAAa,OAAO,QAA2B;AACzC,QAAA,UAAU,QAAQ,CAAC,OAAO,eAAe,KAAK,QAAQ,KAAK,GAAG,GAAG;AAC5D,aAAA;AAAA,IAAA;AAGH,UAAA,aAAa,OAAO,KAAK,GAAG;AAClC,UAAM,UAAU,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,UAAU;AACpE,UAAM,WAAW,MAAM,QAAQ,IAAI,QAAQ,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC;AACpE,QAAI,UAAU,SAAS;AAAA,MACrB,CAAC,MAAM,YAAY,OAAO,OAAO,CAAC,GAAG,MAAM,OAAO;AAAA,MAClD,CAAA;AAAA,IACF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