> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/project-zero/django/project-structure/eslint-rules.md).

# ESLint Rules

Project Zero uses a set of ESLint rules which extends upon the "eslint:recommended" rule set. These rules are marked by a checkmark at <https://eslint.org/docs/rules/> . Keep in mind that ESLint might change these at any time. You can see the extended rules in `/templates/.eslintrc.js`.

Most of these added rules are from [Best Practices](https://eslint.org/docs/rules/#best-practices), [Stylistic Issues](https://eslint.org/docs/rules/#stylistic-issues) and [ECMAScript 6](https://eslint.org/docs/rules/#ecmascript-6) sections. The main goal here is to have a base set of rules that prevents some common issues and improve code readability without restricting the developer too much.

Since we use '@babel/eslint-parser' as parser, you should make sure that you're using Node.js version 14+.

To make sure ESLint is properly configured in the project and its rules are applied correctly, there is a "pre-commit" git hook. With it, no code that doesn't pass linting will be pushed to production. Of course, it is possible for developers to use "eslint-disable" statements and these should be caught and questioned during code review.

To help find and fix possible linting errors on project basis, there are 2 npm scripts: `npm run lint` and `npm run lint:fix`.

```
"lint": "eslint .", // Lint project
"lint:fix": "eslint . --fix" // Lint project and fix auto-fixable issues
```

If you're using Visual Studio Code, following setup is recommended:

1 - Plugin: [VS Code ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)

2 - Settings:

```
{
 // Auto-fix problems on file save
 "editor.codeActionsOnSave": {
     "source.fixAll.eslint": true
 },
 // Make sure it's looking at the correct directory
 "eslint.workingDirectories": ["./templates"],
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.akinon.com/technical-guides/project-zero/django/project-structure/eslint-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
