markuplint
Advanced tools
Comparing version 3.0.0-dev.177 to 3.0.0-dev.186
import type { ReadonlyDeep } from 'type-fest'; | ||
import meow from 'meow'; | ||
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--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"; | ||
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\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'; | ||
export declare const cli: meow.Result<{ | ||
config: { | ||
type: "string"; | ||
alias: string; | ||
}; | ||
fix: { | ||
type: "boolean"; | ||
default: false; | ||
}; | ||
format: { | ||
type: "string"; | ||
alias: string; | ||
}; | ||
searchConfig: { | ||
type: "boolean"; | ||
default: true; | ||
}; | ||
ignoreExt: { | ||
type: "boolean"; | ||
default: false; | ||
}; | ||
importPresetRules: { | ||
type: "boolean"; | ||
default: true; | ||
}; | ||
locale: { | ||
type: "string"; | ||
}; | ||
color: { | ||
type: "boolean"; | ||
default: true; | ||
}; | ||
problemOnly: { | ||
type: "boolean"; | ||
alias: string; | ||
default: false; | ||
}; | ||
verbose: { | ||
type: "boolean"; | ||
default: false; | ||
}; | ||
init: { | ||
type: "boolean"; | ||
default: false; | ||
}; | ||
createRule: { | ||
type: "boolean"; | ||
default: false; | ||
}; | ||
search: { | ||
type: "string"; | ||
}; | ||
config: { | ||
type: 'string'; | ||
alias: string; | ||
}; | ||
fix: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
format: { | ||
type: 'string'; | ||
alias: string; | ||
}; | ||
searchConfig: { | ||
type: 'boolean'; | ||
default: true; | ||
}; | ||
ignoreExt: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
importPresetRules: { | ||
type: 'boolean'; | ||
default: true; | ||
}; | ||
locale: { | ||
type: 'string'; | ||
}; | ||
color: { | ||
type: 'boolean'; | ||
default: true; | ||
}; | ||
problemOnly: { | ||
type: 'boolean'; | ||
alias: string; | ||
default: false; | ||
}; | ||
allowWarnings: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
allowEmptyInput: { | ||
type: 'boolean'; | ||
default: true; | ||
}; | ||
verbose: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
init: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
createRule: { | ||
type: 'boolean'; | ||
default: false; | ||
}; | ||
search: { | ||
type: 'string'; | ||
}; | ||
}>; | ||
export type CLIOptions = ReadonlyDeep<typeof cli.flags>; |
@@ -21,2 +21,4 @@ "use strict"; | ||
--problem-only, -p Output only problems, without passeds. | ||
--allow-warnings Return status code 0 even if there are warnings. | ||
--allow-empty-input Return status code 1 even if there are no input files. | ||
--verbose Output with detailed information. | ||
@@ -73,2 +75,11 @@ | ||
}, | ||
allowWarnings: { | ||
type: 'boolean', | ||
// TODO: It will be changed to `true` in the next major version. | ||
default: false, | ||
}, | ||
allowEmptyInput: { | ||
type: 'boolean', | ||
default: true, | ||
}, | ||
verbose: { | ||
@@ -75,0 +86,0 @@ type: 'boolean', |
@@ -21,2 +21,7 @@ "use strict"; | ||
const fileList = await (0, file_resolver_1.resolveFiles)(files); | ||
if (fileList.length === 0 && !options.allowEmptyInput) { | ||
process.stderr.write('Markuplint: No target files.\n'); | ||
// Error | ||
return true; | ||
} | ||
if (debug_1.log.enabled) { | ||
@@ -45,3 +50,5 @@ (0, debug_1.log)('File list: %O', fileList.map(f => f.path)); | ||
} | ||
if (!hasError && result.violations.length > 0) { | ||
const errorCount = result.violations.filter(v => v.severity === 'error').length; | ||
const warningCount = result.violations.filter(v => v.severity === 'warning').length; | ||
if (!hasError && (errorCount > 0 || (warningCount > 0 && !options.allowWarnings))) { | ||
hasError = true; | ||
@@ -48,0 +55,0 @@ } |
@@ -47,3 +47,2 @@ "use strict"; | ||
throw err; | ||
// process.exit(1); | ||
}); | ||
@@ -50,0 +49,0 @@ process.exit(hasError ? 1 : 0); |
{ | ||
"name": "markuplint", | ||
"version": "3.0.0-dev.177+e94f3601", | ||
"version": "3.0.0-dev.186+37ceba57", | ||
"description": "An HTML linter for all markup developers", | ||
@@ -23,13 +23,13 @@ "author": "Yusuke Hirao", | ||
"dependencies": { | ||
"@markuplint/create-rule-helper": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/file-resolver": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/html-parser": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/html-spec": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/i18n": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/ml-ast": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/ml-config": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/ml-core": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/ml-spec": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/rules": "3.0.0-dev.177+e94f3601", | ||
"@markuplint/shared": "3.5.1-dev.3130+e94f3601", | ||
"@markuplint/create-rule-helper": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/file-resolver": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/html-parser": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/html-spec": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/i18n": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/ml-ast": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/ml-config": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/ml-core": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/ml-spec": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/rules": "3.0.0-dev.186+37ceba57", | ||
"@markuplint/shared": "3.6.1-dev.3156+37ceba57", | ||
"@types/cli-color": "^2.0.2", | ||
@@ -58,3 +58,3 @@ "@types/debug": "^4.1.7", | ||
}, | ||
"gitHead": "e94f3601bf93366d1a2c7385ff7235817d82f7c9" | ||
"gitHead": "37ceba578aff49e0326c5e374cef3da6be303b25" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
84961
1949