Skip to content
Norman Rzepka edited this page Jun 12, 2017 · 4 revisions

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.

Requirements

General

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

eslint-nibble screenshot

The linting config file is named .eslintrc.json and is located in the project root.

Troubleshooting

Lots of import errors

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.

Sublime text

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

Other editors

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.