Skip to content

vue/no-restricted-call-after-await for <script setup> and globally available composables. #2117

Open
@germanfr

Description

@germanfr

What rule do you want to change?
vue/no-restricted-call-after-await

Does this change cause the rule to produce more or fewer warnings?
More

How will the change be implemented? (New option, new default behavior, etc.)?
This rule currently works only in the setup function of the options API, but it's not working in <script setup>.
Also it's not possible to turn it on for globally available composables which are automatically imported. The module option is required.
Also, it would be great if the rule worked in any composable function, not just inside setup.

Please provide some example code that this change will affect:

<script setup>
await whatever();

const app = useNuxtApp();
</script>

What does the rule currently do for this code?
Nothing

What will the rule do after it's changed?
Display a warning or an error for the usage of the globally available composable useNuxtApp after the await inside <script setup>

Additional context

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