tldr-lint 0.0.15 → 0.0.17

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 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
@@ -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 package = require('../package.json');
93
+ const pkg = require('../package.json');
94
94
  program
95
- .version(package.version)
96
- .description(package.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();
@@ -700,7 +700,7 @@ break;
700
700
  case 7:
701
701
  if (this.topState() === "title") {
702
702
  yy_.yytext = this.matches[1];
703
- if (this.matches[1].match(/([^\w+\[. -])|(\.$)/)) yy.error(yy_.yylloc, 'TLDR013');
703
+ if (this.matches[1].match(/([^\w+\[\]}. -])|(\.$)/)) yy.error(yy_.yylloc, 'TLDR013');
704
704
  this.checkTrailingWhitespace(this.matches[2], yy_.yylloc);
705
705
  this.checkNewline(this.matches[3], yy_.yylloc);
706
706
  this.popState();
@@ -882,4 +882,4 @@ exports.main = function commonjsMain (args) {
882
882
  if (typeof module !== 'undefined' && require.main === module) {
883
883
  exports.main(process.argv.slice(1));
884
884
  }
885
- }
885
+ }
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "tldr-lint",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "A linting tool to validate tldr pages",
5
- "repository": "tldr-pages/tldr-lint",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/tldr-pages/tldr-lint.git"
8
+ },
6
9
  "scripts": {
7
10
  "jison": "jison tldr.yy tldr.l -o lib/tldr-parser.js",
8
11
  "lint": "eslint lib specs",
@@ -37,14 +40,15 @@
37
40
  },
38
41
  "license": "MIT",
39
42
  "dependencies": {
40
- "commander": "^12.0.0"
43
+ "commander": "^13.0.0"
41
44
  },
42
45
  "devDependencies": {
43
- "concurrently": "^8.0.1",
44
- "eslint": "^8.0.0",
45
- "eslint-plugin-jest": "^27.0.4",
46
- "husky": "^9.0.6",
47
- "jest": "^29.1.2",
46
+ "concurrently": "^9.1.2",
47
+ "eslint": "^9.17.0",
48
+ "eslint-config-eslint": "^11.0.0",
49
+ "eslint-plugin-jest": "^28.10.0",
50
+ "husky": "^9.1.7",
51
+ "jest": "^29.7.0",
48
52
  "jison": "^0.4.18",
49
53
  "onchange": "^7.1.0"
50
54
  },