---
title: "Eslint"
description: "To save time spent on unnecessary debugging and to ensure that everyone writes JavaScript in the same general way, we let ESLint check the code."
canonical_url: "https://codex.republic.se/writing-code/eslint"
section: "Pages"
---

# ESLint

To save time spent on unnecessary debugging and to ensure that everyone writes JavaScript in the same general way, we let [ESLint](https://eslint.org/) check the code.

A so-called *linter*, ESLint, helps analyze the code and provides suggestions for things that don't look quite right.

These are installed with `npm install` in each project and controlled by a couple of configuration files in each repository.

## PhpStorm settings

You can also run the following to format with Prettier:

- `⌥ ⌘ L` to manually format the code, and
- `⇧ ⌥⌘ L` to display formatting options.

But also, the option to check "On save" in Prettier, seems to work well if you remember sneaking in a `// prettier-ignore` or `// eslint-disable-next-line xx-xxx` here and there to get what you want.

... Jump to the next "error" by pressing F2.

---

- [ eslint.config.mjs ](/writing-code/eslint/eslintconfigmjs)
