For linting/formatting code RuboCop and ESLint are used. They can be used with the following commands from inside a Chemotion ELN installation directory. The flags
-x for rubocop and
--fix for ESLint are for correcting and therefore changing the code. Without the flags errors or warnings are just displayed, but without changes to the code.
When ESLint detects some linting errors in the files, it finishes by default with exit code 1. This can be lead to an overall execution in some environments (e. g. inside GitHub Actions). To avoid this the eslint-plugin-only-warn can be added via yarn which returns warnings instead of errors. It needs also to be added with a flag in the ESLint command:
There are also Linting extensions for Visual Studio Code available.
Install Visual studio code with linters set up (ESLint and RuboCop):
Install version control extension
The webpack configurations can be printed out to the node console via: