markuplint 3.0.0-dev.176 → 3.0.0-dev.186
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/lib/cli/bootstrap.d.ts +61 -52
- package/lib/cli/bootstrap.js +11 -0
- package/lib/cli/command.js +8 -1
- package/lib/cli/index.js +0 -1
- package/package.json +13 -13
package/lib/cli/bootstrap.d.ts
CHANGED
|
@@ -1,57 +1,66 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import meow from 'meow';
|
|
3
|
-
export declare const help =
|
|
3
|
+
export declare const help =
|
|
4
|
+
'\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\n\t--init Initialize settings interactively.\n\t--create-rule Add the scaffold of a custom rule.\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';
|
|
4
5
|
export declare const cli: meow.Result<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
6
|
+
config: {
|
|
7
|
+
type: 'string';
|
|
8
|
+
alias: string;
|
|
9
|
+
};
|
|
10
|
+
fix: {
|
|
11
|
+
type: 'boolean';
|
|
12
|
+
default: false;
|
|
13
|
+
};
|
|
14
|
+
format: {
|
|
15
|
+
type: 'string';
|
|
16
|
+
alias: string;
|
|
17
|
+
};
|
|
18
|
+
searchConfig: {
|
|
19
|
+
type: 'boolean';
|
|
20
|
+
default: true;
|
|
21
|
+
};
|
|
22
|
+
ignoreExt: {
|
|
23
|
+
type: 'boolean';
|
|
24
|
+
default: false;
|
|
25
|
+
};
|
|
26
|
+
importPresetRules: {
|
|
27
|
+
type: 'boolean';
|
|
28
|
+
default: true;
|
|
29
|
+
};
|
|
30
|
+
locale: {
|
|
31
|
+
type: 'string';
|
|
32
|
+
};
|
|
33
|
+
color: {
|
|
34
|
+
type: 'boolean';
|
|
35
|
+
default: true;
|
|
36
|
+
};
|
|
37
|
+
problemOnly: {
|
|
38
|
+
type: 'boolean';
|
|
39
|
+
alias: string;
|
|
40
|
+
default: false;
|
|
41
|
+
};
|
|
42
|
+
allowWarnings: {
|
|
43
|
+
type: 'boolean';
|
|
44
|
+
default: false;
|
|
45
|
+
};
|
|
46
|
+
allowEmptyInput: {
|
|
47
|
+
type: 'boolean';
|
|
48
|
+
default: true;
|
|
49
|
+
};
|
|
50
|
+
verbose: {
|
|
51
|
+
type: 'boolean';
|
|
52
|
+
default: false;
|
|
53
|
+
};
|
|
54
|
+
init: {
|
|
55
|
+
type: 'boolean';
|
|
56
|
+
default: false;
|
|
57
|
+
};
|
|
58
|
+
createRule: {
|
|
59
|
+
type: 'boolean';
|
|
60
|
+
default: false;
|
|
61
|
+
};
|
|
62
|
+
search: {
|
|
63
|
+
type: 'string';
|
|
64
|
+
};
|
|
56
65
|
}>;
|
|
57
66
|
export type CLIOptions = ReadonlyDeep<typeof cli.flags>;
|
package/lib/cli/bootstrap.js
CHANGED
|
@@ -18,6 +18,8 @@ Options
|
|
|
18
18
|
--locale Locale of the message of violation. Default is an OS setting.
|
|
19
19
|
--no-color, Output no color.
|
|
20
20
|
--problem-only, -p Output only problems, without passeds.
|
|
21
|
+
--allow-warnings Return status code 0 even if there are warnings.
|
|
22
|
+
--allow-empty-input Return status code 1 even if there are no input files.
|
|
21
23
|
--verbose Output with detailed information.
|
|
22
24
|
|
|
23
25
|
--init Initialize settings interactively.
|
|
@@ -69,6 +71,15 @@ exports.cli = (0, meow_1.default)(exports.help, {
|
|
|
69
71
|
alias: 'p',
|
|
70
72
|
default: false,
|
|
71
73
|
},
|
|
74
|
+
allowWarnings: {
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
// TODO: It will be changed to `true` in the next major version.
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
allowEmptyInput: {
|
|
80
|
+
type: 'boolean',
|
|
81
|
+
default: true,
|
|
82
|
+
},
|
|
72
83
|
verbose: {
|
|
73
84
|
type: 'boolean',
|
|
74
85
|
default: false,
|
package/lib/cli/command.js
CHANGED
|
@@ -18,6 +18,11 @@ async function command(files, options, apiOptions) {
|
|
|
18
18
|
const importPresetRules = options.importPresetRules;
|
|
19
19
|
const verbose = options.verbose;
|
|
20
20
|
const fileList = await (0, file_resolver_1.resolveFiles)(files);
|
|
21
|
+
if (fileList.length === 0 && !options.allowEmptyInput) {
|
|
22
|
+
process.stderr.write('Markuplint: No target files.\n');
|
|
23
|
+
// Error
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
21
26
|
if (debug_1.log.enabled) {
|
|
22
27
|
(0, debug_1.log)('File list: %O', fileList.map(f => f.path));
|
|
23
28
|
(0, debug_1.log)('Config: %s', configFile !== null && configFile !== void 0 ? configFile : 'N/A');
|
|
@@ -41,7 +46,9 @@ async function command(files, options, apiOptions) {
|
|
|
41
46
|
if (!result) {
|
|
42
47
|
continue;
|
|
43
48
|
}
|
|
44
|
-
|
|
49
|
+
const errorCount = result.violations.filter(v => v.severity === 'error').length;
|
|
50
|
+
const warningCount = result.violations.filter(v => v.severity === 'warning').length;
|
|
51
|
+
if (!hasError && (errorCount > 0 || (warningCount > 0 && !options.allowWarnings))) {
|
|
45
52
|
hasError = true;
|
|
46
53
|
}
|
|
47
54
|
if (fix) {
|
package/lib/cli/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markuplint",
|
|
3
|
-
"version": "3.0.0-dev.
|
|
3
|
+
"version": "3.0.0-dev.186+37ceba57",
|
|
4
4
|
"description": "An HTML linter for all markup developers",
|
|
5
5
|
"author": "Yusuke Hirao",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"clean": "tsc --build --clean"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@markuplint/create-rule-helper": "3.0.0-dev.
|
|
24
|
-
"@markuplint/file-resolver": "3.0.0-dev.
|
|
25
|
-
"@markuplint/html-parser": "3.0.0-dev.
|
|
26
|
-
"@markuplint/html-spec": "3.0.0-dev.
|
|
27
|
-
"@markuplint/i18n": "3.0.0-dev.
|
|
28
|
-
"@markuplint/ml-ast": "3.0.0-dev.
|
|
29
|
-
"@markuplint/ml-config": "3.0.0-dev.
|
|
30
|
-
"@markuplint/ml-core": "3.0.0-dev.
|
|
31
|
-
"@markuplint/ml-spec": "3.0.0-dev.
|
|
32
|
-
"@markuplint/rules": "3.0.0-dev.
|
|
33
|
-
"@markuplint/shared": "3.
|
|
23
|
+
"@markuplint/create-rule-helper": "3.0.0-dev.186+37ceba57",
|
|
24
|
+
"@markuplint/file-resolver": "3.0.0-dev.186+37ceba57",
|
|
25
|
+
"@markuplint/html-parser": "3.0.0-dev.186+37ceba57",
|
|
26
|
+
"@markuplint/html-spec": "3.0.0-dev.186+37ceba57",
|
|
27
|
+
"@markuplint/i18n": "3.0.0-dev.186+37ceba57",
|
|
28
|
+
"@markuplint/ml-ast": "3.0.0-dev.186+37ceba57",
|
|
29
|
+
"@markuplint/ml-config": "3.0.0-dev.186+37ceba57",
|
|
30
|
+
"@markuplint/ml-core": "3.0.0-dev.186+37ceba57",
|
|
31
|
+
"@markuplint/ml-spec": "3.0.0-dev.186+37ceba57",
|
|
32
|
+
"@markuplint/rules": "3.0.0-dev.186+37ceba57",
|
|
33
|
+
"@markuplint/shared": "3.6.1-dev.3156+37ceba57",
|
|
34
34
|
"@types/cli-color": "^2.0.2",
|
|
35
35
|
"@types/debug": "^4.1.7",
|
|
36
36
|
"@types/has-yarn": "^1.0.1",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"type-fest": "^3.8.0",
|
|
55
55
|
"uuid": "^9.0.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "37ceba578aff49e0326c5e374cef3da6be303b25"
|
|
58
58
|
}
|