[go: up one dir, main page]

Skip to content

Address vue/no-unused-properties violations in app/assets/javascripts/diffs/

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The following files violate the vue/no-unused-properties ESLint rule:

  • app/assets/javascripts/diffs/components/app.vue
  • app/assets/javascripts/diffs/components/diff_content.vue
  • app/assets/javascripts/diffs/components/diff_expansion_cell.vue
  • app/assets/javascripts/diffs/components/diff_file.vue
  • app/assets/javascripts/diffs/components/diff_file_header.vue
  • app/assets/javascripts/diffs/components/diff_line_note_form.vue
  • app/assets/javascripts/diffs/components/diff_row.vue
  • app/assets/javascripts/diffs/components/diff_view.vue
  • app/assets/javascripts/diffs/components/image_diff_overlay.vue

Please review the violations and either address them or add a reason for disabling them.

Implementation plan

  • Remove the files from the .eslint_todo/vue-no-unused-properties.mjs todo file.

  • Go through each violation in the files.

    Important

    Keep in mind that vue/no-unused-properties reports properties and methods that are not used within the component they are defined in. These might still be used in the parent component or elsewhere in the codebase so you'll want to make sure the offenses are true-positives before addressing them.

  • If the violation is a false-positive, you have two options:

    • If the property or method is part of the component's public API (eg it is being called from outside of the component), you'll want to flag it as such using the expose property:

      export default {
        // ...
        expose: ['show'],
        methods: {
          show() {
            this.$refs.modal.show();
          },
        }
      }
    • If the property or method is used implicitly (eg via a mixin or component inheritance), ignore the violation inline along with a reason for why it needs to be ignored, eg:

      export default {
        // ...
        computed: {
          // eslint-disable-next-line vue/no-unused-properties -- tracking() is used by the `Tracking` mixin
          tracking() {
            return {/* ... */};
          },
        }
      }
  • If the violation is a true-positive, delete the offending property or method.

Support contact: @pgascouvaillancourt

Edited by Tsveti Popova