Skip to content

Commit e7f5dd2

Browse files
committed
style: fix lint errors
1 parent 1619014 commit e7f5dd2

File tree

3 files changed

+33
-34
lines changed

3 files changed

+33
-34
lines changed

code/addons/docs/src/blocks/controls/Number.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,38 +42,38 @@ export const NumberControl: FC<NumberProps> = ({
4242
const readonly = !!argType?.table?.readonly;
4343

4444
const handleChange = useCallback(
45-
(event: ChangeEvent<HTMLInputElement>) => {
46-
setInputValue(event.target.value);
47-
48-
const result = parseFloat(event.target.value);
49-
if (Number.isNaN(result)) {
50-
setParseError(new Error(`'${event.target.value}' is not a number`));
51-
} else {
52-
// Initialize the final value as the user's input
53-
let finalValue = result;
54-
55-
// Clamp to minimum: if finalValue is less than min, use min
56-
if (typeof min === 'number' && finalValue < min) {
57-
finalValue = min;
58-
}
59-
60-
// Clamp to maximum: if finalValue is greater than max, use max
61-
if (typeof max === 'number' && finalValue > max) {
62-
finalValue = max;
63-
}
64-
65-
// Pass the clamped final value to the onChange callback
66-
onChange(finalValue);
67-
// Clear any previous parse errors
68-
setParseError(null);
69-
70-
// If the value was clamped, update the input display to the final value
71-
if (finalValue !== result) {
72-
setInputValue(String(finalValue));
73-
}
74-
}
75-
},
76-
[onChange, setParseError, min, max]
45+
(event: ChangeEvent<HTMLInputElement>) => {
46+
setInputValue(event.target.value);
47+
48+
const result = parseFloat(event.target.value);
49+
if (Number.isNaN(result)) {
50+
setParseError(new Error(`'${event.target.value}' is not a number`));
51+
} else {
52+
// Initialize the final value as the user's input
53+
let finalValue = result;
54+
55+
// Clamp to minimum: if finalValue is less than min, use min
56+
if (typeof min === 'number' && finalValue < min) {
57+
finalValue = min;
58+
}
59+
60+
// Clamp to maximum: if finalValue is greater than max, use max
61+
if (typeof max === 'number' && finalValue > max) {
62+
finalValue = max;
63+
}
64+
65+
// Pass the clamped final value to the onChange callback
66+
onChange(finalValue);
67+
// Clear any previous parse errors
68+
setParseError(null);
69+
70+
// If the value was clamped, update the input display to the final value
71+
if (finalValue !== result) {
72+
setInputValue(String(finalValue));
73+
}
74+
}
75+
},
76+
[onChange, setParseError, min, max]
7777
);
7878

7979
const onForceVisible = useCallback(() => {

code/frameworks/sveltekit/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"baseUrl": ".",
44
"paths": {
55
"storybook/internal/*": ["../../lib/cli/core/*"]
6-
},
6+
}
77
},
88
"extends": "../../tsconfig.json",
99
"include": ["src/**/*"]

code/lib/eslint-plugin/docs/rules/no-stories-of.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Examples of **incorrect** code for this rule:
1414

1515
```js
1616
import { storiesOf } from '@storybook/react';
17-
1817
import Button from '../components/Button';
1918

2019
storiesOf('Button', module).add('primary', () => <Button primary />);

0 commit comments

Comments
 (0)