ComPlat / chemotion_ELN

Electronic Lab Notebook
https://www.chemotion.net
GNU Affero General Public License v3.0
119 stars 46 forks source link

Code Quality: code formatting & linting #615

Open ptrxyz opened 2 years ago

ptrxyz commented 2 years ago

I find that eslint seems to be setup as a linter and code formatter for .js-type files. However it seems there is no linting/code formatting set up for (S)CSS. For that reason, I suggest to enable one.

While there is a wide variety on code formatters and linters for CSS, I would suggest to establish a consistent tool chain for linting and code formatting:

Linters for code quality checking only:

Further, I would advocate to include a .editorconfig file in the git repo to make modern editors "agree" on a common formatting style while editing.

Note: While Ruby seems a bit out of competition here, one could also use the same concept of separating formatting and linting functionality to have a more consistent tool chain for Ruby files too: prettier apply rubocop's formatting settings and replace rubocop as a formatter, leaving it in place as a linter.

NRayya commented 2 years ago

Recommendation: Do the linting on the local level, CI should only throw warnings and block the merging.