Skip to content

Commit

Permalink
chore(tools): use ESLint class (#1216)
Browse files Browse the repository at this point in the history
* chore(tools): use ESLint class

* build: upgrade types of eslint

* refactor: rename function
  • Loading branch information
tyankatsu0105 committed Jun 26, 2020
1 parent dbba30d commit f77e346
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand Down
10 changes: 7 additions & 3 deletions tools/update-lib-configs.js
Expand Up @@ -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 format() {
const linter = new eslint.ESLint({ fix: true })
const report = await linter.lintFiles([ROOT])
eslint.ESLint.outputFixes(report)
}

format()
10 changes: 7 additions & 3 deletions tools/update-lib-index.js
Expand Up @@ -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 format() {
const linter = new eslint.ESLint({ fix: true })
const report = await linter.lintFiles([filePath])
eslint.ESLint.outputFixes(report)
}

format()

0 comments on commit f77e346

Please sign in to comment.