Remove the {...props} pattern and props coupling, and create an eslint rule for that (#1733)
* Remove the {...props} pattern and props coupling, and create an eslint rule for that
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
* Add another test to the new rule
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
---------
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
This commit is contained in:
@ -126,6 +126,7 @@ export const Radio = ({
|
||||
};
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...restProps} labelPosition={labelPosition}>
|
||||
<StyledRadioInput
|
||||
type="radio"
|
||||
|
||||
@ -104,6 +104,7 @@ export const ImageInput = ({
|
||||
};
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...restProps}>
|
||||
<StyledPicture
|
||||
withPicture={!!picture}
|
||||
|
||||
@ -71,6 +71,7 @@ export const SingleEntitySelect = <
|
||||
/>
|
||||
<StyledDropdownMenuSeparator />
|
||||
<SingleEntitySelectBase
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
{...props}
|
||||
onCancel={onCancel}
|
||||
onCreate={onCreate}
|
||||
|
||||
@ -41,6 +41,7 @@ const meta: Meta<typeof SingleEntitySelect> = {
|
||||
|
||||
return (
|
||||
<SingleEntitySelect
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
{...args}
|
||||
entitiesToSelect={entities.filter(
|
||||
(entity) =>
|
||||
|
||||
@ -170,6 +170,7 @@ const TextInputComponent = (
|
||||
onChange(event.target.value);
|
||||
}
|
||||
}}
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
{...props}
|
||||
/>
|
||||
<StyledTrailingIconContainer>
|
||||
|
||||
@ -28,6 +28,7 @@ const FakeTextInput = ({
|
||||
const [value, setValue] = useState(initialValue);
|
||||
return (
|
||||
<TextInputSettings
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
{...props}
|
||||
value={value}
|
||||
onChange={(text) => {
|
||||
@ -41,6 +42,7 @@ const FakeTextInput = ({
|
||||
export const Default: Story = {
|
||||
argTypes: { value: { control: false } },
|
||||
args: { value: 'A good value ' },
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
render: (args) => <FakeTextInput {...args} />,
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
Reference in New Issue
Block a user