markuplint 4.13.0 → 4.14.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 +21 -0
- package/lib/cli/bootstrap.d.ts +5 -1
- package/lib/cli/bootstrap.js +6 -0
- package/lib/cli/command.js +53 -37
- package/lib/cli/index.js +2 -2
- package/package.json +12 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
# [4.14.0](https://github.com/markuplint/markuplint/compare/markuplint@4.13.1...markuplint@4.14.0) (2025-11-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **markuplint:** add progressive output option for CLI ([9cbfa69](https://github.com/markuplint/markuplint/commit/9cbfa69d1acbcb123b7b83a91cdbaf9a97f6c3d7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [4.13.1](https://github.com/markuplint/markuplint/compare/markuplint@4.13.0...markuplint@4.13.1) (2025-08-24)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package markuplint
|
|
20
|
+
|
|
21
|
+
# [Unreleased](https://github.com/markuplint/markuplint/compare/markuplint@4.13.0...HEAD)
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
- **markuplint:** add --progressive-output option for CLI ([9cbfa69](https://github.com/markuplint/markuplint/commit/9cbfa69d1))
|
|
26
|
+
|
|
6
27
|
# [4.13.0](https://github.com/markuplint/markuplint/compare/markuplint@4.12.0...markuplint@4.13.0) (2025-08-13)
|
|
7
28
|
|
|
8
29
|
### Bug Fixes
|
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--show-config Output computed configuration of the target file. Supports \"details\" and empty. Default: empty.\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\t--max-count Limit the number of violations shown. Default: 0 (no limit).\n\t--max-warnings Number of warnings to trigger nonzero exit code. Default: -1 (no limit).\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--show-config Output computed configuration of the target file. Supports \"details\" and empty. Default: empty.\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\t--max-count Limit the number of violations shown. Default: 0 (no limit).\n\t--max-warnings Number of warnings to trigger nonzero exit code. Default: -1 (no limit).\n\t--progressive-output Output results immediately after processing each file. 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";
|
|
3
3
|
export declare const cli: import("meow").Result<{
|
|
4
4
|
config: {
|
|
5
5
|
type: "string";
|
|
@@ -79,5 +79,9 @@ export declare const cli: import("meow").Result<{
|
|
|
79
79
|
type: "number";
|
|
80
80
|
default: number;
|
|
81
81
|
};
|
|
82
|
+
progressiveOutput: {
|
|
83
|
+
type: "boolean";
|
|
84
|
+
default: false;
|
|
85
|
+
};
|
|
82
86
|
}>;
|
|
83
87
|
export type CLIOptions = ReadonlyDeep<typeof cli.flags>;
|
package/lib/cli/bootstrap.js
CHANGED
|
@@ -22,6 +22,7 @@ Options
|
|
|
22
22
|
--severity-parse-error Specifies the severity level of parse errors. Supports "error", "warning", and "off". Default: "error".
|
|
23
23
|
--max-count Limit the number of violations shown. Default: 0 (no limit).
|
|
24
24
|
--max-warnings Number of warnings to trigger nonzero exit code. Default: -1 (no limit).
|
|
25
|
+
--progressive-output Output results immediately after processing each file. Default: false.
|
|
25
26
|
|
|
26
27
|
--init Initialize settings interactively.
|
|
27
28
|
--search Search lines of codes that include the target element by selectors.
|
|
@@ -115,5 +116,10 @@ export const cli = meow(help, {
|
|
|
115
116
|
type: 'number',
|
|
116
117
|
default: -1,
|
|
117
118
|
},
|
|
119
|
+
progressiveOutput: {
|
|
120
|
+
type: 'boolean',
|
|
121
|
+
// TODO: It will be changed to `true` in the next major version.
|
|
122
|
+
default: false,
|
|
123
|
+
},
|
|
118
124
|
},
|
|
119
125
|
});
|
package/lib/cli/command.js
CHANGED
|
@@ -83,12 +83,25 @@ export async function command(files, options, apiOptions) {
|
|
|
83
83
|
if (!result) {
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
// Progressive出力が有効でJSON形式でない場合
|
|
87
|
+
if (options.progressiveOutput && format !== 'json') {
|
|
88
|
+
// 即座に出力
|
|
89
|
+
output({
|
|
90
|
+
violations: result.violations,
|
|
91
|
+
filePath: result.filePath,
|
|
92
|
+
sourceCode: result.sourceCode,
|
|
93
|
+
fixedCode: result.fixedCode,
|
|
94
|
+
status: 'processed',
|
|
95
|
+
}, options);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// 従来の動作:メモリに蓄積
|
|
99
|
+
processedFiles.push(result.filePath);
|
|
100
|
+
filesContent.set(result.filePath, {
|
|
101
|
+
sourceCode: result.sourceCode,
|
|
102
|
+
fixedCode: result.fixedCode,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
92
105
|
// Add violations to collector
|
|
93
106
|
collector.pushWithFile(result.filePath, ...result.violations);
|
|
94
107
|
const errorCount = result.violations.filter(v => v.severity === 'error').length;
|
|
@@ -109,38 +122,41 @@ export async function command(files, options, apiOptions) {
|
|
|
109
122
|
process.stdout.write(JSON.stringify(jsonOutput, null, 2) + '\n');
|
|
110
123
|
return false;
|
|
111
124
|
}
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
// Progressive出力が無効の場合のみループ後に出力
|
|
126
|
+
if (!options.progressiveOutput) {
|
|
127
|
+
// For standard/simple/github output, group violations by file
|
|
128
|
+
const violationsByFile = collector.groupByFile();
|
|
129
|
+
// Output per file - include processed files without violations
|
|
130
|
+
for (const filePath of processedFiles) {
|
|
131
|
+
const violations = violationsByFile.get(filePath) || [];
|
|
132
|
+
const content = filesContent.get(filePath) || { sourceCode: '', fixedCode: '' };
|
|
133
|
+
if (violations.length === 0 && !options.problemOnly) {
|
|
134
|
+
log('Output reports');
|
|
135
|
+
output({
|
|
136
|
+
violations,
|
|
137
|
+
filePath,
|
|
138
|
+
sourceCode: content.sourceCode,
|
|
139
|
+
fixedCode: content.fixedCode,
|
|
140
|
+
status: 'processed',
|
|
141
|
+
}, options);
|
|
142
|
+
}
|
|
143
|
+
else if (violations.length > 0) {
|
|
144
|
+
log('Output reports');
|
|
145
|
+
output({
|
|
146
|
+
violations,
|
|
147
|
+
filePath,
|
|
148
|
+
sourceCode: content.sourceCode,
|
|
149
|
+
fixedCode: content.fixedCode,
|
|
150
|
+
status: 'processed',
|
|
151
|
+
}, options);
|
|
152
|
+
}
|
|
137
153
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
154
|
+
// Output skipped files
|
|
155
|
+
if (!options.problemOnly) {
|
|
156
|
+
for (const filePath of skippedFiles) {
|
|
157
|
+
log('Output skipped file report');
|
|
158
|
+
output({ violations: [], filePath, sourceCode: '', fixedCode: '', status: 'skipped' }, options);
|
|
159
|
+
}
|
|
144
160
|
}
|
|
145
161
|
}
|
|
146
162
|
// Check if max-warnings limit is exceeded (ESLint compatible)
|
package/lib/cli/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { text } from 'node:stream/consumers';
|
|
2
2
|
import { verbosely } from '../debug.js';
|
|
3
3
|
import { cli } from './bootstrap.js';
|
|
4
4
|
import { command } from './command.js';
|
|
@@ -40,7 +40,7 @@ if (files.length > 0) {
|
|
|
40
40
|
process.exit(hasError ? 1 : 0);
|
|
41
41
|
}
|
|
42
42
|
if (usePipe()) {
|
|
43
|
-
const stdin = await
|
|
43
|
+
const stdin = await text(process.stdin).catch(error => {
|
|
44
44
|
// eslint-disable-next-line no-console
|
|
45
45
|
console.warn(error);
|
|
46
46
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"description": "An HTML linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,26 +23,25 @@
|
|
|
23
23
|
"clean": "tsc --build --clean tsconfig.build.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@markuplint/cli-utils": "4.4.
|
|
27
|
-
"@markuplint/file-resolver": "4.9.
|
|
28
|
-
"@markuplint/html-parser": "4.6.
|
|
29
|
-
"@markuplint/html-spec": "4.
|
|
26
|
+
"@markuplint/cli-utils": "4.4.13",
|
|
27
|
+
"@markuplint/file-resolver": "4.9.17",
|
|
28
|
+
"@markuplint/html-parser": "4.6.22",
|
|
29
|
+
"@markuplint/html-spec": "4.16.1",
|
|
30
30
|
"@markuplint/i18n": "4.7.0",
|
|
31
31
|
"@markuplint/ml-ast": "4.4.10",
|
|
32
|
-
"@markuplint/ml-config": "4.8.
|
|
33
|
-
"@markuplint/ml-core": "4.13.
|
|
34
|
-
"@markuplint/ml-spec": "4.
|
|
35
|
-
"@markuplint/rules": "4.11.
|
|
32
|
+
"@markuplint/ml-config": "4.8.14",
|
|
33
|
+
"@markuplint/ml-core": "4.13.2",
|
|
34
|
+
"@markuplint/ml-spec": "4.10.1",
|
|
35
|
+
"@markuplint/rules": "4.11.2",
|
|
36
36
|
"@markuplint/shared": "4.4.12",
|
|
37
37
|
"@types/debug": "4.1.12",
|
|
38
38
|
"chokidar": "4.0.3",
|
|
39
|
-
"debug": "4.4.
|
|
40
|
-
"get-stdin": "9.0.0",
|
|
39
|
+
"debug": "4.4.3",
|
|
41
40
|
"meow": "13.2.0",
|
|
42
41
|
"os-locale": "6.0.2",
|
|
43
42
|
"strict-event-emitter": "0.5.1",
|
|
44
|
-
"strip-ansi": "7.1.
|
|
43
|
+
"strip-ansi": "7.1.2",
|
|
45
44
|
"type-fest": "4.41.0"
|
|
46
45
|
},
|
|
47
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "6213ea30269ef404f030e67bbcc7fc7443ec1060"
|
|
48
47
|
}
|