Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codemod: remove Section and Items imports if not used elsewhere in file #6908

Merged
merged 9 commits into from
Aug 22, 2024
Prev Previous commit
Next Next commit
cleanup
  • Loading branch information
reidbarber committed Aug 20, 2024
commit f5baae9a6b88b5ff44ee475690639fd6056e3f78
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ import { StatusLight } from "@react-spectrum/s2";

exports[`should remove unused Item/Section import even if name taken in different scope 1`] = `
"import { MenuSection, MenuItem, Menu } from "@react-spectrum/s2";
import { ListBox } from '@adobe/react-spectrum';

function foo() {
let Item = 'something else';
Expand Down
4 changes: 2 additions & 2 deletions packages/dev/codemods/src/s1-to-s2/__tests__/imports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ import {Button} from "@react-spectrum/s2";
`);

test('should remove unused Item/Section import even if name taken in different scope', `
import {Menu, Section, Item, ListBox} from '@adobe/react-spectrum';
import {Menu, Section, Item} from '@adobe/react-spectrum';

function foo() {
let Item = 'something else';
let Section = 'something else';
}
}

<div>
<Menu aria-label="Text">
Expand Down