> For the complete documentation index, see [llms.txt](https://paazmaya.gitbook.io/modern-web-tools-with-node-js/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paazmaya.gitbook.io/modern-web-tools-with-node-js/quizzes/eslint.md).

# ESLint

ESLint is used to

|                              | yes  | no   |
| ---------------------------- | ---- | ---- |
| `compile JavaScript`         | \[ ] | \[x] |
| `check style issues`         | \[x] | \[ ] |
| `to detect unused variables` | \[x] | \[ ] |
| `measure code complexity`    | \[ ] | \[x] |
| `to detect division by zero` | \[x] | \[ ] |
| `enforce coding conventions` | \[x] | \[ ] |
| `measure test coverage`      | \[ ] | \[x] |

> ESLint performs static analysis of source code. See [ESLint.org](http://eslint.org/)

How do you install ESLint globally?

|                         | yes  | no   |
| ----------------------- | ---- | ---- |
| `install eslint`        | \[ ] | \[x] |
| `npm install eslint`    | \[ ] | \[x] |
| `npm install eslint -g` | \[x] | \[ ] |

> If you’re installing something that you want to use in your shell, on the command line or something, install it globally, so that its binaries end up in your PATH environment variable: `npm install eslint -g`

Which configuration options should be selected, if you want to set

* as errors: missing semicolon, empty block statements and use of constant expressions in conditions
* as warnings: whitespace at the end of line, mixed spaces and tabs for indentation (Smart Tabs off) and disallow labels that share a name with a variable
* other possible options off

|                                           | yes  | no   |
| ----------------------------------------- | ---- | ---- |
| `"semi": 1,`                              | \[ ] | \[x] |
| `"semicolon": 2,`                         | \[ ] | \[x] |
| `"semi": 2,`                              | \[x] | \[ ] |
| `"no-empty": 2,`                          | \[x] | \[ ] |
| `"no-empty": 1`                           | \[ ] | \[x] |
| `"no-empty-class": 1`                     | \[ ] | \[x] |
| `"no-constant-condition": 1,`             | \[ ] | \[x] |
| `"no-constant-condition": 2,`             | \[x] | \[ ] |
| `"no-trailing-spaces": 1,`                | \[x] | \[ ] |
| `"no-trailing-spaces": 2,`                | \[ ] | \[x] |
| `"no-plusplus": 2,`                       | \[ ] | \[x] |
| `"no-plusplus": 1,`                       | \[ ] | \[x] |
| `"no-mixed-spaces-and-tabs": [1, false],` | \[x] | \[ ] |
| `"no-mixed-spaces-and-tabs": [1, true],`  | \[ ] | \[x] |
| `"no-mixed-spaces-and-tabs": [2, false],` | \[ ] | \[x] |
| `"no-label-var": 1,`                      | \[x] | \[ ] |
| `"no-label-var": 2,`                      | \[ ] | \[x] |

> Hey, let's be careful out there!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://paazmaya.gitbook.io/modern-web-tools-with-node-js/quizzes/eslint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
