Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 1e9f473

Browse files
committed
chore: remove biome lint rule noParameterAssign
1 parent eacc3fd commit 1e9f473

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

biome.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
},
2222
"style": {
2323
"noUnusedTemplateLiteral": "off",
24-
"useExponentiationOperator": "off",
25-
"noParameterAssign": "off"
24+
"useExponentiationOperator": "off"
2625
},
2726
"a11y": {
2827
"noSvgWithoutTitle": "off"

packages/core/src/Input/TimeInput.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,23 @@ const moveCursor = (position: number, backspace: boolean) => {
145145
}
146146

147147
const convertToTwentyFour = (hour: number, ampm: TimeFormat) => {
148-
if (hour === 0) {
148+
let nextHour = hour
149+
if (nextHour === 0) {
149150
// 0 does not exist on AM/PM so it can be converted to 1 instead.
150-
hour = 1
151+
nextHour = 1
151152
}
152153
if (ampm === TimeFormat.AM) {
153-
return hour === 12 ? 0 : hour
154+
return nextHour === 12 ? 0 : nextHour
154155
}
155-
return hour === 12 ? hour : hour + 12
156+
return nextHour === 12 ? nextHour : nextHour + 12
156157
}
157158

158159
const SECONDS_PER_HOUR = 3600
159160
const SECONDS_PER_MINUTE = 60
160161

161-
const parseSecondsToFormat = (sec: number, format: FormatVariants) => {
162+
const parseSecondsToFormat = (value: number, format: FormatVariants) => {
163+
let sec = value
164+
162165
let hour
163166
let minute
164167
let second
@@ -306,13 +309,13 @@ export const TimeInput: FC<TimeInputProps> = ({
306309
.split(':')
307310
.reduce<TimeValues>((acc, v) => {
308311
if (hour !== undefined && acc.hour === undefined) {
309-
acc = {
312+
return {
310313
hour: convertToTwentyFour(parseInt(v), newTimeFormat),
311314
}
312315
} else if (minute !== undefined && acc.minute === undefined) {
313-
acc = { ...acc, minute: parseInt(v) }
316+
return { ...acc, minute: parseInt(v) }
314317
} else if (second !== undefined && acc.second === undefined) {
315-
acc = { ...acc, second: parseInt(v) }
318+
return { ...acc, second: parseInt(v) }
316319
}
317320
return acc
318321
}, {})
@@ -380,13 +383,13 @@ export const TimeInput: FC<TimeInputProps> = ({
380383
number = MAX_INPUT_VALUE - 1
381384
}
382385
if (hour !== undefined && acc.hour === undefined) {
383-
acc = {
386+
return {
384387
hour: hour12 ? convertToTwentyFour(number, timeFormat) : number,
385388
}
386389
} else if (minute !== undefined && acc.minute === undefined) {
387-
acc = { ...acc, minute: number }
390+
return { ...acc, minute: number }
388391
} else if (second !== undefined && acc.second === undefined) {
389-
acc = { ...acc, second: number }
392+
return { ...acc, second: number }
390393
}
391394
return acc
392395
}, {})
@@ -536,11 +539,11 @@ export const DurationInput: FC<DurationInputProps> = ({
536539
number = MAX_INPUT_VALUE - 1
537540
}
538541
if (hour !== undefined && acc.hour === undefined) {
539-
acc = { hour: number }
542+
return { hour: number }
540543
} else if (minute !== undefined && acc.minute === undefined) {
541-
acc = { ...acc, minute: number }
544+
return { ...acc, minute: number }
542545
} else if (second !== undefined && acc.second === undefined) {
543-
acc = { ...acc, second: number }
546+
return { ...acc, second: number }
544547
}
545548
return acc
546549
}, {})

packages/docs/webpack.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ const getNextFreePort = async (port: number): Promise<number> => {
2525
tmpServer.on('error', (e: NodeJS.ErrnoException) => {
2626
if (e.code === 'EADDRINUSE') {
2727
tmpServer.close()
28-
port = 1 + port
29-
tmpServer.listen(port)
28+
tmpServer.listen(1 + port)
3029
}
3130
})
3231
})

0 commit comments

Comments
 (0)