You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lint: report custom directives that nothing registers #171
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.
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.
Activity
JuroOravec commentedon Oct 3, 2026
Related gap to cover with this lint work: literal browser translation calls (
$i18n.tr('id')in component JavaScript and$c-trin templates) are not checked bycitry checkfor a translation that would fall back to another locale, unlike server-sidetr()calls, which now reportcitry.i18n.cross-language-fallbackas a warning. The same rule (and itsLintSettings.rule_i18n_cross_language_fallbacksetting) should apply to them.