File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
packages/@vue/cli-plugin-eslint Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -15,21 +15,35 @@ const renamedArgs = {
15
15
config : 'configFile'
16
16
}
17
17
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
+
18
28
module . exports = function lint ( args = { } , api ) {
19
29
const path = require ( 'path' )
20
30
const cwd = api . resolve ( '.' )
21
31
const { CLIEngine } = require ( 'eslint' )
22
32
const { log, done, exit, chalk } = require ( '@vue/cli-shared-utils' )
23
-
24
- const files = args . _ && args . _ . length ? args . _ : [ 'src' , 'tests' , '*.js' , '.*.js' ]
25
33
const extensions = require ( './eslintOptions' ) . extensions ( api )
34
+
26
35
const argsConfig = normalizeConfig ( args )
27
36
const config = Object . assign ( {
28
37
extensions,
29
38
fix : true ,
30
39
cwd
31
40
} , argsConfig )
41
+
32
42
const engine = new CLIEngine ( config )
43
+ const files = args . _ && args . _ . length
44
+ ? args . _
45
+ : defaultFilesToLint
46
+
33
47
const report = engine . executeOnFiles ( files )
34
48
const formatter = engine . getFormatter ( args . format || 'codeframe' )
35
49
You can’t perform that action at this time.
0 commit comments