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

Missing scopes when parsing <script> with custom parser #228

Open
4 tasks done
DMartens opened this issue Mar 26, 2024 · 0 comments
Open
4 tasks done

Missing scopes when parsing <script> with custom parser #228

DMartens opened this issue Mar 26, 2024 · 0 comments

Comments

@DMartens
Copy link

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?

8.57.0

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

  • vue-eslint-parser@9.4.2
  • eslint-plugin-vue: irrelevant

What did you do?

Configuration
import * as vue from 'vue-eslint-parser';

export default [{
	languageOptions: {
		parser: vue,
		parserOptions: { parser: { ts: '@typescript-eslint/parser' } }
	}
}]
<script setup lang="ts">
function fn() {}
</script>

What did you expect to happen?

There is a child scope for the function declaration nested in the module scope.

What actually happened?

The module scope has no child scopes.

Link to Minimal Reproducible Example

https://github.com/DMartens/vue-eslint-parser-script-custom-parser-scope

Additional comments

This only happens when using a custom parser via the lang attribute.

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

No branches or pull requests

1 participant