-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(codemod): add supported list migrations
- Loading branch information
Showing
18 changed files
with
659 additions
and
18 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
14 changes: 3 additions & 11 deletions
14
packages/codemod/transforms/utils/isJsxExpressionContainer.ts
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
9 changes: 3 additions & 6 deletions
9
packages/codemod/transforms/utils/isPropConditionalExpression.ts
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
26 changes: 26 additions & 0 deletions
26
...s/codemod/transforms/v5-to-v6/list/__testfixtures__/DeprecatedListItemLinkProps.input.tsx
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItemLink } from "react-md"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
<ListItemLink | ||
to="/example" | ||
onClick={() => { | ||
// do something | ||
}} | ||
disableRipple | ||
disableProgrammaticRipple | ||
disableEnterClick | ||
disableSpacebarClick | ||
disablePressedFallback | ||
enablePressedAndRipple | ||
rippleTimeout={100} | ||
rippleClassName={styles.ripple} | ||
rippleClassNames={{ enter: "", exit: "" }} | ||
rippleContainerClassName="example" | ||
> | ||
Hello, world! | ||
</ListItemLink> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
.../codemod/transforms/v5-to-v6/list/__testfixtures__/DeprecatedListItemLinkProps.output.tsx
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItemLink } from "react-md"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
(<ListItemLink | ||
to="/example" | ||
onClick={() => { | ||
// do something | ||
}}>Hello, world! | ||
</ListItemLink>) | ||
); | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/codemod/transforms/v5-to-v6/list/__testfixtures__/DeprecatedListItemProps.input.tsx
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItem } from "react-md"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
<ListItem | ||
onClick={() => { | ||
// do something | ||
}} | ||
disableRipple | ||
disableProgrammaticRipple | ||
disableEnterClick | ||
disableSpacebarClick | ||
disablePressedFallback | ||
enablePressedAndRipple | ||
rippleTimeout={100} | ||
rippleClassName={styles.ripple} | ||
rippleClassNames={{ enter: "", exit: "" }} | ||
rippleContainerClassName="example" | ||
> | ||
Hello, world! | ||
</ListItem> | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
...ages/codemod/transforms/v5-to-v6/list/__testfixtures__/DeprecatedListItemProps.output.tsx
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItem } from "react-md"; | ||
import styles from "./styles.module.scss"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
(<ListItem | ||
onClick={() => { | ||
// do something | ||
}}>Hello, world! | ||
</ListItem>) | ||
); | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/codemod/transforms/v5-to-v6/list/__testfixtures__/ListItemLink.input.tsx
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItemLink } from "react-md"; | ||
|
||
import { CustomLink } from "./CustomLink"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
<> | ||
<ListItemLink component={CustomLink} to="/some-path"> | ||
Link 1 | ||
</ListItemLink> | ||
<ListItemLink component="a" href="/some-path"> | ||
Link 2 | ||
</ListItemLink> | ||
</> | ||
); | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/codemod/transforms/v5-to-v6/list/__testfixtures__/ListItemLink.output.tsx
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItemLink } from "react-md"; | ||
|
||
import { CustomLink } from "./CustomLink"; | ||
|
||
export default function Example(): ReactElement { | ||
return (<> | ||
<ListItemLink as={CustomLink} to="/some-path"> | ||
Link 1 | ||
</ListItemLink> | ||
<ListItemLink as="a" href="/some-path"> | ||
Link 2 | ||
</ListItemLink> | ||
</>); | ||
} |
13 changes: 13 additions & 0 deletions
13
...ages/codemod/transforms/v5-to-v6/list/__testfixtures__/ListItemTextChildrenProp.input.tsx
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItem } from "react-md"; | ||
|
||
export default function Example(): ReactElement { | ||
return ( | ||
<> | ||
<ListItem textChildren>Hello, world!</ListItem> | ||
<ListItem textChildren={false}>Hello, world!</ListItem> | ||
<ListItem textChildren={true}>Hello, world!</ListItem> | ||
<ListItem textChildren={textChildren}>Hello, world!</ListItem> | ||
</> | ||
); | ||
} |
11 changes: 11 additions & 0 deletions
11
...ges/codemod/transforms/v5-to-v6/list/__testfixtures__/ListItemTextChildrenProp.output.tsx
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { type ReactElement } from "react"; | ||
import { ListItem } from "react-md"; | ||
|
||
export default function Example(): ReactElement { | ||
return (<> | ||
<ListItem>Hello, world!</ListItem> | ||
<ListItem disableTextChildren>Hello, world!</ListItem> | ||
<ListItem>Hello, world!</ListItem> | ||
<ListItem disableTextChildren={!textChildren}>Hello, world!</ListItem> | ||
</>); | ||
} |
Oops, something went wrong.