@antithrow/eslint-plugin
ESLint plugin with type-aware rules for enforcing correct Result and ResultAsync usage.
Installation
- npm
- Yarn
- pnpm
- Bun
npm install -D @antithrow/eslint-plugin
yarn add --dev @antithrow/eslint-plugin
pnpm add -D @antithrow/eslint-plugin
bun add --dev @antithrow/eslint-plugin
Setup
Add the recommended config to your ESLint flat config. The plugin requires type-aware linting via typescript-eslint:
// eslint.config.ts
import antithrow from "@antithrow/eslint-plugin";
import tseslint from "typescript-eslint";
export default tseslint.config(...tseslint.configs.recommended, antithrow.configs.recommended);
note
All three rules require type information. Make sure your ESLint config includes typescript-eslint's parser with project or projectService options configured. See typescript-eslint's docs for setup instructions.
Recommended config
The recommended config enables all rules with these severities:
| Rule | Severity |
|---|---|
no-unused-result | error |
no-unsafe-unwrap | warn |
no-throwing-call | warn |