1.0.5 • Published 2 years ago

eslint-plugin-kiswe v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

eslint-plugin-kiswe

Additional Eslint plugins

Install

yarn add --dev eslint-plugin-kiswe

Edit .eslintrc:

{
  plugins: ['kiswe'],
  rules: {
    'kiswe/no-floating-either': 'error',
    'kiswe/no-floating-result': 'error'
  }
}

kiswe/no-floating-either

This lint forces you to handle errors returned from functions.

Eg const a = (): E.Either<Error, number> => 5

Correct behaviour

const variable = a()
console.log(a())

Wrong behaviour

a()
await a()

kiswe/no-floating-result

This lint forces you to handle errors returned from functions.

Eg const a = (): Result<number, 'error'> => 5

Correct behaviour

const variable = a()
console.log(a())

Wrong behaviour

a()
await a()