---
title: "nuxt-backend/eslint"
description: "The ESLint preset for a nuxt-backend app: the official Convex lint rules, scoped to the functions directory, with Convex's generated code ignored."
canonical_url: "https://nuxt-backend.dev/docs/reference/api/eslint"
---
# nuxt-backend/eslint

The ESLint preset for a `nuxt-backend` app: the official Convex lint rules,
scoped to the functions directory, with Convex's generated code ignored.

Needs `@convex-dev/eslint-plugin` installed next to it (an optional peer).

## Example

```js
// eslint.config.mjs
import withNuxt from './.nuxt/eslint.config.mjs'
import { backendEslint } from 'nuxt-backend/eslint'

export default withNuxt(backendEslint())
```

## Interfaces

### BackendEslintOptions

Defined in: [src/eslint.ts](https://github.com/qruto/nuxt-backend/blob/main/src/eslint.ts)

Options of [backendEslint](#backendeslint).

#### Properties

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default value
    </th>
    
    <th>
      Description
    </th>
    
    <th>
      Defined in
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a id="functionsdir">
        
      </a>
      
       <code>
        functionsDir?
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <code>
        'backend'
      </code>
    </td>
    
    <td>
      The functions directory, relative to the lint root. It is the <code>
        functions
      </code>
      
       entry of <code>
        convex.json
      </code>
      
      , <code>
        backend
      </code>
      
       in every scaffolded app.
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/eslint.ts" rel="nofollow">
        src/eslint.ts
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <a id="rules">
        
      </a>
      
       <code>
        rules?
      </code>
    </td>
    
    <td>
      <code>
        RulesConfig
      </code>
    </td>
    
    <td>
      <code>
        undefined
      </code>
    </td>
    
    <td>
      Rule levels that override or extend <a href="#backend_eslint_rules">
        BACKEND_ESLINT_RULES
      </a>
      
      .
    </td>
    
    <td>
      <a href="https://github.com/qruto/nuxt-backend/blob/main/src/eslint.ts" rel="nofollow">
        src/eslint.ts
      </a>
    </td>
  </tr>
</tbody>
</table>

## Variables

### BACKEND_ESLINT_RULES

```ts
const BACKEND_ESLINT_RULES: Readonly<Record<string, "error" | "warn">>;
```

Defined in: [src/eslint.ts](https://github.com/qruto/nuxt-backend/blob/main/src/eslint.ts)

The rules the preset turns on, at the levels of the plugin's own
recommended config. It leaves out what that config leaves out:
`require-access-control` and `import-wrong-runtime` (off there), and
`no-collect-in-query` (not in it).

## Functions

### backendEslint()

```ts
function backendEslint(options?): Config<RulesConfig>[];
```

Defined in: [src/eslint.ts](https://github.com/qruto/nuxt-backend/blob/main/src/eslint.ts)

Two flat-config entries: `nuxt-backend:convex` applies the Convex rules to
the functions directory (tests excluded), and `nuxt-backend:generated`
ignores every `_generated` folder in it.

The rules parse TypeScript. Inside `withNuxt(…)` the parser is already set;
a standalone config adds `typescript-eslint`'s parser for `.ts` files.

#### Parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        options?
      </code>
    </td>
    
    <td>
      <a href="#backendeslintoptions">
        <code>
          BackendEslintOptions
        </code>
      </a>
    </td>
  </tr>
</tbody>
</table>

#### Returns

`Config`<`RulesConfig`><span>



</span>


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
