From aadc03f065432896253996c2a821eafce2c871d2 Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Sun, 29 Sep 2024 21:10:58 +0200 Subject: [PATCH] Update tldr-lint.js --- lib/tldr-lint.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/tldr-lint.js b/lib/tldr-lint.js index 54f7635..9fad188 100644 --- a/lib/tldr-lint.js +++ b/lib/tldr-lint.js @@ -4,7 +4,6 @@ const parser = require('./tldr-parser.js').parser; const util = require('util'); const MAX_EXAMPLES = 8; -const INVALID_WINDOWS_CHARACTERS = /[<>:"/\\|?*]/; module.exports.ERRORS = parser.ERRORS = { 'TLDR001': 'File should contain no leading whitespace', @@ -214,7 +213,7 @@ linter.processFile = function(file, verbose, alsoFormat, ignoreErrors) { result.errors.push({ locinfo: { first_line: '0' }, code: 'TLDR109', description: this.ERRORS.TLDR109 }); } - if (INVALID_WINDOWS_CHARACTERS.test(path.basename(file))) { + if (/[<>:"/\\|?*]/.test(path.basename(file))) { result.errors.push({ locinfo: { first_line: '0' }, code: 'TLDR111', description: this.ERRORS.TLDR111 }); }