Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Rule proposal:vue/no-undef-directives #2946

Open
@hoonweiting

Description

@hoonweiting

Please describe what the rule should do:

The rule should warn when a custom directive is used, but not imported. The rule should also accept some kind ofignore option to avoid false positives with globally-registered custom directives.

What category should the rule belong to?

  • Enforces code style (layout)
  • Warns about a potential error (problem)
  • Suggests an alternate way of doing something (suggestion)
  • Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

Should warn on:

<template>  <inputv-focus></template><script setup>// vFocus is not imported or defined anywhere</script>
<template>  <av-sref="someValue"><!-- anchor contents-->  </a></template><script setup>// vSref is not imported or defined anywhere</script>

Should not warn on:

<template>  <inputv-focus></template><script setup>importvFocusfrom'../path/to/vFocus';</script>
<template>  <av-sref="someValue"><!-- anchor contents-->  </a></template><script setup>importvSreffrom'../path/to/vSref';</script>

Additional context

There is a runtime warning in the browser console, but it would be cool if we can catch these issues when linting too.

[Vue warn]: Failed to resolve directive: sref

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp