import-js/eslint-plugin-import

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

Open

#1729 aperta il 14 apr 2020

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (1540 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (4946 star)
Metriche merge PR
 (Merge medio 138g 22h) (3 PR mergiate in 30 g)

Descrizione

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 }

Guida contributor