Turn on max-len ESLint rule in Frontend
- Dominant language
- JavaScript
- Stars
- 226
- Forks
- 235
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 19
Description
@sadiqkhoja suggested that we turn on the `max-len` ESLint rule. (We would turn on both `max-len` and `vue/max-len`, which are currently both turned off.) The max would be maybe 100 or 110 characters. I'm in favor of that rule change as well.
In the past, we've sometimes needed long lines in the template in order to ensure that text is trimmed. For example:
https://github.com/getodk/central-frontend/blob/da77ddf0c746bc340f1006cb77201736435f09f1/src/components/odata/analyze.vue#L56
Previously, putting `{{ $t('help.microsoft.pageForExcel') }}` on its own line would result in white space on either side of the text. That's an issue in particular for Japanese, where text typically doesn't include space characters. However, I've been noticing that that no longer seems to be the case: the white space is trimmed, at least when the `{{ ... }}` is the only content of the element. (Maybe there was a related change in Vue 3 or Vue CLI?) That means that there's little reason to have long lines like these, so we could turn on `max-len` without having to regularly disable the rule.
We already have a number of long lines, so turning on `max-len` would require changing those lines or disabling the rule for those lines.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.