import-js/eslint-plugin-import

`no-deprecated` works for `export function` but not for function exported by module

Open

#1,729 opened on Apr 14, 2020

 (1 comment) (0 reactions) (0 assignees)JavaScript (1,549 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (5,940 stars)
PR merge metrics
 (Avg merge 138d 22h) (3 merged PRs in 30d)

Description

This will get picked up by the rule successfully:

/**
 * @deprecated
 * Use `generateApolloError` instead.
 */
export function getError(ex: any) {
    if (ex.status && ex.code && ex.message) {
        return generateApolloError(ex);
    }
    return ex;
}

This won't get picked up by the rule:

/**
 * @deprecated
 * Use `generateApolloError` instead.
 */
function getError(ex: any) {
    if (ex.status && ex.code && ex.message) {
        return generateApolloError(ex);
    }
    return ex;
}

export { getError }

Contributor guide