tldr-lint 0.0.15 → 0.0.16
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/README.md +1 -0
- package/lib/tldr-lint-cli.js +3 -3
- package/lib/tldr-lint.js +5 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ TLDR107 | File name should end with `.md` extension
|
|
|
90
90
|
TLDR108 | File name should not contain whitespace
|
|
91
91
|
TLDR109 | File name should be lowercase
|
|
92
92
|
TLDR110 | Command example should not be empty
|
|
93
|
+
TLDR111 | File name should not contain any Windows-forbidden character
|
|
93
94
|
|
|
94
95
|
[npm-url]: https://www.npmjs.com/package/tldr-lint
|
|
95
96
|
[npm-image]: https://img.shields.io/npm/v/tldr-lint.svg
|
package/lib/tldr-lint-cli.js
CHANGED
|
@@ -90,10 +90,10 @@ cli.process = function(file, args) {
|
|
|
90
90
|
|
|
91
91
|
if (require.main === module) {
|
|
92
92
|
const { program } = require('commander');
|
|
93
|
-
const
|
|
93
|
+
const pkg = require('../package.json');
|
|
94
94
|
program
|
|
95
|
-
.version(
|
|
96
|
-
.description(
|
|
95
|
+
.version(pkg.version)
|
|
96
|
+
.description(pkg.description)
|
|
97
97
|
.arguments('<file|dir>')
|
|
98
98
|
.option('-f, --format', 'also attempt formatting (to stdout, or as specified by -o)')
|
|
99
99
|
.option('-o, --output <file>', 'output to formatted file')
|
package/lib/tldr-lint.js
CHANGED
|
@@ -39,6 +39,7 @@ module.exports.ERRORS = parser.ERRORS = {
|
|
|
39
39
|
'TLDR108': 'File name should not contain whitespace',
|
|
40
40
|
'TLDR109': 'File name should be lowercase',
|
|
41
41
|
'TLDR110': 'Command example should not be empty',
|
|
42
|
+
'TLDR111': 'File name should not contain any Windows-forbidden character'
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
(function(parser) {
|
|
@@ -212,6 +213,10 @@ linter.processFile = function(file, verbose, alsoFormat, ignoreErrors) {
|
|
|
212
213
|
result.errors.push({ locinfo: { first_line: '0' }, code: 'TLDR109', description: this.ERRORS.TLDR109 });
|
|
213
214
|
}
|
|
214
215
|
|
|
216
|
+
if (/[<>:"/\\|?*]/.test(path.basename(file))) {
|
|
217
|
+
result.errors.push({ locinfo: { first_line: '0' }, code: 'TLDR111', description: this.ERRORS.TLDR111 });
|
|
218
|
+
}
|
|
219
|
+
|
|
215
220
|
if (ignoreErrors) {
|
|
216
221
|
ignoreErrors = ignoreErrors.split(',').map(function(val) {
|
|
217
222
|
return val.trim();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tldr-lint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "A linting tool to validate tldr pages",
|
|
5
5
|
"repository": "tldr-pages/tldr-lint",
|
|
6
6
|
"scripts": {
|
|
@@ -40,9 +40,10 @@
|
|
|
40
40
|
"commander": "^12.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"concurrently": "^
|
|
44
|
-
"eslint": "^
|
|
45
|
-
"eslint-
|
|
43
|
+
"concurrently": "^9.0.0",
|
|
44
|
+
"eslint": "^9.4.0",
|
|
45
|
+
"eslint-config-eslint": "^11.0.0",
|
|
46
|
+
"eslint-plugin-jest": "^28.5.0",
|
|
46
47
|
"husky": "^9.0.6",
|
|
47
48
|
"jest": "^29.1.2",
|
|
48
49
|
"jison": "^0.4.18",
|