Skip to content

Commit

Permalink
prevent-abbreviations: Do not rename exported types when using @bab…
Browse files Browse the repository at this point in the history
…el/eslint-parser (#1104)
  • Loading branch information
Vages committed Feb 18, 2021
1 parent 5c08932 commit 9a91a3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions rules/prevent-abbreviations.js
Expand Up @@ -431,6 +431,13 @@ const isExportedIdentifier = identifier => {
return identifier.parent.parent.type === 'ExportNamedDeclaration';
}

if (
identifier.parent.type === 'TypeAlias' &&
identifier.parent.id === identifier
) {
return identifier.parent.parent.type === 'ExportNamedDeclaration';
}

return false;
};

Expand Down
2 changes: 1 addition & 1 deletion test/prevent-abbreviations.js
Expand Up @@ -1880,7 +1880,7 @@ runTest.babelLegacy({
export type PreloadProps<TExtraProps = null> = {};
`,
output: outdent`
export type PreloadProperties<TExtraProperties = null> = {};
export type PreloadProps<TExtraProperties = null> = {};
`,
errors: [...createErrors(), ...createErrors()]
}
Expand Down

0 comments on commit 9a91a3d

Please sign in to comment.