ESLint should be used when developing Origami components. It’s useful to have linters run in the background and highlight errors as you’re typing. SublimeLinter and ESLint packages are recommended for Sublime Text and JetBrains IDEs respectively.
If you already have Origami Build Tools (OBT) and ESLint configured, skip to the Installing background linter plugins section.
Ensure you have installed Origami Build Tools. This will provide you with Sass, scss-lint and provide instructions on how to set up Node.js and Ruby.
ESLint isn’t installed automatically installed as part of OBT, so install it with the following command:
npm install -g eslint
You can have an
.eslintrc configuration file per folder. It is recommended to use the Origami global configuration when developing Origami components. We recommend installing the configuration file into your home directory (User directory) to avoid installing it into each individual project folder.
curl -o ~/.eslintrc https://raw.githubusercontent.com/Financial-Times/origami-build-tools/master/config/.eslintrc