feat: add vue-no-interactive-content-in-tooltip rule
What does this MR do?
Adds the new @gitlab/vue-no-interactive-content-in-tooltip rule and enables it as warn in the shared vue config.
Closes #98 (closed) (parent epic: gitlab-org#23976 (closed))
The rule reports any interactive descendant of <gl-tooltip> / <GlTooltip> and recommends GlPopover instead, with a link to https://design.gitlab.com/components/tooltip/#when-not-to-use. A descendant counts as interactive when it is:
a,button,input,select,textarea,gl-link/GlLink,gl-button/GlButton,router-link/RouterLink,help-page-link/HelpPageLink- an element with a static
tabindex, or one bound with:tabindex/v-bind:tabindex - an element with a
@click/v-on:clicklistener, with or without modifiers
Verification
The npm registry was blocked (403) in the agent environment, so nothing could be installed or run locally. lib/plugin.js and docs/rules.md were updated by hand. Everything was verified in the pipeline instead (https://gitlab.com/gitlab-org/frontend/eslint-plugin/-/pipelines/2927402423):
-
test(yarn lint+yarn test): passed, including all 27 RuleTester cases for the new rule. -
ensure updated files: passed, so the hand-edited generated files matchyarn update. -
test-on-design-system: passed. -
test-on-gitlab(allow_failure): failed with 0 errors and 4 warnings, all from the new rule. That job runs with--max-warnings 0. The four findings ingitlab-org/gitlaball look like real violations:app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue:249:<help-page-link>app/assets/javascripts/packages_and_registries/container_registry/explorer/components/delete_button.vue:54:<gl-link>inside a<gl-sprintf>slotee/app/assets/javascripts/ai/shared/widgets/repository_required_button.vue:64:<gl-link>ee/app/assets/javascripts/analytics/dashboards/ai_impact/components/metric_table.vue:511:<gl-link>
These need to be migrated to
GlPopoveror baselined ingitlab-org/gitlabbefore (or when) this version is adopted there. The plan says the downstream issue gitlab-org/gitlab#632794 (closed) handles the baseline and the later move toerror.