Skip to content

feat: add vue-no-undef-components rule

Kev Kloss requested to merge kkloss-add-vue-no-undef-components-rule into main

This MR adds the @gitlab/vue-no-undef-components rule, which under the hood uses vue/no-undef-components but extends it with path-specific ignores. It also changes the messaging a bit.

The reason for this is that the bugs in gitlab-org/gitlab!148425 (merged) (~4 weeks to being fixed) and gitlab-org/gitlab!154930 (merged) (~3 years??) could’ve been avoided by this rule.

Closes gitlab-org/gitlab#464700 (closed)

How to test locally

  1. Checkout gitlab-org/gitlab!154931 (closed)
  2. Run yarn lint:eslint:all
  3. See that there are no errors
  4. In any component, add an undefined component to the template
  5. Run yarn lint:eslint:all (or use your IDE’s built-in eslint)
  6. See that the component reports an error

There might still be an error in ee/app/assets/javascripts/operations/components/dashboard/project.vue. It should be resolved once gitlab-org/gitlab!154930 (merged) is merged.

Edited by Kev Kloss

Merge request reports