# vue/experimental-script-setup-vars

prevent variables defined in <script setup> to be marked as undefined

  • 🚫 This rule was removed in eslint-plugin-vue v9.0.0.

This rule will find variables defined in <script setup="args"> and mark them as defined variables.

This rule only has an effect when the no-undef rule is enabled.


<script setup="args"> syntax was rejected by Vue's RFC. Check out the new syntax (opens new window).

# 📖 Rule Details

Without this rule this code triggers warning:

<script setup="props, { emit }"> import { watchEffect } from 'vue' watchEffect(() => console.log(props.msg)) emit('foo') </script>
Now loading...

After turning on, props and emit are being marked as defined and no-undef rule doesn't report an issue.

# 🚀 Version

This rule was introduced in eslint-plugin-vue v7.0.0

# 🔍 Implementation

Last Updated: 5/12/2022, 11:57:47 AM