-
Notifications
You must be signed in to change notification settings - Fork 23
Javascript linting
A successful linting run (no errors) is a strict requirement for our Jenkins server to build your code, so please adhere to the AirBnB Javascript Style Guide and fix all linting errors before committing code.
- eslint (already included in the package.json)
- eslint plugin for the code editor of your choice
- eslint-nibble (optional)
Ideally you installed the eslint plugin for your code editor and fix all linting errors immediately while writing code.
If you want to do a complete linting run (e.g., before committing), simply issue the command:
yarn lint
If there are lots of linting errors and you want to fix them by category, the eslint-nibble tool works very well:
eslint-nibble app/assets/javascripts
The linting config file is named .eslintrc.json
and is located in the project root.
For some reason the linting plugins don't seem to be good at picking up the correct working directory, which is why in some editors you get lots of import errors.
Add the following to your Project Configuration (Project - Edit Project) and restart Sublime:
"SublimeLinter":
{
"linters":
{
"eslint":
{
"chdir": "${project}/oxalis",
}
}
}
where ${project}/oxalis
should be the path to your oxalis repository.
See https://www.npmjs.com/package/eslint-plugin-import#sublimelinter-eslint
Fixes for other editors should be similar in nature. If you've fixed this for an editor that is not listed here yet, please add it to the wiki page.