Skip to content

Commit f77e346

Browse files
chore(tools): use ESLint class (#1216)
* chore(tools): use ESLint class * build: upgrade types of eslint * refactor: rename function
1 parent dbba30d commit f77e346

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"vue-eslint-parser": "^7.1.0"
6161
},
6262
"devDependencies": {
63-
"@types/eslint": "^6.8.1",
63+
"@types/eslint": "^7.2.0",
6464
"@types/natural-compare": "^1.4.0",
6565
"@types/node": "^13.13.5",
6666
"@typescript-eslint/parser": "^3.0.2",

tools/update-lib-configs.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ categories.forEach((category) => {
8888
})
8989

9090
// Format files.
91-
const linter = new eslint.CLIEngine({ fix: true })
92-
const report = linter.executeOnFiles([ROOT])
93-
eslint.CLIEngine.outputFixes(report)
91+
async function format() {
92+
const linter = new eslint.ESLint({ fix: true })
93+
const report = await linter.lintFiles([ROOT])
94+
eslint.ESLint.outputFixes(report)
95+
}
96+
97+
format()

tools/update-lib-index.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ module.exports = {
4343
fs.writeFileSync(filePath, content)
4444

4545
// Format files.
46-
const linter = new eslint.CLIEngine({ fix: true })
47-
const report = linter.executeOnFiles([filePath])
48-
eslint.CLIEngine.outputFixes(report)
46+
async function format() {
47+
const linter = new eslint.ESLint({ fix: true })
48+
const report = await linter.lintFiles([filePath])
49+
eslint.ESLint.outputFixes(report)
50+
}
51+
52+
format()

0 commit comments

Comments
 (0)