eslint-config
eslint-config copied to clipboard
espree template for vue parser
Clear and concise description of the problem
Performance drop when we use Type Aware Rules.
Suggested solution
10 times faster with espree template.
https://github.com/vuejs/vue-eslint-parser#parseroptionsparser
Add "espree" template for vue parser.
languageOptions: {
parser: parserVue,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.vue'],
parser: {
'<template>': 'espree',
'js': parserTs as any,
'ts': options.typescript ? parserTs as any : null,
},
sourceType: 'module',
},
},
I tried to create a PR, but I got a ts error:
src/configs/vue.ts(33,11): error TS2322: Type '{ '<template>': string; js: typeof parserTs; ts: any; }' is not assignable to type 'Parser | undefined'.
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Sure, PR welcome :)