Draft: Update to @gitlab/eslint-plugin@6
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:
- The vue/one-component-per-file rule finds what seems to be only false positives in this codebase.
- 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 topropsData
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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done