i18n linters - ESLint Vue

Part of https://gitlab.com/gitlab-org/manage/issues/20

We can lint for unwrapped strings (in simple/common cases) in Vue files using ESLint and the eslint-plugin-vue package.

  • We should autofix as many cases using the linter as we can and this should be split across many MRs to allow for easy manual review.

  • We should use danger Add ESLint rules to enforce externalization in the changes of a branch going forward.

  • We should generate a list of cases that can't be autofixed to be worked through manually or to have autofix functionality written for them.

After reading the issue tracker it seems other contributors to the plugin also want a no-bare-strings rule. Started in lbennett/eslint-plugin-vue!1 (closed). Still needs autofix functionality and needs to be verified against our codebase instead of just test cases.

Steps taken

  • Configure vue-i18n for gitlab
    • Allow configurable externalization function
    • Create no-bare-strings rule for vue-i18n
    • Update vue-i18n to support .po/.pot files
    • Add autofixing capability
    • Test plugin on gitlab
  • Lint gitlab
    • gitlab-ce#63457 Autofix gitlab repo
    • gitlab-ce#63458 Log issues for non-autofixable lints (#29604)
  • gitlab-ce#63560 Integrate vue-i18n plugin into gitlab
    • Publish eslint-plugin-vue-i18n
    • https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31124/diffs?commit_id=d46af03ef3eacbeb858e4fde67cb4e4bf8412811 Apply to master
    • https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14929 Apply to EE master
    • https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31124/diffs?commit_id=f418214deccbdd9178c5582156a378cde2a94def eslint-disable all the outstanding lint errors that were not autofixed
Edited Sep 01, 2020 by Haris Delalić
Assignee Loading
Time tracking Loading