Skip to content

Tunnel-Labs/eslint-plugin-errok

Repository files navigation

eslint-plugin-errok

This ESLint plugin is based on the excellent eslint-plugin-neverthrow package by @mdbetancourt

Installation

Install eslint-plugin-errok using your favorite package manager:

npm install --save-dev eslint-plugin-errok

Requirements

  • Node.js LTS
  • ESLint (v8 or higher)
  • @typescript-eslint/parser (v6 or higher)

Usage

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.

Configs

  • errok/recommended ... enables the recommended rules.

Rules

Possible Errors

Rule ID Description
errok/must-use-result Not handling errok Result is a possible error because errors could remain unhandled. ⭐️

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published