Skip to content

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

Closed
@ota-meshi

Description

@ota-meshi

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions