Skip to content

Code Linting Tools

Ashley Watson-Nolan edited this page Dec 14, 2024 · 1 revision

JavaScript Linting – ESLint

We use ESLint to help with formatting and fixing up JavaScript in our repos.

We maintain an extensible ESLint config – eslint-config-pie – which is then used in the PIE and PIE Aperture repos. This config can be used in any application and can be extended as much (or as little) as you like; think of it as a starting point for your application's ESLint usage.

Code editor integration

You can set up your code editor to automatically fix your JavaScript as you write it, based on the ESLint config. This set-up varies based on your code editor.

VSCode

If you use VSCode, you should install the official ESLint VSCode extension. You can then configure how and when you want ESLint to fix any code issues (or just warn) while you are developing locally.

If you would like to have ESLint autofix your code run when you save JS files, you can set the following in your VSCode user config JSON:

"editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
},

CSS/SASS Linting – Stylelint

Clone this wiki locally