Skip to content

Commit

Permalink
feat: use multiple parsers for more precise check
Browse files Browse the repository at this point in the history
This feature was addded in vuejs/vue-eslint-parser#116
  • Loading branch information
haoqunjiang committed Jun 9, 2022
1 parent c32ab92 commit 8c3628c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
module.exports = {
plugins: ['@typescript-eslint'],

// Prerequisite `eslint-plugin-vue`, being extended, sets
// root property `parser` to `'vue-eslint-parser'`, which, for code parsing,
// in turn delegates to the parser, specified in `parserOptions.parser`:
// https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error
parserOptions: {
parser: require.resolve('@typescript-eslint/parser'),
parser: {
'js': 'espree',
'jsx': 'espree',

'ts': require.resolve('@typescript-eslint/parser'),
'tsx': require.resolve('@typescript-eslint/parser'),

// Leave the template parser unspecified, so that it could be determined by `<script lang="...">`
},
extraFileExtensions: ['.vue'],
ecmaFeatures: {
jsx: true
}
},

extends: [
'plugin:@typescript-eslint/eslint-recommended'
],

overrides: [
{
files: ['*.ts', '*.tsx'],
Expand Down

0 comments on commit 8c3628c

Please sign in to comment.