This ESLint plugin is based on the excellent eslint-plugin-neverthrow package by @mdbetancourt
Install eslint-plugin-errok
using your favorite package manager:
npm install --save-dev eslint-plugin-errok
- Node.js LTS
- ESLint (v8 or higher)
- @typescript-eslint/parser (v6 or higher)
Add errok
to the plugins
section of your ESLint config file:
// .eslintrc.cjs
module.exports = {
plugins: ['errok'],
rules: {
'errok/must-use-result': 'error',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
};
See also Configuring ESLint.
errok/recommended
... enables the recommended rules.
Rule ID | Description | |
---|---|---|
errok/must-use-result | Not handling errok Result is a possible error because errors could remain unhandled. | ⭐️ |