Skip to content

Commit b81d11e

Browse files
committed
fix: also lint nested js files starting with dot
1 parent 6bdf704 commit b81d11e

File tree

1 file changed

+16
-2
lines changed
  • packages/@vue/cli-plugin-eslint

1 file changed

+16
-2
lines changed

packages/@vue/cli-plugin-eslint/lint.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,35 @@ const renamedArgs = {
1515
config: 'configFile'
1616
}
1717

18+
const defaultFilesToLint = [
19+
'src',
20+
'tests',
21+
// root config files
22+
'*.js',
23+
// .eslintrc files (ignored by default)
24+
'.*.js',
25+
'{src,tests}/**/.*.js'
26+
]
27+
1828
module.exports = function lint (args = {}, api) {
1929
const path = require('path')
2030
const cwd = api.resolve('.')
2131
const { CLIEngine } = require('eslint')
2232
const { log, done, exit, chalk } = require('@vue/cli-shared-utils')
23-
24-
const files = args._ && args._.length ? args._ : ['src', 'tests', '*.js', '.*.js']
2533
const extensions = require('./eslintOptions').extensions(api)
34+
2635
const argsConfig = normalizeConfig(args)
2736
const config = Object.assign({
2837
extensions,
2938
fix: true,
3039
cwd
3140
}, argsConfig)
41+
3242
const engine = new CLIEngine(config)
43+
const files = args._ && args._.length
44+
? args._
45+
: defaultFilesToLint
46+
3347
const report = engine.executeOnFiles(files)
3448
const formatter = engine.getFormatter(args.format || 'codeframe')
3549

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy