specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
66 stars 36 forks source link

Improve ESLint config #3376

Open maxpatiiuk opened 1 year ago

maxpatiiuk commented 1 year ago
melton-jason commented 11 months ago

in our team at Esri, they found more luck in encouraging people to write tests than enforcing people to use certain code style (though tests are still not always written) because people are too opinionated about the code style OR don't care enough about using consistent code style (some people care about shipping features more than having code look a certain way - both sides have their merits).

my personal opinion is that writing code is more fun than writing tests, so if you can use strict ESLint config and strict typing (with TypeScript) to reduce the need for writing tests (while also enforcing higher-quality code), then that's great.

plus, having TypeScript and ESLint catch and report issues before PR is created is great as it reduces PR review time. not to mention many benefits of consistency in the codebase

I would like to spend some time in the coming months improving our ESLint config, after 7.9.4 is out, I would go about fixing all remaining ESLint errors, and enabling 0 ESLint error enforcement in Github action. Important context about this:

  • I would disable/loosen ESLint rules that in the past 2 years have been more of a hindrance/annoyance/noise than actual help

    • example of noise is when we have a linting rule discouraging creating classes, having a linting rule discouraging the use of this is mostly redundant
    • some rules are designed to prevent bugs, that aren't likely to happen thanks to typescript (i.e the rule requiring that each .then() returns something), thus are redundant/hindrance
    • while I liked the "writing-good-comments" eslint rules in theory, they weren't too helpful in practice. I.e resolving the rule about "no passive voice in comments" often required making comments more verbose (or we just ignored the errors suggested by this rule)
  • I would look for more useful rules to enable
  • I would ask for more input and feedback before imposing the rules on others

@melton-jason @CarolineDenis @realVinayak thoughts about all of this?

From https://github.com/specify/specify7/pull/4273#discussion_r1427485477 by @maxpatiiuk