diff --git a/rules/prevent-abbreviations.js b/rules/prevent-abbreviations.js index 12ec976abb..303e760e74 100644 --- a/rules/prevent-abbreviations.js +++ b/rules/prevent-abbreviations.js @@ -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; }; diff --git a/test/prevent-abbreviations.js b/test/prevent-abbreviations.js index 49ced01284..42e1738592 100644 --- a/test/prevent-abbreviations.js +++ b/test/prevent-abbreviations.js @@ -1880,7 +1880,7 @@ runTest.babelLegacy({ export type PreloadProps = {}; `, output: outdent` - export type PreloadProperties = {}; + export type PreloadProps = {}; `, errors: [...createErrors(), ...createErrors()] }