Skip to content
Splines edited this page Dec 19, 2023 · 19 revisions

Linting

  • MaMpf is written in Ruby on Rails. We have some custom linting rules you can find in rubocop.yml.
  • We have some more linters available, e.g. with recommended extensions in VSCode. TODO: refer to justfile with many commands
  • All our available linters will check for code style guideline violations in every PR.

Setup ESLint

We use ESLint to lint .js and .js.erb files. In our CI/CD, we check for style guideline violations, so make sure to always submit already linted code. If you don't use VSCode, you can use the command line, i.e. yarn run eslint --fix ./your-file.js, or the respective ESLint extension/plugin in other IDEs. We provide the respective config file in the project root (.eslintrc.js).

Use ESLint in VSCode

  1. Install the ESLint extension on the marketplace (filter for the recommended extensions we set up).
  2. Install the necessary node modules: yarn install (this includes the eslint npm package and some other related packages that are necessary).
  3. Open any .js or .js.erb file, change something (e.g. remove a semicolon) and save the file. ESLint will automatically lint it. You can also use the `Format Document´ command in the command palette.

Troubleshooting

  • Try to run the ESLint: Restart ESLint Server command.
  • See the output of the plugin in the Output pane (choose "ESLint" in the dropdown).

Code structure

Some overviews over the (fairly big) MaMpf code base.

  • Annotation tool & Thyme player (frontend): Thyme overview
  • Suggestions for Just:
    • Rails Sandbox
Clone this wiki locally