From 0a801d702dc41dae7eac0c802b822493ddc3ac41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=9A=E8=B0=94=E7=9A=84=E7=8C=AB?= Date: Sun, 26 May 2019 03:11:06 +0800 Subject: [PATCH] Chore: improve perf test (#11756) it removed something in created config for perf test: a. rule config for deprecated rules b. index, utils. the result of ls() includes index.js and utils/* while they are not rules, that's say, it's not a 'valid' config --- Makefile.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.js b/Makefile.js index 9d0c74bf887..03715617168 100644 --- a/Makefile.js +++ b/Makefile.js @@ -26,7 +26,8 @@ const lodash = require("lodash"), ejs = require("ejs"), loadPerf = require("load-perf"), yaml = require("js-yaml"), - { CLIEngine } = require("./lib/cli-engine"); + { CLIEngine } = require("./lib/cli-engine"), + builtinRules = require("./lib/rules/index"); const { cat, cd, cp, echo, exec, exit, find, ls, mkdir, pwd, rm, test } = require("shelljs"); @@ -959,7 +960,9 @@ function createConfigForPerformanceTest() { "rules:" ]; - content.push(...ls("lib/rules").map(fileName => ` ${path.basename(fileName, ".js")}: 1`)); + for (const [ruleId] of builtinRules) { + content.push(` ${ruleId}: 1`); + } content.join("\n").to(PERF_ESLINTRC); }