-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better way of preventing unintended exports (#85)
* Revert "Fix exports (#82)" This reverts commit b9435de. * fix: better way of preventing unintended exports sveltejs/svelte#12202 revealed that TypeScript has a harder time tracing imports when they are indirectly exposed, e.g. `function foo(): void; ... export { foo }` instead of `export function foo(): void;`, which can lead to bugs down the line. Ultimately this is a TypeScript limitation but in the meantime adding a lone `export {}` along `export function/const/etc` statements has the same effect as #82 * fix tests
- Loading branch information
1 parent
079b5d1
commit 5867205
Showing
61 changed files
with
152 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/// <reference types="some-ambient-import" /> | ||
|
||
declare module 'ambient-imports' { | ||
interface Foo {} | ||
export interface Foo {} | ||
|
||
export { Foo }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"sourcesContent": [ | ||
null | ||
], | ||
"mappings": ";;;WAEiBA,GAAGA" | ||
"mappings": ";;;kBAEiBA,GAAGA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
declare module 'const-namespace' { | ||
namespace a { | ||
export namespace a { | ||
const x: number; | ||
} | ||
|
||
export { a }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map | ||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
declare module 'const-namespace' { | ||
namespace a { | ||
export namespace a { | ||
let x: number; | ||
} | ||
|
||
export { a }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
declare module 'declare-module' { | ||
interface Foo {} | ||
export interface Foo {} | ||
|
||
export { Foo }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"sourcesContent": [ | ||
null | ||
], | ||
"mappings": ";WAOiBA,GAAGA" | ||
"mappings": ";kBAOiBA,GAAGA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
declare module 'deconflict-priority' { | ||
function x(foo: Foo, bar: Bar): void; | ||
export function x(foo: Foo, bar: Bar): void; | ||
interface Foo {} | ||
interface Bar {} | ||
|
||
export { x }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
declare module 'enum' { | ||
enum categories { | ||
export enum categories { | ||
ANIMAL = 0, | ||
VEGETABLE = 1, | ||
MINERAL = 2 | ||
} | ||
|
||
export { categories }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"sourcesContent": [ | ||
null | ||
], | ||
"mappings": ";MAAYA,UAAUA" | ||
} | ||
"mappings": ";aAAYA,UAAUA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"sourcesContent": [ | ||
null | ||
], | ||
"mappings": ";;;;UAMwBA,GAAGA" | ||
"mappings": ";;;;iBAMwBA,GAAGA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
declare module 'export-default-function' { | ||
export default function foo(): void; | ||
|
||
export { default }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
declare module 'export-from' { | ||
const foo: "hello"; | ||
export const foo: "hello"; | ||
|
||
export { foo }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ | |
"sourcesContent": [ | ||
null | ||
], | ||
"mappings": ";OAAaA,GAAGA" | ||
"mappings": ";cAAaA,GAAGA" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
declare module 'export-type' { | ||
type D = {}; | ||
class B<D> {} | ||
export type D = {}; | ||
export class B<D> {} | ||
|
||
export { B, D }; | ||
export {}; | ||
} | ||
|
||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
"sources": [], | ||
"sourcesContent": [], | ||
"mappings": "" | ||
} | ||
} |
Oops, something went wrong.