Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

espree template for vue parser #294

Open
3 tasks done
GaborTorma opened this issue Oct 23, 2023 · 1 comment
Open
3 tasks done

espree template for vue parser #294

GaborTorma opened this issue Oct 23, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@GaborTorma
Copy link

GaborTorma commented Oct 23, 2023

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

@GaborTorma GaborTorma added the enhancement New feature or request label Oct 23, 2023
@antfu
Copy link
Owner

antfu commented Oct 24, 2023

Sure, PR welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants