Skip to content

Commit

Permalink
feat: ignore aliased re-export
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jul 27, 2023
1 parent 5c89470 commit 3212fd9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/rules/noExportAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default createRule<Options, MessageIds>({
create: (context) => {
return {
ExportAllDeclaration(node: TSESTree.ExportAllDeclaration) {
if (node.exported) {
return;
}

const exportMap = ExportMap.get(node.source.value, context);

if (exportMap === null) {
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/noExportAll/valid/aliasedReExport/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const FOO = 'FOO';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as foo from './foo';
2 changes: 1 addition & 1 deletion tests/rules/noExportAll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ const validTest = (name: string, only: boolean = false) => {

ruleTester.run('no-export-all', rule, {
invalid: [invalidTest('namespaceExport'), invalidTest('reExport')],
valid: [validTest('namedExport')],
valid: [validTest('namedExport'), validTest('aliasedReExport')],
});

0 comments on commit 3212fd9

Please sign in to comment.