ESLint plugin for antithrow Result types
npm install @antithrow/eslint-plugin``bash`
bun add -d @antithrow/eslint-plugin
This plugin requires typed linting to be configured.
Add the recommended config to your eslint.config.ts:
`ts
import antithrow from "@antithrow/eslint-plugin";
export default [
// ... your other configs
antithrow.configs.recommended,
];
`
Or configure rules individually:
`ts
import antithrow from "@antithrow/eslint-plugin";
export default [
{
plugins: {
"@antithrow": antithrow,
},
rules: {
"@antithrow/no-throwing-call": "warn",
"@antithrow/no-unsafe-unwrap": "warn",
"@antithrow/no-unused-result": "error",
},
},
];
`
| Rule | Description | Recommended |
| --- | --- | --- |
| no-throwing-call | Disallow calls to throwing built-in APIs with @antithrow/std replacements | warn |no-unsafe-unwrap
| | Disallow unwrap/expect APIs on antithrow Result values | warn |no-unused-result
| | Require Result and ResultAsync values to be used | error` |