Skip to content

Consider an ESLint rule that warns against pitfalls #4

Open
@Kashuab

Description

The only pitfall I can really think of is if a developer forgets to document an error in the errors list. For example:

const superCoolFunc = throws(
  () => {
    console.log('Do something');
    throw new SuperCoolError();
    throw new SomethingElseError();
  },
  { SuperCoolError } // Missing SomethingElseError!
);

... Or vice-versa.

A linter rule could help mitigate this, or some sort of dev-environment-only console error if this happens at runtime

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions