Skip to content

Commit 8aa8dc7

Browse files
committed
fix: add type to import
1 parent 5452db8 commit 8aa8dc7

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

lib/anchor/type_script/file_structure.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.imports_to_code(imports)
1010
import.type.try(:anchor_schema_name) || import.type.name
1111
end.join(",")
1212

13-
"import { #{named_imports} } from \"./#{file_name[..-4]}\";"
13+
"import type { #{named_imports} } from \"./#{file_name[..-4]}\";"
1414
end.join("\n") + "\n"
1515
end
1616

spec/example/test/files/multifile/Comment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// START AUTOGEN
22

3-
import { Post } from "./Post";
4-
import { User } from "./User";
3+
import type { Post } from "./Post";
4+
import type { User } from "./User";
55

66
type Model = {
77
id: number;

spec/example/test/files/multifile/Exhaustive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// START AUTOGEN
22

3-
import { Maybe } from "./shared";
3+
import type { Maybe } from "./shared";
44

55
type Model = {
66
id: number;

spec/example/test/files/multifile/Post.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// START AUTOGEN
22

3-
import { Comment } from "./Comment";
4-
import { User } from "./User";
3+
import type { Comment } from "./Comment";
4+
import type { User } from "./User";
55

66
type Model = {
77
id: number;

spec/example/test/files/multifile/User.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// START AUTOGEN
22

3-
import { UserRole } from "./shared";
4-
import { Comment } from "./Comment";
5-
import { Post } from "./Post";
3+
import type { UserRole } from "./shared";
4+
import type { Comment } from "./Comment";
5+
import type { Post } from "./Post";
66

77
type Model = {
88
id: number;

0 commit comments

Comments
 (0)