markuplint 4.9.4 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -4
- package/README.md +1 -1
- package/lib/api/ml-engine.js +5 -0
- package/lib/api/types.d.ts +2 -1
- package/lib/cli/bootstrap.d.ts +5 -1
- package/lib/cli/bootstrap.js +5 -0
- package/lib/cli/command.js +7 -0
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,21 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [4.10.0](https://github.com/markuplint/markuplint/compare/markuplint@4.9.4...markuplint@4.10.0) (2024-10-14)
|
|
7
7
|
|
|
8
|
-
**Note:** Version bump only for package markuplint
|
|
9
8
|
|
|
9
|
+
### Features
|
|
10
10
|
|
|
11
|
+
* **markuplint:** add `--severity-parse-error` option to CLI ([5b9b32f](https://github.com/markuplint/markuplint/commit/5b9b32f99049259cccea41036c4caca92be06805))
|
|
12
|
+
* **markuplint:** modified the API to accept `severity.parseError` ([f64a0a1](https://github.com/markuplint/markuplint/commit/f64a0a1d6b03a3731c6d5e83ea27423f96cde49d))
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
## [4.9.3](https://github.com/markuplint/markuplint/compare/markuplint@4.9.2...markuplint@4.9.3) (2024-09-02)
|
|
15
16
|
|
|
16
|
-
**Note:** Version bump only for package markuplint
|
|
17
17
|
|
|
18
|
+
## [4.9.4](https://github.com/markuplint/markuplint/compare/markuplint@4.9.3...markuplint@4.9.4) (2024-09-23)
|
|
18
19
|
|
|
20
|
+
**Note:** Version bump only for package markuplint
|
|
19
21
|
|
|
22
|
+
## [4.9.3](https://github.com/markuplint/markuplint/compare/markuplint@4.9.2...markuplint@4.9.3) (2024-09-02)
|
|
20
23
|
|
|
24
|
+
**Note:** Version bump only for package markuplint
|
|
21
25
|
|
|
22
26
|
## [4.9.2](https://github.com/markuplint/markuplint/compare/markuplint@4.9.1...markuplint@4.9.2) (2024-06-25)
|
|
23
27
|
|
package/README.md
CHANGED
|
@@ -84,6 +84,7 @@ Options
|
|
|
84
84
|
--problem-only, -p Output only problems, without passeds.
|
|
85
85
|
--verbose Output with detailed information.
|
|
86
86
|
--include-node-modules Include files in node_modules directory. Default: false.
|
|
87
|
+
--severity-parse-error, Specifies the severity level of parse errors. Supports "error", "warning", and "off". Default: "error".
|
|
87
88
|
|
|
88
89
|
--init Initialize settings interactively.
|
|
89
90
|
|
|
@@ -126,7 +127,6 @@ Examples
|
|
|
126
127
|
[<img width="36" src="https://avatars.githubusercontent.com/u/1996642" alt="Okuto Oyama" />](https://github.com/yamanoku)
|
|
127
128
|
[<img width="36" src="https://avatars.githubusercontent.com/u/6581173" alt="miita" />](https://github.com/mikimhk)
|
|
128
129
|
[<img width="36" src="https://avatars.githubusercontent.com/u/111797" alt="Yasuo Fukuda" />](https://github.com/sigwyg)
|
|
129
|
-
[<img width="36" src="https://avatars.githubusercontent.com/u/802921" alt="Hideyuki Saito" />](https://github.com/hideyukisaito)
|
|
130
130
|
[<img width="36" src="https://avatars.githubusercontent.com/u/91047157" alt="shamokit" />](https://github.com/shamokit)
|
|
131
131
|
[<img width="36" src="https://avatars.githubusercontent.com/u/18516475" alt="takanorip" />](https://github.com/takanorip)
|
|
132
132
|
|
package/lib/api/ml-engine.js
CHANGED
|
@@ -210,6 +210,10 @@ export class MLEngine extends Emitter {
|
|
|
210
210
|
fileLog('Avoided linting because a file is unmatched by the extension: %s', __classPrivateFieldGet(this, _MLEngine_file, "f").path);
|
|
211
211
|
return null;
|
|
212
212
|
}
|
|
213
|
+
const severity = {
|
|
214
|
+
...configSet.config.severity,
|
|
215
|
+
...__classPrivateFieldGet(this, _MLEngine_options, "f")?.severity,
|
|
216
|
+
};
|
|
213
217
|
const pretenders = await this.resolvePretenders(configSet);
|
|
214
218
|
fileLog('Resolved pretenders: %O', pretenders);
|
|
215
219
|
const ruleset = this.resolveRuleset(configSet);
|
|
@@ -236,6 +240,7 @@ export class MLEngine extends Emitter {
|
|
|
236
240
|
return {
|
|
237
241
|
parser,
|
|
238
242
|
parserOptions,
|
|
243
|
+
severity,
|
|
239
244
|
pretenders,
|
|
240
245
|
ruleset,
|
|
241
246
|
schemas,
|
package/lib/api/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConfigSet } from '@markuplint/file-resolver';
|
|
2
2
|
import type { LocaleSet } from '@markuplint/i18n';
|
|
3
|
-
import type { Config, Violation } from '@markuplint/ml-config';
|
|
3
|
+
import type { Config, SeverityOptions, Violation } from '@markuplint/ml-config';
|
|
4
4
|
import type { AnyMLRule, MLSchema, Ruleset } from '@markuplint/ml-core';
|
|
5
5
|
export type APIOptions = {
|
|
6
6
|
readonly configFile?: string;
|
|
@@ -12,6 +12,7 @@ export type APIOptions = {
|
|
|
12
12
|
readonly ignoreExt?: boolean;
|
|
13
13
|
readonly rules?: readonly Readonly<AnyMLRule>[];
|
|
14
14
|
readonly importPresetRules?: boolean;
|
|
15
|
+
readonly severity?: SeverityOptions;
|
|
15
16
|
/**
|
|
16
17
|
* @deprecated
|
|
17
18
|
*/
|
package/lib/cli/bootstrap.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
export declare const help = "\nUsage\n\t$ markuplint <HTML file paths (glob format)>\n\t$ <stdout> | markuplint\n\nOptions\n\t--config, -c FILE_PATH A configuration file path.\n\t--fix, Fix HTML.\n\t--format, -f FORMAT Output format. Support \"JSON\", \"Simple\", \"GitHub\" and \"Standard\". Default: \"Standard\".\n\t--no-search-config No search a configure file automatically.\n\t--ignore-ext Evaluate files that are received even though the type of extension.\n\t--no-import-preset-rules No import preset rules.\n\t--locale Locale of the message of violation. Default is an OS setting.\n\t--no-color, Output no color.\n\t--problem-only, -p Output only problems, without passeds.\n\t--allow-warnings Return status code 0 even if there are warnings.\n\t--allow-empty-input Return status code 1 even if there are no input files.\n\t--verbose Output with detailed information.\n\t--include-node-modules Include files in node_modules directory. Default: false.\n\n\t--init Initialize settings interactively.\n\t--search Search lines of codes that include the target element by selectors.\n\n\t--help, -h Show help.\n\t--version, -v Show version.\n\nExamples\n\t$ markuplint verifyee.html --config path/to/.markuplintrc\n\t$ cat verifyee.html | markuplint\n";
|
|
2
|
+
export declare const help = "\nUsage\n\t$ markuplint <HTML file paths (glob format)>\n\t$ <stdout> | markuplint\n\nOptions\n\t--config, -c FILE_PATH A configuration file path.\n\t--fix, Fix HTML.\n\t--format, -f FORMAT Output format. Support \"JSON\", \"Simple\", \"GitHub\" and \"Standard\". Default: \"Standard\".\n\t--no-search-config No search a configure file automatically.\n\t--ignore-ext Evaluate files that are received even though the type of extension.\n\t--no-import-preset-rules No import preset rules.\n\t--locale Locale of the message of violation. Default is an OS setting.\n\t--no-color, Output no color.\n\t--problem-only, -p Output only problems, without passeds.\n\t--allow-warnings Return status code 0 even if there are warnings.\n\t--allow-empty-input Return status code 1 even if there are no input files.\n\t--verbose Output with detailed information.\n\t--include-node-modules Include files in node_modules directory. Default: false.\n\t--severity-parse-error, Specifies the severity level of parse errors. Supports \"error\", \"warning\", and \"off\". Default: \"error\".\n\n\t--init Initialize settings interactively.\n\t--search Search lines of codes that include the target element by selectors.\n\n\t--help, -h Show help.\n\t--version, -v Show version.\n\nExamples\n\t$ markuplint verifyee.html --config path/to/.markuplintrc\n\t$ cat verifyee.html | markuplint\n";
|
|
3
3
|
export declare const cli: import("meow").Result<{
|
|
4
4
|
config: {
|
|
5
5
|
type: "string";
|
|
@@ -64,5 +64,9 @@ export declare const cli: import("meow").Result<{
|
|
|
64
64
|
type: "boolean";
|
|
65
65
|
default: false;
|
|
66
66
|
};
|
|
67
|
+
severityParseError: {
|
|
68
|
+
type: "string";
|
|
69
|
+
default: string;
|
|
70
|
+
};
|
|
67
71
|
}>;
|
|
68
72
|
export type CLIOptions = ReadonlyDeep<typeof cli.flags>;
|
package/lib/cli/bootstrap.js
CHANGED
|
@@ -18,6 +18,7 @@ Options
|
|
|
18
18
|
--allow-empty-input Return status code 1 even if there are no input files.
|
|
19
19
|
--verbose Output with detailed information.
|
|
20
20
|
--include-node-modules Include files in node_modules directory. Default: false.
|
|
21
|
+
--severity-parse-error, Specifies the severity level of parse errors. Supports "error", "warning", and "off". Default: "error".
|
|
21
22
|
|
|
22
23
|
--init Initialize settings interactively.
|
|
23
24
|
--search Search lines of codes that include the target element by selectors.
|
|
@@ -96,5 +97,9 @@ export const cli = meow(help, {
|
|
|
96
97
|
type: 'boolean',
|
|
97
98
|
default: false,
|
|
98
99
|
},
|
|
100
|
+
severityParseError: {
|
|
101
|
+
type: 'string',
|
|
102
|
+
default: 'error',
|
|
103
|
+
},
|
|
99
104
|
},
|
|
100
105
|
});
|
package/lib/cli/command.js
CHANGED
|
@@ -28,6 +28,12 @@ export async function command(files, options, apiOptions) {
|
|
|
28
28
|
const format = options.format?.toLowerCase().trim();
|
|
29
29
|
let hasError = false;
|
|
30
30
|
const jsonOutput = [];
|
|
31
|
+
const severityParseError = options.severityParseError.toLowerCase();
|
|
32
|
+
const severity = {
|
|
33
|
+
parseError: ['error', 'warning', 'off'].includes(severityParseError)
|
|
34
|
+
? severityParseError
|
|
35
|
+
: true,
|
|
36
|
+
};
|
|
31
37
|
for (const file of fileList) {
|
|
32
38
|
const engine = new MLEngine(file, {
|
|
33
39
|
configFile,
|
|
@@ -37,6 +43,7 @@ export async function command(files, options, apiOptions) {
|
|
|
37
43
|
ignoreExt,
|
|
38
44
|
importPresetRules,
|
|
39
45
|
debug: verbose,
|
|
46
|
+
severity,
|
|
40
47
|
...apiOptions,
|
|
41
48
|
});
|
|
42
49
|
const result = await engine.exec();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.0",
|
|
4
4
|
"description": "An HTML linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"clean": "tsc --build --clean"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@markuplint/cli-utils": "4.4.
|
|
29
|
-
"@markuplint/file-resolver": "4.9.
|
|
30
|
-
"@markuplint/html-parser": "4.6.
|
|
31
|
-
"@markuplint/html-spec": "4.9.
|
|
32
|
-
"@markuplint/i18n": "4.5.
|
|
33
|
-
"@markuplint/ml-ast": "4.4.
|
|
34
|
-
"@markuplint/ml-config": "4.
|
|
35
|
-
"@markuplint/ml-core": "4.
|
|
36
|
-
"@markuplint/ml-spec": "4.7.
|
|
37
|
-
"@markuplint/rules": "4.10.
|
|
38
|
-
"@markuplint/shared": "4.4.
|
|
28
|
+
"@markuplint/cli-utils": "4.4.6",
|
|
29
|
+
"@markuplint/file-resolver": "4.9.3",
|
|
30
|
+
"@markuplint/html-parser": "4.6.8",
|
|
31
|
+
"@markuplint/html-spec": "4.9.2",
|
|
32
|
+
"@markuplint/i18n": "4.5.4",
|
|
33
|
+
"@markuplint/ml-ast": "4.4.5",
|
|
34
|
+
"@markuplint/ml-config": "4.8.0",
|
|
35
|
+
"@markuplint/ml-core": "4.10.0",
|
|
36
|
+
"@markuplint/ml-spec": "4.7.1",
|
|
37
|
+
"@markuplint/rules": "4.10.1",
|
|
38
|
+
"@markuplint/shared": "4.4.6",
|
|
39
39
|
"@types/debug": "4.1.12",
|
|
40
40
|
"chokidar": "4.0.1",
|
|
41
41
|
"debug": "4.3.7",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"strip-ansi": "7.1.0",
|
|
47
47
|
"type-fest": "4.26.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "e59d4e8b762c66c7e3fb8b0a0d9d99d5160b0afa"
|
|
50
50
|
}
|