chore(striker-ui): turn off eslint react/jsx-props-no-spreading

main
Tsu-ba-me 3 years ago
parent ab4f5bdfe5
commit 70f06e47e5
  1. 1
      striker-ui/.eslintrc.json
  2. 8
      striker-ui/components/AnvilDrawer.tsx
  3. 4
      striker-ui/components/Autocomplete.tsx
  4. 1
      striker-ui/components/ContainedButton.tsx
  5. 1
      striker-ui/components/Header.tsx
  6. 1
      striker-ui/components/InputMessageBox.tsx
  7. 1
      striker-ui/components/MenuItem.tsx
  8. 1
      striker-ui/components/MessageBox.tsx
  9. 1
      striker-ui/components/OutlinedInput/OutlinedInput.tsx
  10. 1
      striker-ui/components/OutlinedInputLabel/OutlinedInputLabel.tsx
  11. 4
      striker-ui/components/OutlinedInputWithLabel.tsx
  12. 3
      striker-ui/components/OutlinedLabeledInputWithSelect.tsx
  13. 1
      striker-ui/components/ProvisionServerDialog.tsx
  14. 1
      striker-ui/components/Select.tsx
  15. 3
      striker-ui/components/SelectWithLabel.tsx
  16. 3
      striker-ui/components/Slider.tsx
  17. 5
      striker-ui/pages/_app.tsx
  18. 8
      striker-ui/pages/_document.tsx

@ -54,6 +54,7 @@
// Importing React is not required in Next.js // Importing React is not required in Next.js
"react/react-in-jsx-scope": "off", "react/react-in-jsx-scope": "off",
"react/jsx-curly-newline": "off", "react/jsx-curly-newline": "off",
"react/jsx-props-no-spreading": "off",
"@next/next/no-img-element": "off", "@next/next/no-img-element": "off",
"@typescript-eslint/camelcase": "off" "@typescript-eslint/camelcase": "off"
}, },

@ -82,13 +82,7 @@ const AnvilDrawer = ({ open, setOpen }: DrawerProps): JSX.Element => (
> >
<Box display="flex" flexDirection="row" width="100%"> <Box display="flex" flexDirection="row" width="100%">
<Box> <Box>
<img <img alt="" key="icon" src={icon.image} {...ICON_SIZE} />
alt=""
key="icon"
src={icon.image}
// eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE}
/>
</Box> </Box>
<Box flexGrow={1} className={classes.text}> <Box flexGrow={1} className={classes.text}>
<BodyText text={icon.text} /> <BodyText text={icon.text} />

@ -45,7 +45,6 @@ type AutocompleteProps<
const GrowPaper = (paperProps: MUIPaperProps): JSX.Element => ( const GrowPaper = (paperProps: MUIPaperProps): JSX.Element => (
<MUIGrow in> <MUIGrow in>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<MUIPaper {...paperProps} /> <MUIPaper {...paperProps} />
</MUIGrow> </MUIGrow>
); );
@ -103,7 +102,6 @@ const Autocomplete = <
extendRenderInput?.call(null, inputWithLabelProps, renderInputParams); extendRenderInput?.call(null, inputWithLabelProps, renderInputParams);
// eslint-disable-next-line react/jsx-props-no-spreading
return <OutlinedInputWithLabel {...inputWithLabelProps} />; return <OutlinedInputWithLabel {...inputWithLabelProps} />;
}); });
const combinedSx = { const combinedSx = {
@ -122,7 +120,6 @@ const Autocomplete = <
return ( return (
<Box sx={{ display: 'flex', flexDirection: 'column' }}> <Box sx={{ display: 'flex', flexDirection: 'column' }}>
<MUIAutocomplete <MUIAutocomplete
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
PaperComponent: GrowPaper, PaperComponent: GrowPaper,
...autocompleteRestProps, ...autocompleteRestProps,
@ -131,7 +128,6 @@ const Autocomplete = <
sx: combinedSx, sx: combinedSx,
}} }}
/> />
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<InputMessageBox {...messageBoxProps} /> <InputMessageBox {...messageBoxProps} />
</Box> </Box>
); );

@ -25,7 +25,6 @@ const ContainedButton = (
return ( return (
<MUIButton <MUIButton
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
variant: 'contained', variant: 'contained',
...containedButtonProps, ...containedButtonProps,

@ -82,7 +82,6 @@ const Header = (): JSX.Element => {
alt="" alt=""
key="icon" key="icon"
src={icon.image} src={icon.image}
// eslint-disable-next-line react/jsx-props-no-spreading
{...ICON_SIZE} {...ICON_SIZE}
className={classes.icons} className={classes.icons}
/> />

@ -10,7 +10,6 @@ const InputMessageBox: FC<Partial<MessageBoxProps>> = ({
<> <>
{text && ( {text && (
<MessageBox <MessageBox
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ ...restProps, sx: { marginTop: '.4em', ...sx }, text }} {...{ ...restProps, sx: { marginTop: '.4em', ...sx }, text }}
/> />
)} )}

@ -38,7 +38,6 @@ const MenuItem = (menuItemProps: MUIMenuItemProps): JSX.Element => {
return ( return (
<MUIMenuItem <MUIMenuItem
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
...menuItemProps, ...menuItemProps,
sx: combinedSx, sx: combinedSx,

@ -111,7 +111,6 @@ const MessageBox: FC<MessageBoxProps> = ({
return isShow ? ( return isShow ? (
<Box <Box
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
...boxProps, ...boxProps,
className: buildMessageBoxClasses(type), className: buildMessageBoxClasses(type),

@ -41,7 +41,6 @@ const OutlinedInput: FC<OutlinedInputProps> = (outlinedInputProps) => {
return ( return (
<MUIOutlinedInput <MUIOutlinedInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
label, label,
...outlinedInputRestProps, ...outlinedInputRestProps,

@ -45,7 +45,6 @@ const OutlinedInputLabel = (
return ( return (
<MUIInputLabel <MUIInputLabel
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
// 1. Specify default props. // 1. Specify default props.
variant, variant,

@ -39,14 +39,11 @@ const OutlinedInputWithLabel = ({
label, label,
messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps, messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps,
}: OutlinedInputWithLabelProps): JSX.Element => ( }: OutlinedInputWithLabelProps): JSX.Element => (
// eslint-disable-next-line react/jsx-props-no-spreading
<MUIFormControl {...formControlProps}> <MUIFormControl {...formControlProps}>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}> <OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}>
{label} {label}
</OutlinedInputLabel> </OutlinedInputLabel>
<OutlinedInput <OutlinedInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
fullWidth: formControlProps.fullWidth, fullWidth: formControlProps.fullWidth,
id, id,
@ -54,7 +51,6 @@ const OutlinedInputWithLabel = ({
...inputProps, ...inputProps,
}} }}
/> />
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<InputMessageBox {...messageBoxProps} /> <InputMessageBox {...messageBoxProps} />
</MUIFormControl> </MUIFormControl>
); );

@ -70,7 +70,6 @@ const OutlinedLabeledInputWithSelect: FC<
}} }}
> >
<OutlinedInputWithLabel <OutlinedInputWithLabel
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
id, id,
label, label,
@ -78,7 +77,6 @@ const OutlinedLabeledInputWithSelect: FC<
}} }}
/> />
<SelectWithLabel <SelectWithLabel
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
id: `${id}-nested-select`, id: `${id}-nested-select`,
selectItems, selectItems,
@ -86,7 +84,6 @@ const OutlinedLabeledInputWithSelect: FC<
}} }}
/> />
</Box> </Box>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<InputMessageBox {...messageBoxProps} /> <InputMessageBox {...messageBoxProps} />
</Box> </Box>
); );

@ -388,7 +388,6 @@ const createOutlinedSlider = (
sliderProps?: Partial<SliderProps>, sliderProps?: Partial<SliderProps>,
): JSX.Element => ( ): JSX.Element => (
<Slider <Slider
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
isAllowTextInput: true, isAllowTextInput: true,
label, label,

@ -64,7 +64,6 @@ const Select: FC<SelectProps> = (selectProps) => {
return ( return (
<MUISelect <MUISelect
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
endAdornment: clearIndicator, endAdornment: clearIndicator,
...muiSelectProps, ...muiSelectProps,

@ -63,13 +63,11 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
}) => ( }) => (
<MUIFormControl> <MUIFormControl>
{label && ( {label && (
// eslint-disable-next-line react/jsx-props-no-spreading
<OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}> <OutlinedInputLabel {...{ htmlFor: id, ...inputLabelProps }}>
{label} {label}
</OutlinedInputLabel> </OutlinedInputLabel>
)} )}
<Select <Select
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
id, id,
input: <OutlinedInput {...{ label }} />, input: <OutlinedInput {...{ label }} />,
@ -92,7 +90,6 @@ const SelectWithLabel: FC<SelectWithLabelProps> = ({
</MenuItem> </MenuItem>
))} ))}
</Select> </Select>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<InputMessageBox {...messageBoxProps} /> <InputMessageBox {...messageBoxProps} />
</MUIFormControl> </MUIFormControl>
); );

@ -133,7 +133,6 @@ const createOutlinedInput = ({
isFocused?: boolean; isFocused?: boolean;
}) => ( }) => (
<OutlinedInput <OutlinedInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
key, key,
className: isFocused ? muiOutlinedInputClasses.focused : '', className: isFocused ? muiOutlinedInputClasses.focused : '',
@ -222,7 +221,6 @@ const Slider = ({
}} }}
> >
<OutlinedInputLabel <OutlinedInputLabel
// eslint-disable-next-line react/jsx-props-no-spreading
{...{ {...{
className: isFocused ? muiInputLabelClasses.focused : '', className: isFocused ? muiInputLabelClasses.focused : '',
id: labelId, id: labelId,
@ -288,7 +286,6 @@ const Slider = ({
}), }),
)} )}
</Box> </Box>
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
<InputMessageBox {...messageBoxProps} /> <InputMessageBox {...messageBoxProps} />
</FormControl> </FormControl>
); );

@ -20,10 +20,7 @@ const App = ({
}: MyAppProps): JSX.Element => ( }: MyAppProps): JSX.Element => (
<CacheProvider value={emotionCache}> <CacheProvider value={emotionCache}>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<Component <Component {...pageProps} />
// eslint-disable-next-line react/jsx-props-no-spreading
{...pageProps}
/>
</ThemeProvider> </ThemeProvider>
</CacheProvider> </CacheProvider>
); );

@ -19,13 +19,7 @@ class MyDocument extends Document {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
enhanceApp: (App: any) => enhanceApp: (App: any) =>
function EnhanceApp(props) { function EnhanceApp(props) {
return ( return <App emotionCache={emotionCache} {...props} />;
<App
emotionCache={emotionCache}
/* eslint-disable react/jsx-props-no-spreading */
{...props}
/>
);
}, },
}); });

Loading…
Cancel
Save