sindresorhus/eslint-plugin-unicorn

custom-error-definition rule does not validate against exported name #190

MrHen posted onGitHub

The following passes linting:

exports.fooError = class FooError extends Error {
    constructor(error) {
        super(error);
        this.name = 'FooError';
    }
};

The name used in exports.fooError should match the name used in this.name = 'FooError';.

A commented out test was added as part of #188 to cover this scenario.


Fund this Issue

$40.00
Rewarded

Rewarded pull request

Recent activities

mrhen was rewarded by sindresorhus for sindresorhus/eslint-plugin-unicorn# 190
almost 6 years ago
mrhen submitted an output to  sindresorhus/ eslint-plugin-unicorn# 190
almost 6 years ago