Skip to content

Draft: Update to @gitlab/eslint-plugin@6

Mark Florian requested to merge upgrade-eslint-plugin into master

What does this MR do?

This updates to @gitlab/eslint-plugin@6, which includes breaking changes via the transitive dependency eslint-plugin-vue being upgraded from v6 to v7.

This adds/improves various lint rules of Vue files; the full changes are documented in their release post. The most notable addition is the vue/no-mutating-props rule, which can help to prevent subtle runtime bugs.

For several of the new/changed rules, the GitLab codebase has a number of violations. Rather than fixing all of them in this change, those new rules are disabled (e.g., vue/no-mutating-props), and the change rules are reconfigured to mimic v6 settings (e.g., vue/order-in-components). This way, these can be addressed/fixed separately in follow ups.

Otherwise, one-off violations, (e.g., of vue/require-render-return) have been fixed here.

There were a few odd findings during this process that might suggest upstream bugs:

  1. The vue/one-component-per-file rule finds what seems to be only false positives in this codebase.
  2. Three rules were violated by the line spec/frontend/clusters/components/applications_spec.js:547: @gitlab/vue-require-required-key, vue/require-default-prop and vue/require-prop-type-constructor. This is odd, because no Vue component was being defined or constructed there. Changing a props field to propsData resolved all three.

Addresses #296868 (closed), part of &5142.

Draft

Marked as draft since @gitlab/eslint-plugin@6 hasn't been released yet.

Screenshots (strongly suggested)

n/a

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Mark Florian

Merge request reports