Skip to content

Lint: report custom directives that nothing registers #171

Open

Description

@JuroOravec

Problem

A component template that uses a custom directive nobody registers (for example a misspelled v-tooltipp) now stops the page's Vue app with a clear error. But the error only appears when the template that uses the directive actually renders in the browser. A misspelled directive inside a v-if branch that rarely shows stays hidden until a user reaches that branch.

Why it isn't caught earlier

The compiler sees every directive name a template uses, but it can't know what Vue plugins will register in the browser: Citry.vue.use(plugin) runs in a page script, and a plugin's install(app) can call app.directive(...) with any name.

Proposal

Add a citry check and editor rule that reports a custom directive no known source registers:

  • the component's own directives option in its $component({...});
  • Citry's built-in directives;
  • a list of globally registered directive names that the project declares (for example a setting such as vue_global_directives=("tooltip", "autofocus")), since Citry can't read browser plugins.

Default severity: warning, so projects that register directives in ways Citry can't see aren't blocked.

Activity

  1. JuroOravec commented on Oct 3, 2026

    @JuroOravec
    MemberAuthor

    Related gap to cover with this lint work: literal browser translation calls ($i18n.tr('id') in component JavaScript and $c-tr in templates) are not checked by citry check for a translation that would fall back to another locale, unlike server-side tr() calls, which now report citry.i18n.cross-language-fallback as a warning. The same rule (and its LintSettings.rule_i18n_cross_language_fallback setting) should apply to them.

  2. added
    next-sprint
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions