From 8c3628cc43ce93c197d1f6b749712d2c0b2ebe4e Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Thu, 9 Jun 2022 16:49:21 +0800 Subject: [PATCH] feat: use multiple parsers for more precise check This feature was addded in https://github.com/vuejs/vue-eslint-parser/pull/116 --- index.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f8af6c3..f2e09db 100644 --- a/index.js +++ b/index.js @@ -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 `