Skip to content

Linting

Jaakko Malkki edited this page Sep 25, 2019 · 10 revisions

The project uses automatic code formatting

  • First you need to install Eslint vscode plugin if you are using vscode.
  • Vscode should work as intended and outputs all eslint problems to problems tab. In order to run eslint manually you can type ./node_modules/.bin/eslint . in the the project folder labtool2.0 or backend.
  • Please note that although they are mostly the same, VSCode's 'Format document' is not exactly same as Prettier. Therefore you should always run Prettier before commiting changes.
    • Note: Frontend has git commit hooks for running Prettier before commiting
  • You can do this on VSCode's command palette with ESLint: Fix all auto-fixable problems or you can run ./node_modules/.bin/eslint . --fix to fix the problems.