# weslint

> Worker Threads + ESlint

Latest version **0.4.0** (published 2020-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install weslint
pnpm add weslint
yarn add weslint
bun add weslint
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2020-08-14 |
| First published | 2020-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.13.0 |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 81 |
| Maintainers | deepsweet |
| Keywords | workers, threads, parallel, eslint |

## Links

- npm: https://www.npmjs.com/package/weslint
- Repository: https://github.com/nextools/metarepo
- Homepage: https://github.com/nextools/metarepo#readme
- Issues: https://github.com/nextools/metarepo/issues
- npm.io page: https://npm.io/package/weslint

## Dependencies (2)

- [eslint](https://npm.io/package/eslint.md) ^7.3.1
- [workerama](https://npm.io/package/workerama.md) ^0.4.0

## 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
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2020-08-14
- 0.3.0 — 2020-07-03
- 0.2.2 — 2020-07-01
- 0.2.1 — 2020-06-17
- 0.2.0 — 2020-04-21
- 0.1.1 — 2020-03-06
- 0.1.0 — 2020-03-04

## README

# weslint ![npm](https://flat.badgen.net/npm/v/weslint)

Worker Threads + ESlint.

:warning: Node.js v10 needs an `--experimental-worker` flag.

## Install

```sh
$ yarn add weslint
```

## API

```ts
type TWeslintOptions = {
  files: string[],
  maxThreadCount?: number,
  formatter?: string,
  eslint?: CLIEngine.Options,
}

type TWeslintResult = {
  hasErrors: boolean,
  hasWarnings: boolean,
  formattedReport: string,
}

const weslint: (options: TWeslintOptions) => Promise<TWeslintResult>
```

* `files` – array of file paths
* `maxThreadCount` – `cpus().length` by default
* `formatter` – [ESLint formatter name](https://eslint.org/docs/developer-guide/nodejs-api#cliengine-getformatter)
* `eslint` – [ESLint CLIEngine options](https://eslint.org/docs/developer-guide/nodejs-api#cliengine)

## Usage

```ts
import { weslint } from 'weslint'

const result = await weslint({
  files: ['./file1.ts', './file2.ts']
})

if (result.hasErrors || result.hasWarnings) {
  console.log(result.formattedReport)
}

if (result.hasErrors) {
  throw new Error('oops')
}
```

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