Skip to content

Commit 8c3628c

Browse files
committedJun 9, 2022
feat: use multiple parsers for more precise check
This feature was addded in vuejs/vue-eslint-parser#116
1 parent c32ab92 commit 8c3628c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed
 

‎index.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
module.exports = {
22
plugins: ['@typescript-eslint'],
3+
34
// Prerequisite `eslint-plugin-vue`, being extended, sets
45
// root property `parser` to `'vue-eslint-parser'`, which, for code parsing,
56
// in turn delegates to the parser, specified in `parserOptions.parser`:
67
// https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error
78
parserOptions: {
8-
parser: require.resolve('@typescript-eslint/parser'),
9+
parser: {
10+
'js': 'espree',
11+
'jsx': 'espree',
12+
13+
'ts': require.resolve('@typescript-eslint/parser'),
14+
'tsx': require.resolve('@typescript-eslint/parser'),
15+
16+
// Leave the template parser unspecified, so that it could be determined by `<script lang="...">`
17+
},
918
extraFileExtensions: ['.vue'],
1019
ecmaFeatures: {
1120
jsx: true
1221
}
1322
},
23+
1424
extends: [
1525
'plugin:@typescript-eslint/eslint-recommended'
1626
],
27+
1728
overrides: [
1829
{
1930
files: ['*.ts', '*.tsx'],

0 commit comments

Comments
 (0)
Please sign in to comment.