@@ -31,29 +31,34 @@ $ npm install --save-dev eslint vue-eslint-parser
31
31
```
32
32
33
33
``` bash
34
- $ eslint " src/**.{js,vue}"
34
+ $ eslint " src/**/* .{js,vue}"
35
35
# or
36
36
$ eslint src --ext .vue
37
37
```
38
38
39
39
## :wrench : Options
40
40
41
- ` parserOptions ` is the same as what [ espree] ( https://github.com/eslint/espree#usage ) , the default parser of ESLint, is supporting.
41
+ ` parserOptions ` has the same properties as what [ espree] ( https://github.com/eslint/espree#usage ) , the default parser of ESLint, is supporting.
42
42
For example:
43
43
44
44
``` json
45
45
{
46
46
"parser" : " vue-eslint-parser" ,
47
47
"parserOptions" : {
48
48
"sourceType" : " module" ,
49
- "ecmaVersion" : 2017
50
- // ...
49
+ "ecmaVersion" : 2017 ,
50
+ "ecmaFeatures" : {
51
+ "globalReturn" : false ,
52
+ "impliedStrict" : false ,
53
+ "jsx" : false ,
54
+ "experimentalObjectRestSpread" : false
55
+ }
51
56
}
52
57
}
53
58
```
54
59
55
- On the other hand , you can specify a custom parser to parse ` <script> ` tags.
56
- In this case, specify ` parser ` property. Other properties than ` parser ` would be given to the specified parser.
60
+ Also , you can use ` parser ` property to specify a custom parser to parse ` <script> ` tags.
61
+ Other properties than parser would be given to the specified parser.
57
62
For example:
58
63
59
64
``` json
@@ -67,16 +72,26 @@ For example:
67
72
}
68
73
```
69
74
75
+ ``` json
76
+ {
77
+ "parser" : " vue-eslint-parser" ,
78
+ "parserOptions" : {
79
+ "parser" : " typescript-eslint-parser"
80
+ }
81
+ }
82
+ ```
83
+
70
84
## :warning : Known Limitations
71
85
72
- - Those rules are warning code due to the outside of ` <script> ` tags.
73
- Please disable those rules for ` .vue ` files as necessary.
74
- - [ eol-last] ( http://eslint.org/docs/rules/eol-last )
75
- - [ linebreak-style] ( http://eslint.org/docs/rules/linebreak-style )
76
- - [ max-len] ( http://eslint.org/docs/rules/max-len )
77
- - [ max-lines] ( http://eslint.org/docs/rules/max-lines )
78
- - [ no-trailing-spaces] ( http://eslint.org/docs/rules/no-trailing-spaces )
79
- - [ unicode-bom] ( http://eslint.org/docs/rules/unicode-bom )
86
+ Some rules make warnings due to the outside of ` <script> ` tags.
87
+ Please disable those rules for ` .vue ` files as necessary.
88
+
89
+ - [ eol-last] ( http://eslint.org/docs/rules/eol-last )
90
+ - [ linebreak-style] ( http://eslint.org/docs/rules/linebreak-style )
91
+ - [ max-len] ( http://eslint.org/docs/rules/max-len )
92
+ - [ max-lines] ( http://eslint.org/docs/rules/max-lines )
93
+ - [ no-trailing-spaces] ( http://eslint.org/docs/rules/no-trailing-spaces )
94
+ - [ unicode-bom] ( http://eslint.org/docs/rules/unicode-bom )
80
95
- Other rules which are using the source code text instead of AST might be confused as well.
81
96
82
97
## :newspaper : Changelog
0 commit comments