@@ -58,7 +58,10 @@ def sample_project(tmp_path):
5858 page = tmp_path / "src" / "app" / "page.tsx"
5959 page .parent .mkdir (parents = True , exist_ok = True )
6060 page .write_text (
61- 'import { Button } from "../components/Button";\n export default function Page() {\n return <Button />;\n }\n '
61+ 'import { Button } from "../components/Button";\n '
62+ "export default function Page() {\n "
63+ " return <Button />;\n "
64+ "}\n "
6265 )
6366
6467 # src/app/deadpage/page.tsx - dead route
@@ -139,7 +142,10 @@ class TestExportParsing:
139142 def test_named_exports (self , tmp_path ):
140143 f = tmp_path / "test.ts"
141144 f .write_text (
142- "export function foo() {}\n export const bar = 1;\n export type Baz = string;\n export interface Qux {}\n "
145+ "export function foo() {}\n "
146+ "export const bar = 1;\n "
147+ "export type Baz = string;\n "
148+ "export interface Qux {}\n "
143149 )
144150 scanner = DeadCodeScanner (tmp_path )
145151 result = scanner .scan ()
@@ -181,7 +187,9 @@ def test_orphaned_css_detection(self, tmp_path):
181187 )
182188 component = tmp_path / "Component.tsx"
183189 component .write_text (
184- 'export function Component() {\n return <div className="used-class">Hi</div>;\n }\n '
190+ "export function Component() {\n "
191+ ' return <div className="used-class">Hi</div>;\n '
192+ "}\n "
185193 )
186194
187195 scanner = DeadCodeScanner (tmp_path )
@@ -357,7 +365,12 @@ def test_multiline_export_list_detected(self, tmp_path):
357365 mod = tmp_path / "src" / "mod.ts"
358366 mod .parent .mkdir (parents = True , exist_ok = True )
359367 mod .write_text (
360- "function Alpha() { return 1; }\n function Beta() { return 2; }\n export {\n Alpha,\n Beta,\n }\n "
368+ "function Alpha() { return 1; }\n "
369+ "function Beta() { return 2; }\n "
370+ "export {\n "
371+ " Alpha,\n "
372+ " Beta,\n "
373+ "}\n "
361374 )
362375
363376 scanner = DeadCodeScanner (tmp_path )
@@ -398,7 +411,10 @@ def test_multiline_export_list_with_aliases(self, tmp_path):
398411 mod = tmp_path / "src" / "mod.ts"
399412 mod .parent .mkdir (parents = True , exist_ok = True )
400413 mod .write_text (
401- "function InternalName() { return 1; }\n export {\n InternalName as PublicName,\n }\n "
414+ "function InternalName() { return 1; }\n "
415+ "export {\n "
416+ " InternalName as PublicName,\n "
417+ "}\n "
402418 )
403419
404420 scanner = DeadCodeScanner (tmp_path )
0 commit comments