Skip to main content

Development

Linting#

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 -a or -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.

rubocop [-a | -x] [paths]
yarn run eslint [--fix] [paths]

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:

yarn run eslint --plugin eslint-plugin-only-warn [--fix] [paths]

There are also Linting extensions for Visual Studio Code available.

Tools recommended for development#

Visual Studio Code#

Vim#

Check https://github.com/dense-analysis/ale.

Webpack#

Debug#

The webpack configurations can be printed out to the node console via:

RAILS_ENV=test node -e 'console.dir(require("config/webpack/test"), { depth: null })'
Last updated on by maipy