ota-meshi / typescript-eslint-parser-for-extra-files

An experimental ESLint custom parser for Vue, Svelte, and Astro for use with TypeScript. It provides type information in combination with each framework's ESLint custom parser.
MIT License
45 stars 1 forks source link

`@vue/compiler-sfc` didn't know anything about `vite.config.*` #82

Open n0099 opened 11 months ago

n0099 commented 11 months ago

Before You File a Bug Report Please Confirm You Have Done The Following...

What version of ESLint are you using?

8.56.0

What version of typescript-eslint-parser-for-extra-files are you using?

What did you do?

Configuration https://github.com/n0099/open-tbm/blob/3ac89945c462f35f5400bec45fa9e4e1c26622f3/fe/.eslintrc.cjs#L485 ```js parserOptions: { project: ['./tsconfig.json', './tsconfig.node.json'], tsconfigRootDir: __dirname, }, overrides: [{ // https://stackoverflow.com/questions/57107800/eslint-disable-extends-in-override files: '*.ts', parser: 'typescript-eslint-parser-for-extra-files', settings: { 'import/resolver': { typescript: true } }, }, { files: '*.vue', parser: 'vue-eslint-parser', parserOptions: { parser: 'typescript-eslint-parser-for-extra-files', project: ['./tsconfig.json', './tsconfig.node.json'], tsconfigRootDir: __dirname, }, ```
yarn eslint src --ext .ts,.vue

What did you expect to happen?

Passing my vite.config.ts to @vue/compiler-sfc

plugins: [vue({ script: { defineModel: true } })],

What actually happened?

[@vue/compiler-sfc] defineModel() is an experimental feature and disabled by default.
To enable it, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/n0099/open-tbm/blob/3ac89945c462f35f5400bec45fa9e4e1c26622f3/fe

Additional comments

I suggest adding a parserOptions.viteConfig for allowing user to provide their file path or esm of the vite.config.* like https://github.com/pzmosquito/eslint-import-resolver-vite/issues/12#issuecomment-1858743165.