From e9d00e41a5e7343ede06656753aca750e336a78e Mon Sep 17 00:00:00 2001 From: tyankatsu Date: Tue, 23 Jun 2020 11:05:48 +0900 Subject: [PATCH 1/3] chore(tools): use ESLint class --- tools/update-lib-configs.js | 10 +++++++--- tools/update-lib-index.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/update-lib-configs.js b/tools/update-lib-configs.js index df19f3619..a4c3c7347 100644 --- a/tools/update-lib-configs.js +++ b/tools/update-lib-configs.js @@ -88,6 +88,10 @@ categories.forEach((category) => { }) // Format files. -const linter = new eslint.CLIEngine({ fix: true }) -const report = linter.executeOnFiles([ROOT]) -eslint.CLIEngine.outputFixes(report) +async function main() { + const linter = new eslint.ESLint({ fix: true }) + const report = await linter.lintFiles([ROOT]) + eslint.ESLint.outputFixes(report) +} + +main() diff --git a/tools/update-lib-index.js b/tools/update-lib-index.js index 6c93c3a3d..f414c2228 100644 --- a/tools/update-lib-index.js +++ b/tools/update-lib-index.js @@ -43,6 +43,10 @@ module.exports = { fs.writeFileSync(filePath, content) // Format files. -const linter = new eslint.CLIEngine({ fix: true }) -const report = linter.executeOnFiles([filePath]) -eslint.CLIEngine.outputFixes(report) +async function main() { + const linter = new eslint.ESLint({ fix: true }) + const report = await linter.lintFiles([filePath]) + eslint.ESLint.outputFixes(report) +} + +main() From 876897c863d0c5992070b75684cba8e2574a0875 Mon Sep 17 00:00:00 2001 From: tyankatsu Date: Tue, 23 Jun 2020 11:06:07 +0900 Subject: [PATCH 2/3] build: upgrade types of eslint --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 512de1597..b132e0a83 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "vue-eslint-parser": "^7.1.0" }, "devDependencies": { - "@types/eslint": "^6.8.1", + "@types/eslint": "^7.2.0", "@types/natural-compare": "^1.4.0", "@types/node": "^13.13.5", "@typescript-eslint/parser": "^3.0.2", From b5a3ae6006d0c06bdee7bad26c5b2194c7f0faad Mon Sep 17 00:00:00 2001 From: tyankatsu Date: Tue, 23 Jun 2020 11:35:51 +0900 Subject: [PATCH 3/3] refactor: rename function --- tools/update-lib-configs.js | 4 ++-- tools/update-lib-index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/update-lib-configs.js b/tools/update-lib-configs.js index a4c3c7347..ff026eca0 100644 --- a/tools/update-lib-configs.js +++ b/tools/update-lib-configs.js @@ -88,10 +88,10 @@ categories.forEach((category) => { }) // Format files. -async function main() { +async function format() { const linter = new eslint.ESLint({ fix: true }) const report = await linter.lintFiles([ROOT]) eslint.ESLint.outputFixes(report) } -main() +format() diff --git a/tools/update-lib-index.js b/tools/update-lib-index.js index f414c2228..378de4349 100644 --- a/tools/update-lib-index.js +++ b/tools/update-lib-index.js @@ -43,10 +43,10 @@ module.exports = { fs.writeFileSync(filePath, content) // Format files. -async function main() { +async function format() { const linter = new eslint.ESLint({ fix: true }) const report = await linter.lintFiles([filePath]) eslint.ESLint.outputFixes(report) } -main() +format()