Skip to content

Add eslint rule preventing delete method for Vue 3

Alexander Turinske requested to merge add-eslint-for-delete into master

What does this MR do and why?

Add eslint rule preventing delete method for Vue 3

  • prevent delete method from this, vm, and Vue
  • from the Vue 3 migration docs, Global functions set and delete, and the instance methods $set and $delete. They are no longer required with proxy-based change detection.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

After
Screenshot_2024-08-07_at_12.22.08

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Apply the following patch
diff --git a/ee/app/assets/javascripts/security_orchestration/components/policies/list_component.vue b/ee/app/assets/javascripts/security_orchestration/components/policies/list_component.vue
index 26c1b7876b59..0aa7930c0ddf 100644
--- a/ee/app/assets/javascripts/security_orchestration/components/policies/list_component.vue
+++ b/ee/app/assets/javascripts/security_orchestration/components/policies/list_component.vue
@@ -211,6 +211,9 @@ export default {
 
       if (this.shouldUpdatePolicyList) {
         this.$emit('cleared-selected');
+        this.$delete();
+        vm.$delete();
+        Vue.delete();
       }
     },
     convertFilterValue(defaultValue, value) {
  1. Run node scripts/frontend/eslint.js ee/app/assets/javascripts/security_orchestration/components/policies/list_component.vue
  2. Verify errors appear
Edited by Alexander Turinske

Merge request reports

Loading