Remove unused GlModal directive registrations
What does this MR do and why?
Removes the GlModalDirective import and the directives entry from components whose template has no v-gl-modal.
- Touches 14 components.
- Removing an unused registration does not change behaviour. A directive that no element uses never runs. A mixin whose members are never read only adds an
injector a method nobody calls. - The change was produced by the autofix of the new
local-rules/vue-directive-pairingrule from !256699 (closed), then Prettier ran on the touched files. - The rule MR ships first with its unused-registration half switched off for this kind (
reportUnused: false), because the missing-registration half is what prevents Vue 3 runtime breakage and must not wait. This cleanup can merge in any order relative to the other cleanups. A last MR switches the unused half on once they are all in.
Jest specs of the touched components were not changed. Where a spec still passes createMockDirective or provide: { glFeatures } for a registration that is now gone, the stub is inert. Cleaning those stubs up is left out of this MR on purpose to keep the diff mechanical.
How to set up and validate locally
-
Check out !256699 (closed) on top of this branch, or copy its
tooling/eslint-config/eslint-local-rules/directory andeslint.config.mjsinto your checkout. -
Run ESLint on the touched files:
git diff --name-only origin/master...HEAD | xargs ./node_modules/.bin/eslintNo
local-rules/vue-directive-pairingerror is reported. -
Run the Jest specs of the touched components:
git diff --name-only origin/master...HEAD | sed -E 's#^(ee/)?app/assets/javascripts/#\1spec/frontend/#; s#\.vue$#_spec.js#' | xargs ls 2>/dev/null | xargs yarn jest
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
References
- Related to #629073 (closed), which asks for the pairing rules and for existing violations to be fixed in separate MRs
- Rule MR whose autofix produced this change: !256699 (closed)
- Motivating bug for the rules: !255388 (merged)