@zthun/janitor-lint 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +411 -0
  3. package/dist/app/janitor-lint-args.d.mts +9 -0
  4. package/dist/app/janitor-lint.d.mts +83 -0
  5. package/dist/app/janitor-lint.spec.d.ts +1 -0
  6. package/dist/cli.cjs +10 -0
  7. package/dist/cli.cjs.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +8 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/config/config-discovery.d.mts +13 -0
  12. package/dist/config/config-extender.class.spec.d.ts +1 -0
  13. package/dist/config/config-extender.d.mts +61 -0
  14. package/dist/config/config-reader-cosmic.class.spec.d.ts +1 -0
  15. package/dist/config/config-reader-cosmic.d.mts +44 -0
  16. package/dist/config/config-reader-null.class.spec.d.ts +1 -0
  17. package/dist/config/config-reader-null.d.mts +13 -0
  18. package/dist/config/config-reader-prettier.class.spec.d.ts +1 -0
  19. package/dist/config/config-reader-prettier.d.mts +18 -0
  20. package/dist/config/config-reader.d.mts +15 -0
  21. package/dist/config/config-resolve.d.mts +4 -0
  22. package/dist/content/content-linter-html.class.spec.d.ts +1 -0
  23. package/dist/content/content-linter-html.d.mts +21 -0
  24. package/dist/content/content-linter-json.class.spec.d.ts +1 -0
  25. package/dist/content/content-linter-json.d.mts +13 -0
  26. package/dist/content/content-linter-pretty.class.spec.d.ts +1 -0
  27. package/dist/content/content-linter-pretty.d.mts +21 -0
  28. package/dist/content/content-linter-yaml.class.spec.d.ts +1 -0
  29. package/dist/content/content-linter-yaml.d.mts +16 -0
  30. package/dist/content/content-linter.d.mts +21 -0
  31. package/dist/index.cjs +58 -0
  32. package/dist/index.cjs.map +1 -0
  33. package/dist/index.d.ts +21 -0
  34. package/dist/index.js +39 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/janitor-lint-CA0qEXKV.cjs +1370 -0
  37. package/dist/janitor-lint-CA0qEXKV.cjs.map +1 -0
  38. package/dist/janitor-lint-QMZ00oXe.js +1353 -0
  39. package/dist/janitor-lint-QMZ00oXe.js.map +1 -0
  40. package/dist/linter/linter-es.class.spec.d.ts +1 -0
  41. package/dist/linter/linter-es.d.mts +39 -0
  42. package/dist/linter/linter-file.class.spec.d.ts +1 -0
  43. package/dist/linter/linter-file.d.mts +45 -0
  44. package/dist/linter/linter-markdown.class.spec.d.ts +1 -0
  45. package/dist/linter/linter-markdown.d.mts +31 -0
  46. package/dist/linter/linter-report.class.spec.d.ts +1 -0
  47. package/dist/linter/linter-report.d.mts +32 -0
  48. package/dist/linter/linter-silent.class.spec.d.ts +1 -0
  49. package/dist/linter/linter-silent.d.mts +21 -0
  50. package/dist/linter/linter-spelling.class.spec.d.ts +1 -0
  51. package/dist/linter/linter-spelling.d.mts +30 -0
  52. package/dist/linter/linter-style.class.spec.d.ts +1 -0
  53. package/dist/linter/linter-style.d.mts +28 -0
  54. package/dist/linter/linter.d.mts +21 -0
  55. package/package.json +61 -0
@@ -0,0 +1,44 @@
1
+ import { IZConfigDiscovery } from './config-discovery.mjs';
2
+ import { IZConfigExtender } from './config-extender.mjs';
3
+ import { IZConfigReader } from './config-reader.mjs';
4
+ /**
5
+ * Represents a reader that uses the cosmiconfig standard for files.
6
+ */
7
+ export declare class ZConfigReaderCosmic implements IZConfigReader, IZConfigDiscovery {
8
+ name: string;
9
+ extender: IZConfigExtender;
10
+ paths: string[];
11
+ /**
12
+ * Initializes a new instance of this object.
13
+ *
14
+ * @param name -
15
+ * The name of the application to load.
16
+ * @param extender -
17
+ * The extender to expand upon the read configuration.
18
+ * @param paths -
19
+ * The additional paths to read if cosmic config does not find a valid config. Remember that these
20
+ * are paths, not modules in this case, so you can't load things from the node modules directory
21
+ * using these values. These only affect the search for the config file, not the actual
22
+ * read of the config.
23
+ */
24
+ constructor(name: string, extender: IZConfigExtender, paths?: string[]);
25
+ /**
26
+ * Runs a search for the appropriate configuration file.
27
+ *
28
+ * The extension keyword is deleted from the config.
29
+ *
30
+ * @returns
31
+ * A promise that resolves with the expanded configuration.
32
+ */
33
+ search(): Promise<any>;
34
+ /**
35
+ * Reads the config file.
36
+ *
37
+ * @param config -
38
+ * The optional configuration file. If this is null then the cosmiconfig path is searched on the name.
39
+ *
40
+ * @returns
41
+ * A promise that resolves the json object that represents the config.
42
+ */
43
+ read(config: string): Promise<any>;
44
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { IZConfigReader } from './config-reader.mjs';
2
+ /**
3
+ * Represents a config reader that returns the empty options.
4
+ */
5
+ export declare class ZConfigReaderNull implements IZConfigReader {
6
+ /**
7
+ * Returns a null resolved promise.
8
+ *
9
+ * @returns
10
+ * A promise that resolves to null.
11
+ */
12
+ read(): Promise<any>;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { Options } from 'prettier';
2
+ import { IZConfigReader } from './config-reader.mjs';
3
+ /**
4
+ * Represents a configuration reader for prettier.
5
+ */
6
+ export declare class ZConfigReaderPrettier implements IZConfigReader {
7
+ /**
8
+ * Reads the configuration file.
9
+ *
10
+ * @param config -
11
+ * The config module to load. If this value is falsy,
12
+ * then prettier will be used to retrieve the configuration.
13
+ *
14
+ * @returns
15
+ * The options for the config file.
16
+ */
17
+ read(config: string): Promise<Options>;
18
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Represents an object that can read a config file.
3
+ */
4
+ export interface IZConfigReader {
5
+ /**
6
+ * Reads the config file and returns the contents as an object.
7
+ *
8
+ * @param config -
9
+ * The config file to read.
10
+ *
11
+ * @returns
12
+ * A promise that returns the content of the config file.
13
+ */
14
+ read(config: string): Promise<any>;
15
+ }
@@ -0,0 +1,4 @@
1
+ export declare function $require(id: string): any;
2
+ export declare function $resolve(id: string, options?: {
3
+ paths?: string[];
4
+ }): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { IZContentLinter } from './content-linter.mjs';
2
+ /**
3
+ * Represents an object that can be used to hint html files.
4
+ */
5
+ export declare class ZContentLinterHtml implements IZContentLinter {
6
+ private readonly _formatOptions;
7
+ /**
8
+ * Lints the content.
9
+ *
10
+ * @param content -
11
+ * The content to check.
12
+ * @param contentPath -
13
+ * The path of the content data.
14
+ * @param options -
15
+ * The htmlhint options.
16
+ *
17
+ * @returns
18
+ * A promise that resolves if the content is lint free, and rejects if it has lint errors.
19
+ */
20
+ lint(content: string, contentPath: string, options?: any): Promise<any>;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { IZContentLinter } from './content-linter.mjs';
2
+ /**
3
+ * Represents the linter for json files.
4
+ */
5
+ export declare class ZContentLinterJson implements IZContentLinter {
6
+ /**
7
+ * Lints the collection of json files.
8
+ *
9
+ * @param contents -
10
+ * The json file contents.
11
+ */
12
+ lint(contents: string): Promise<any>;
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Options } from 'prettier';
2
+ import { IZContentLinter } from './content-linter.mjs';
3
+ /**
4
+ * Represents an object that can be used to perform prettier checks on files.
5
+ */
6
+ export declare class ZContentLinterPretty implements IZContentLinter {
7
+ /**
8
+ * Lints the content.
9
+ *
10
+ * @param content -
11
+ * The content to check.
12
+ * @param contentPath -
13
+ * The path of the content data.
14
+ * @param options -
15
+ * The htmlhint options.
16
+ *
17
+ * @returns
18
+ * A promise that resolves if the content is lint free, and rejects if it has lint errors.
19
+ */
20
+ lint(content: string, contentPath: string, options?: Options): Promise<any>;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { IZContentLinter } from './content-linter.mjs';
2
+ /**
3
+ * Represents a linter for yml files.
4
+ */
5
+ export declare class ZContentLinterYaml implements IZContentLinter {
6
+ /**
7
+ * Lints yml files.
8
+ *
9
+ * @param contents -
10
+ * Yaml formatted string.
11
+ *
12
+ * @returns
13
+ * A promise that resolves if successful, or rejects if failed.
14
+ */
15
+ lint(contents: string): Promise<any>;
16
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Represents an object that can be used to lint file contents.
3
+ */
4
+ export interface IZContentLinter {
5
+ /**
6
+ * Lints file content.
7
+ *
8
+ * @param content -
9
+ * The content to lint.
10
+ * @param contentPath -
11
+ * The path of the content.
12
+ * @param options -
13
+ * The options for the linter.
14
+ * @param optionsPath -
15
+ * The path of the options configuration.
16
+ *
17
+ * @returns
18
+ * A resolved promise if the lint is successful, a rejected promise if not.
19
+ */
20
+ lint(content: string, contentPath: string, options: any, optionsPath: string): Promise<any>;
21
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const janitorLint = require('./janitor-lint-CA0qEXKV.cjs');
6
+
7
+ function _define_property(obj, key, value) {
8
+ if (key in obj) {
9
+ Object.defineProperty(obj, key, {
10
+ value: value,
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true
14
+ });
15
+ } else {
16
+ obj[key] = value;
17
+ }
18
+ return obj;
19
+ }
20
+ /**
21
+ * Represents a silent linter that always succeeds.
22
+ */ class ZLinterSilent {
23
+ /**
24
+ * Returns a promise that resolves the resolved value.
25
+ *
26
+ * @returns
27
+ * A promise that resolves the resolved value.
28
+ */ lint() {
29
+ return Promise.resolve(this._resolve);
30
+ }
31
+ /**
32
+ * Initializes a new instance of this object.
33
+ *
34
+ * @param _resolve -
35
+ * The value to resolve.
36
+ */ constructor(_resolve = true){
37
+ _define_property(this, "_resolve", void 0);
38
+ this._resolve = _resolve;
39
+ }
40
+ }
41
+
42
+ exports.ZConfigExtender = janitorLint.ZConfigExtender;
43
+ exports.ZConfigReaderCosmic = janitorLint.ZConfigReaderCosmic;
44
+ exports.ZConfigReaderNull = janitorLint.ZConfigReaderNull;
45
+ exports.ZConfigReaderPrettier = janitorLint.ZConfigReaderPrettier;
46
+ exports.ZContentLinterHtml = janitorLint.ZContentLinterHtml;
47
+ exports.ZContentLinterJson = janitorLint.ZContentLinterJson;
48
+ exports.ZContentLinterPretty = janitorLint.ZContentLinterPretty;
49
+ exports.ZContentLinterYaml = janitorLint.ZContentLinterYaml;
50
+ exports.ZJanitorLint = janitorLint.ZJanitorLint;
51
+ exports.ZLinterEs = janitorLint.ZLinterEs;
52
+ exports.ZLinterFile = janitorLint.ZLinterFile;
53
+ exports.ZLinterMarkdown = janitorLint.ZLinterMarkdown;
54
+ exports.ZLinterReport = janitorLint.ZLinterReport;
55
+ exports.ZLinterSpelling = janitorLint.ZLinterSpelling;
56
+ exports.ZLinterStyle = janitorLint.ZLinterStyle;
57
+ exports.ZLinterSilent = ZLinterSilent;
58
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,21 @@
1
+ export * from './app/janitor-lint-args.mjs';
2
+ export * from './app/janitor-lint.mjs';
3
+ export * from './config/config-discovery.mjs';
4
+ export * from './config/config-extender.mjs';
5
+ export * from './config/config-reader-cosmic.mjs';
6
+ export * from './config/config-reader-null.mjs';
7
+ export * from './config/config-reader-prettier.mjs';
8
+ export * from './config/config-reader.mjs';
9
+ export * from './content/content-linter-html.mjs';
10
+ export * from './content/content-linter-json.mjs';
11
+ export * from './content/content-linter-pretty.mjs';
12
+ export * from './content/content-linter-yaml.mjs';
13
+ export * from './content/content-linter.mjs';
14
+ export * from './linter/linter-es.mjs';
15
+ export * from './linter/linter-file.mjs';
16
+ export * from './linter/linter-markdown.mjs';
17
+ export * from './linter/linter-report.mjs';
18
+ export * from './linter/linter-silent.mjs';
19
+ export * from './linter/linter-spelling.mjs';
20
+ export * from './linter/linter-style.mjs';
21
+ export * from './linter/linter.mjs';
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ export { a as ZConfigExtender, b as ZConfigReaderCosmic, c as ZConfigReaderNull, d as ZConfigReaderPrettier, e as ZContentLinterHtml, f as ZContentLinterJson, g as ZContentLinterPretty, h as ZContentLinterYaml, Z as ZJanitorLint, i as ZLinterEs, j as ZLinterFile, k as ZLinterMarkdown, l as ZLinterReport, m as ZLinterSpelling, n as ZLinterStyle } from './janitor-lint-QMZ00oXe.js';
2
+
3
+ function _define_property(obj, key, value) {
4
+ if (key in obj) {
5
+ Object.defineProperty(obj, key, {
6
+ value: value,
7
+ enumerable: true,
8
+ configurable: true,
9
+ writable: true
10
+ });
11
+ } else {
12
+ obj[key] = value;
13
+ }
14
+ return obj;
15
+ }
16
+ /**
17
+ * Represents a silent linter that always succeeds.
18
+ */ class ZLinterSilent {
19
+ /**
20
+ * Returns a promise that resolves the resolved value.
21
+ *
22
+ * @returns
23
+ * A promise that resolves the resolved value.
24
+ */ lint() {
25
+ return Promise.resolve(this._resolve);
26
+ }
27
+ /**
28
+ * Initializes a new instance of this object.
29
+ *
30
+ * @param _resolve -
31
+ * The value to resolve.
32
+ */ constructor(_resolve = true){
33
+ _define_property(this, "_resolve", void 0);
34
+ this._resolve = _resolve;
35
+ }
36
+ }
37
+
38
+ export { ZLinterSilent };
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/linter/linter-silent.mts"],"sourcesContent":["import { IZLinter } from \"./linter.mjs\";\n\n/**\n * Represents a silent linter that always succeeds.\n */\nexport class ZLinterSilent implements IZLinter {\n /**\n * Initializes a new instance of this object.\n *\n * @param _resolve -\n * The value to resolve.\n */\n public constructor(private _resolve = true) {}\n\n /**\n * Returns a promise that resolves the resolved value.\n *\n * @returns\n * A promise that resolves the resolved value.\n */\n public lint(): Promise<boolean> {\n return Promise.resolve(this._resolve);\n }\n}\n"],"names":["ZLinterSilent","Promise","resolve","_resolve"],"mappings":";;;;;;;;;;;;;;;AAEA;;AAEC,IACM,MAAMA,aAAAA,CAAAA;AASX;;;;;AAKC,MACD,IAAgC,GAAA;AAC9B,QAAA,OAAOC,OAAQC,CAAAA,OAAO,CAAC,IAAI,CAACC,QAAQ,CAAA;AACtC;AAhBA;;;;;AAKC,MACD,WAAmB,CAAQA,QAAW,GAAA,IAAI,CAAE;;aAAjBA,QAAAA,GAAAA,QAAAA;AAAkB;AAW/C;;;;"}