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

Supports for <script setup> and <style> variable injection #1248

Closed
4 tasks done
ota-meshi opened this issue Jul 17, 2020 · 9 comments
Closed
4 tasks done

Supports for <script setup> and <style> variable injection #1248

ota-meshi opened this issue Jul 17, 2020 · 9 comments

Comments

@ota-meshi
Copy link
Member

ota-meshi commented Jul 17, 2020

eslint-plugin-vue should be change to support <script setup> and <style> variable injection.
I will list the work needed to support these on this issue.

These features were released as experimental features in Vue.js 3.0.
So I think that the inclusion or not of the changes listed here will not affect the release of eslint-plugin-vue 7.0.0.


Core

Rules

  • Add vue/valid-define-props rule #1560 Add no-refer-vars-script-setup-define-props rule that disallows referencing variables in defineProps() of <script setup>.
  • Add vue/valid-define-emits rule #1561 Add no-refer-vars-script-setup-define-emit rule that disallows referencing variables in defineEmit() of <script setup>.
  • Add vue/no-export-in-script-setup rule #1559 Add no-export-in-script-setup rule that disallows ES export in <script setup>.
  • Change no-parsing-error rule to reports parsing errors in <script setup="...">.
  • Change no-parsing-error rule to reports parsing errors in <style vars="...">.
  • Add valid-script-setup rule that checks whether <script setup="..."> is valid arguments.
  • Add valid-style-vars rule that checks whether <style vars="..."> is valid expression.
  • Add no-vars-setup-export-default rule that disallows referencing variables in export default of <script setup>.
  • more

vuejs/rfcs#227
https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md
vuejs/rfcs#231
https://github.com/vuejs/rfcs/blob/style-vars-2/active-rfcs/0000-sfc-style-variables.md

https://github.com/vuejs/rfcs/blob/sfc-improvements/active-rfcs/0000-sfc-script-setup.md
https://github.com/vuejs/rfcs/blob/sfc-improvements/active-rfcs/0000-sfc-style-variables.md

@ux-engineer

This comment has been minimized.

@ux-engineer

This comment has been minimized.

@steffchep

This comment has been minimized.

@ota-meshi

This comment has been minimized.

@ota-meshi ota-meshi changed the title Supports for <script setup> and <style vars> Supports for <script setup> and <style> variable injection Dec 4, 2020
@mellester
Copy link

mellester commented Jun 15, 2021

image

not sure if this is they correct issues to comment on or if I should move this to a separate issue.

My problem is I have a <script setup async> block and I get parsing errors if I use the 'await' keyword.
Edit:Spelling

@ota-meshi
Copy link
Member Author

As you can see from the fact that this issue has not been resolved, eslint-plugin-vue does not yet support <script setup>.

@yyx990803
Copy link
Member

The RFC has been finalized and we should start working on this!

@ota-meshi
Copy link
Member Author

I started working on it 😉

@ota-meshi
Copy link
Member Author

As far as I know, I think I have done the work needed to support <script setup>. Also, regarding <style> variable injection, I don't think there is any work required for eslint-plugin-vue in the new RFC. So I will close this issue.

If you have any issues related to these, and new rule suggestions, please open a new issue.

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

No branches or pull requests

5 participants