vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 666 forks source link

feat: export parser #2506

Closed Shyam-Chen closed 4 months ago

Shyam-Chen commented 4 months ago
// eslint.config.js
import typescriptEslint from 'typescript-eslint';
import eslintPluginVue from 'eslint-plugin-vue';

export default [
  {
    languageOptions: {
      parser: eslintPluginVue.parser, // <-
      parserOptions: {
        parser: typescriptEslint.parser,
        sourceType: 'module',
        extraFileExtensions: ['.vue'],
      },
    },
  },
  // ...
];
ota-meshi commented 4 months ago

This plugin will not work if you set only the parser. Use *.configs["flat/base"]. https://eslint.vuejs.org/user-guide/#bundle-configurations-eslint-config-js If you only want the parser, just import vue-eslint-parser.