Skip to content

Commit

Permalink
fix: case
Browse files Browse the repository at this point in the history
  • Loading branch information
sashuk committed Sep 1, 2023
1 parent 1ab23fa commit 4223b16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Container } from '@toptal/picasso'

const test = 'large'
const booleanVariable = true
const extraProps = { align: 'left '}

export default () => (
<>
Expand All @@ -13,6 +14,7 @@ export default () => (
<Container bottom={1.5}>Content</Container>
<Container left={1.6}>Content</Container>
<Container top={booleanVariable ? 'small' : 1.5}>Content</Container>
<Container {...extraProps}>Content</Container>
<Dropdown
someProp='small'
offset={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Container } from '@toptal/picasso'

const test = 'large'
const booleanVariable = true
const extraProps = { align: 'left '}

export default () => (
<>
Expand All @@ -14,6 +15,7 @@ export default () => (
<Container bottom={SPACING_6}>Content</Container>
<Container left={1.6}>Content</Container>
<Container top={booleanVariable ? SPACING_4 : SPACING_6}>Content</Container>
<Container {...extraProps}>Content</Container>
<Dropdown
someProp='small'
offset={{
Expand Down
7 changes: 5 additions & 2 deletions packages/picasso-codemod/src/v100.0.0/spacing-values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,12 @@ const transform: Transform = (file, api) => {
.forEach(element => {
const updatedElementAttributes =
element.node.openingElement.attributes.map(attribute => {
const attributeName = attribute.name.name
const attributeName = attribute.name?.name

if (AFFECTED_ATTRIBUTES.indexOf(attributeName) === -1) {
if (
!attributeName ||
AFFECTED_ATTRIBUTES.indexOf(attributeName) === -1
) {
return attribute
}

Expand Down

0 comments on commit 4223b16

Please sign in to comment.