From 6840940a766d671831d5cee0e3c0e2f4e642632a Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Mon, 27 Jun 2022 13:23:42 -0400 Subject: [PATCH] chore: correctly use .markdownlintignore in Makefile (#16060) --- Makefile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.js b/Makefile.js index 146aa03fc29..a9c527df557 100644 --- a/Makefile.js +++ b/Makefile.js @@ -22,6 +22,7 @@ const checker = require("npm-license"), ejs = require("ejs"), loadPerf = require("load-perf"), yaml = require("js-yaml"), + ignore = require("ignore"), { CLIEngine } = require("./lib/cli-engine"), builtinRules = require("./lib/rules/index"); @@ -72,8 +73,8 @@ const NODE = "node ", // intentional extra space // Files RULE_FILES = glob.sync("lib/rules/*.js").filter(filePath => path.basename(filePath) !== "index.js"), JSON_FILES = find("conf/").filter(fileType("json")), - MARKDOWNLINT_IGNORED_FILES = fs.readFileSync(path.join(__dirname, ".markdownlintignore"), "utf-8").split("\n"), - MARKDOWN_FILES_ARRAY = find("docs/").concat(ls(".")).filter(fileType("md")).filter(file => !MARKDOWNLINT_IGNORED_FILES.includes(file)), + MARKDOWNLINT_IGNORE_INSTANCE = ignore().add(fs.readFileSync(path.join(__dirname, ".markdownlintignore"), "utf-8")), + MARKDOWN_FILES_ARRAY = MARKDOWNLINT_IGNORE_INSTANCE.filter(find("docs/").concat(ls(".")).filter(fileType("md"))), TEST_FILES = "\"tests/{bin,conf,lib,tools}/**/*.js\"", PERF_ESLINTRC = path.join(PERF_TMP_DIR, "eslintrc.yml"), PERF_MULTIFILES_TARGET_DIR = path.join(PERF_TMP_DIR, "eslint"),