Skip to content

Commit 5185bd5

Browse files
committed
Formatting + package.json cli format fix
1 parent cc61dc1 commit 5185bd5

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"test:watch": "react-scripts test --env=jsdom",
3838
"release": "npm run test && npm run prepare && dotenv release-it",
3939
"lint": "eslint . --ext .js,.ts,.tsx",
40-
"format": "prettier --write {src,playground}",
40+
"format": "prettier --write {src,playground}/**/*.{ts,tsx}",
4141
"format:check": "prettier --check {src,playground}/**/*.{ts,tsx}"
4242
},
4343
"peerDependencies": {
@@ -93,4 +93,4 @@
9393
"input",
9494
"autocompletion"
9595
]
96-
}
96+
}

src/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface ReactInputVerificationCodeProps {
2323
const ReactInputVerificationCode = ({
2424
autoFocus = false,
2525
length = 4,
26-
onChange = () => { },
27-
onCompleted = () => { },
26+
onChange = () => {},
27+
onCompleted = () => {},
2828
placeholder = '·',
2929
value: pValue,
3030
dataCy = 'verification-code',
@@ -156,7 +156,8 @@ const ReactInputVerificationCode = ({
156156
const stringValue = value.join('');
157157
const isCompleted = stringValue.length === length;
158158

159-
if (isCompleted && stringValue !== emptyValue.join('')) onCompleted(stringValue);
159+
if (isCompleted && stringValue !== emptyValue.join(''))
160+
onCompleted(stringValue);
160161
onChange(stringValue);
161162
}, [value, length]);
162163

@@ -208,8 +209,9 @@ const ReactInputVerificationCode = ({
208209
ref={ref}
209210
role='button'
210211
tabIndex={0}
211-
className={`ReactInputVerificationCode__item ${value[i] !== placeholder ? 'is-filled' : ''
212-
} ${i === activeIndex ? 'is-active' : ''}`}
212+
className={`ReactInputVerificationCode__item ${
213+
value[i] !== placeholder ? 'is-filled' : ''
214+
} ${i === activeIndex ? 'is-active' : ''}`}
213215
onFocus={onItemFocus(i)}
214216
data-cy={`${dataCy}-${i}-item`}
215217
>

0 commit comments

Comments
 (0)