Skip to content

Commit

Permalink
fix: upgrade eslint to v5 (#298)
Browse files Browse the repository at this point in the history
* fix: upgrade eslint to v5

N.b. needs to manually run patterns to lint through the glob module
before linting until eslint/eslint#10587 is resolved.

* chore: swap glob for globby
  • Loading branch information
achingbrain authored and hugomrdias committed Nov 21, 2018
1 parent a491376 commit 8a3e9cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
"detect-node": "^2.0.4",
"documentation": "^9.0.0-alpha.1",
"es6-promisify": "^6.0.1",
"eslint": "^4.19.0",
"eslint-config-standard": "^11.0.0",
"eslint": "^5.9.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"execa": "^1.0.0",
"filesize": "^3.6.1",
"findup-sync": "^2.0.0",
"fs-extra": "^7.0.0",
"gh-pages": "^2.0.1",
"git-validate": "^2.2.4",
"glob": "^7.1.3",
"globby": "^8.0.1",
"joi": "^14.0.1",
"json-loader": "~0.5.7",
"karma": "^3.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const CLIEngine = require('eslint').CLIEngine
const path = require('path')
const formatter = CLIEngine.getFormatter()
const userConfig = require('./config/user')
const globby = require('globby')

const FILES = [
'*.js',
Expand Down Expand Up @@ -69,15 +70,16 @@ function checkDependencyVersions () {
}

function runLinter (opts = {}) {
return new Promise((resolve, reject) => {
return new Promise(async (resolve, reject) => {
const cli = new CLIEngine({
useEslintrc: true,
baseConfig: require('./config/eslintrc'),
fix: opts.fix
})

const config = userConfig()
const files = (config.lint && config.lint.files) || FILES
const patterns = (config.lint && config.lint.files) || FILES
const files = await globby(patterns)
const report = cli.executeOnFiles(files)

console.log(formatter(report.results))
Expand Down

0 comments on commit 8a3e9cd

Please sign in to comment.