eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

espree template for vue parser

Open GaborTorma opened this issue 1 year ago • 1 comments

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.

GaborTorma avatar Oct 23 '23 16:10 GaborTorma

Sure, PR welcome :)

antfu avatar Oct 24 '23 03:10 antfu