# esbuild-plugin-eslint

> Lint your esbuild bundles with ESLint. 🧐

Latest version **0.3.12** (published 2024-03-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install esbuild-plugin-eslint
pnpm add esbuild-plugin-eslint
yarn add esbuild-plugin-eslint
bun add esbuild-plugin-eslint
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.12 |
| Published | 2024-03-15 |
| First published | 2022-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 0 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Robin Löffel |
| Maintainers | rbnlffl |
| Keywords | esbuild, plugin, esbuild-plugin, eslint, lint |

## Links

- npm: https://www.npmjs.com/package/esbuild-plugin-eslint
- Repository: https://github.com/robinloeffel/esbuild-plugin-eslint
- Issues: https://github.com/robinloeffel/esbuild-plugin-eslint/issues
- npm.io page: https://npm.io/package/esbuild-plugin-eslint

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.3.12 (latest) — 2024-03-15
- 0.3.11 — 2024-03-12
- 0.3.10 — 2024-03-12
- 0.3.9 — 2024-03-05
- 0.3.8 — 2024-03-01
- 0.3.7 — 2023-11-03
- 0.3.6 — 2023-04-02
- 0.3.5 — 2023-03-20
- 0.3.4 — 2023-03-18
- 0.3.3 — 2023-03-18
- 0.3.2 — 2023-03-18
- 0.3.1 — 2023-03-10
- 0.3.0 — 2023-03-10
- 0.2.0 — 2023-03-10
- 0.1.1 — 2022-08-30
- … 2 more at https://npm.io/package/esbuild-plugin-eslint/versions

## README

# `esbuild-plugin-eslint`

[![latest version on npm](https://img.shields.io/npm/v/esbuild-plugin-eslint)](https://www.npmjs.com/package/esbuild-plugin-eslint)
[![npm downloads a week](https://img.shields.io/npm/dw/esbuild-plugin-eslint)](https://www.npmjs.com/package/esbuild-plugin-eslint)
[![required node version](https://img.shields.io/node/v/esbuild-plugin-eslint)](https://github.com/nodejs/Release)
[![esbuild peer dep](https://img.shields.io/npm/dependency-version/esbuild-plugin-eslint/peer/esbuild?label=esbuild%20peer%20dep)](https://github.com/evanw/esbuild)
[![eslint peer dep](https://img.shields.io/npm/dependency-version/esbuild-plugin-eslint/peer/eslint?label=eslint%20peer%20dep)](https://github.com/eslint/eslint)
[![package license](https://img.shields.io/npm/l/esbuild-plugin-eslint)](license)

> Lint your [`esbuild`](https://github.com/evanw/esbuild) bundles with [`eslint`](https://github.com/eslint/eslint). 🧐

Nicely integrates the most recent version of [`eslint`](https://github.com/eslint/eslint) into an [`esbuild`](https://github.com/evanw/esbuild) plugin.

## How

```bash
npm i esbuild-plugin-eslint eslint --save-dev
```

```js
import { build } from 'esbuild';
import eslint from 'esbuild-plugin-eslint';

await build({
  // ...
  plugins: [
    eslint({ /* config */ })
  ]
});
```

```bash
node esbuild.config.js
```

## Config

This plugin respects your [ESLint configuration](https://eslint.org/docs/user-guide/configuring) as per default. It also takes a configuration object intended for the [ESLint constructor](https://eslint.org/docs/latest/developer-guide/nodejs-api#parameters) with the addition of a `filter`, `throwOnError`, and `throwOnWarning` property. The most important options are:

### `filter`

Type: `RegExp`<br>
Default: `/\.(?:jsx?|tsx?|mts|cts|mjs|cjs|vue|svelte)$/`<br>
Used by: [`esbuild`](https://github.com/evanw/esbuild)<br>
Reference: [esbuild.github.io](https://esbuild.github.io/plugins/#on-load-options)

Tells esbuild what files to look at. Only files matching this pattern will be handled by the plugin.

### `throwOnError`

Type: `boolean`<br>
Default: `false`<br>
Used by: [The plugin itself](https://github.com/robinloeffel/esbuild-plugin-eslint)<br>

Instructs the plugin to forward errors found by ESLint to esbuild and throw an error.

### `throwOnWarning`

Type: `boolean`<br>
Default: `false`<br>
Used by: [The plugin itself](https://github.com/robinloeffel/esbuild-plugin-eslint)<br>

Instructs the plugin to forward warnings found by ESLint to esbuild and throw an error.

### `fix`

Type: `boolean`<br>
Default: `false`<br>
Used by: [`eslint`](https://github.com/eslint/eslint)<br>
Reference: [eslint.org (`options.fix`)](https://eslint.org/docs/latest/developer-guide/nodejs-api#parameters)<br>

Controls whether to enable or disable the autofix feature of ESLint.

### `useEslintrc`

Type: `boolean`<br>
Default: `true`<br>
Used by: [`eslint`](https://github.com/eslint/eslint)<br>
Reference: [eslint.org (`options.useEslintrc`)](https://eslint.org/docs/latest/developer-guide/nodejs-api#parameters)<br>

If set to `false`, ESLint will not respect any configuration files it finds.

## License

MIT

---
_Source: https://npm.io/package/esbuild-plugin-eslint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
