vuejs/vue-eslint-parser

When two `script` sections are present in SFC, some typescript-eslint rules do not work correctly in `script setup` section

Opened this issue · 0 comments

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

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

9.34.0

What version of eslint-plugin-vue and vue-eslint-parser are you using?

  • vue-eslint-parser@10.2.0
  • eslint-plugin-vue not used

What did you do?

If both <script setup> and <script> sections are present in SFC, some rules from at least typescript-eslint ESLint plugin start reporting less problems, but only in <script setup> section. <script> section shouldn't even contain anything for this problem to arise.

Some affected rules:

What did you expect to happen?

Other ESLint plugins receive correct information about SFC source code.

What actually happened?

They seemingly do not.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/vitejs-vite-2vzrvkgc

Run npx eslint and observe that many problems from <script setup> block are not reported (expected: 8, actual: 5).

Comment out <script> section, run npx eslint again and problems will be reported.

Additional comments

No response