Skip to content

Commit

Permalink
fix: also lint nested js files starting with dot
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 18, 2018
1 parent 6bdf704 commit b81d11e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions packages/@vue/cli-plugin-eslint/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,35 @@ const renamedArgs = {
config: 'configFile'
}

const defaultFilesToLint = [
'src',
'tests',
// root config files
'*.js',
// .eslintrc files (ignored by default)
'.*.js',
'{src,tests}/**/.*.js'
]

module.exports = function lint (args = {}, api) {
const path = require('path')
const cwd = api.resolve('.')
const { CLIEngine } = require('eslint')
const { log, done, exit, chalk } = require('@vue/cli-shared-utils')

const files = args._ && args._.length ? args._ : ['src', 'tests', '*.js', '.*.js']
const extensions = require('./eslintOptions').extensions(api)

const argsConfig = normalizeConfig(args)
const config = Object.assign({
extensions,
fix: true,
cwd
}, argsConfig)

const engine = new CLIEngine(config)
const files = args._ && args._.length
? args._
: defaultFilesToLint

const report = engine.executeOnFiles(files)
const formatter = engine.getFormatter(args.format || 'codeframe')

Expand Down

0 comments on commit b81d11e

Please sign in to comment.