# ESLint

### Extending the ESLint configuration

By creating a custom ESLint configuration "extension" file in your project's elements source root directory, you can customize the settings and options that the application uses when linting files.

First, create a new Javascript file in your project's root directory. The filename can be of your choosing. (for example, "eslint.js")

Next, you will need to set the "PFWP\_CONFIG\_ESLINT" environment variable in your project's peanut.config.json file to match the name of that extension file you created above:

<pre class="language-json"><code class="lang-json">{
    "PFWP_CONFIG_ESLINT" : "eslint.js"
<strong>}
</strong></code></pre>

Finally, your Javascript file should export a function as the default. The function receives an object as it's parameter. The object that's passed in contains the default ESLint configuration as a property: eslintConfig. The function must return that config object.

You can modify that object within your exported function to change the ESLint configuration. (See example below.)

### Example ESLint custom configuration

{% embed url="<https://gist.github.com/wackycoffee/d7f9e92588e812541cca260e7d92c413>" %}


---

# Agent Instructions: 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:

```
GET https://docs.swplabs.com/peanut-for-wordpress/configuration/eslint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
