qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

WebUI: migrate to ESLint v9

Open Chocobo1 opened this issue 9 months ago • 2 comments

  • WebUI: migrate to ESLint v9
  • WebUI: add linting for regular expressions And applies to following suggestions:
    • Use case-insensitive flag i
    • Use \w for matching characters
    • Sort the regex flags

Chocobo1 avatar May 04 '24 05:05 Chocobo1

@Piccirello I plan to enforce single quotes in webUI in a follow up PR, I mean migrate from double quotes as much as possible. This is to unify the coding style. I don't have strong opinion and a quick web search shows that web devs mostly prefer single quotes. Any comment?

https://eslint.org/docs/latest/rules/quotes The avoidEscape and allowTemplateLiterals will be true of course.

Chocobo1 avatar May 04 '24 07:05 Chocobo1

@Piccirello I plan to enforce single quotes in webUI in a follow up PR, I mean migrate from double quotes as much as possible. This is to unify the coding style. I don't have strong opinion and a quick web search shows that web devs mostly prefer single quotes. Any comment?

https://eslint.org/docs/latest/rules/quotes The avoidEscape and allowTemplateLiterals will be true of course.

I'm personally more familiar with using double quotes in a JS codebase. Either should be fine though if it's enforced via eslint.

Piccirello avatar May 06 '24 19:05 Piccirello