Skip to content

Vue files: Exclude css properties in computed methods

Noticed a lint error is being reported for computed css properties in when i enable .vue files: app/assets/javascripts/vue_shared/components/stacked_progress_bar.vue

I think we might need a little regex to check for css declarations. Additionally, the getTooltip functions content should probably be externalized.

I'm just wondering if maybe we should provide warnings instead of errors on all possibly externalizable strings in computed methods?

...
  methods: {
    ...
    barStyle(percent) {
      return `width: ${percent}%;`; // Should not have non i18n stringseslint(@gitlab/i18n/no-non-i18n-strings)
    },
    getTooltip(label, count) {
      return `${label}: ${count}`; // Not erroring
    },
  },
...
Edited by Ezekiel Kigbo