Skip to content

vue/no-restricted-call-after-await

disallow asynchronously called restricted methods

📖 Rule Details

This rule reports your restricted calls after the await expression. In setup() function, you need to call your restricted functions synchronously.

🔧 Options

This rule takes a list of objects, where each object specifies a restricted module name and an exported name:

json5
{
  "vue/no-restricted-call-after-await": ["error",
    { "module": "vue-i18n", "path": "useI18n" },
    { ... } // You can specify more...
  ]
}
Now loading...

The following properties can be specified for the object.

  • module ... Specify the module name.
  • path ... Specify the imported name or the path that points to the method.
  • message ... Specify an optional custom message.

For examples:

json5
{
  "vue/no-restricted-call-after-await": ["error",
    { "module": "a", "path": "foo" },
    { "module": "b", "path": ["bar", "baz"] },
    { "module": "c" }, // Checks the default import.
    { "module": "d", "path": "default" }, // Checks the default import.
  ]
}
Now loading...

🚀 Version

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

🔍 Implementation