mirror of
https://github.com/SomboChea/ui
synced 2026-01-17 00:25:50 +07:00
feat(eslint-config): add order rule in import
* refactor: added eslint-plugin-import * refactor: disable some rules for muiComponents * fix: fixed import
This commit is contained in:
committed by
Sergio Hg
parent
950f6defca
commit
ae73772a37
8
src/muiComponents/.eslintrc
Normal file
8
src/muiComponents/.eslintrc
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"rules": {
|
||||
"verdaccio/jsx-spread": 0,
|
||||
"react/display-name": 0,
|
||||
"react/jsx-sort-props": 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import { default as MaterialUIAvatar, AvatarProps } from '@material-ui/core/Avat
|
||||
// The default element type of MUI's Avatar is 'div' and we don't allow the change of this prop
|
||||
type AvatarRef = HTMLElementTagNameMap['div'];
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
// eslint-disable-next-line react/display-name
|
||||
const Avatar = forwardRef<AvatarRef, AvatarProps>(function Avatar(props, ref) {
|
||||
return <MaterialUIAvatar {...props} ref={ref} />;
|
||||
});
|
||||
|
||||
@@ -3,8 +3,6 @@ import { default as MaterialUIButton, ButtonProps } from '@material-ui/core/Butt
|
||||
|
||||
type ButtonRef = HTMLElementTagNameMap['button'];
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
// eslint-disable-next-line react/display-name
|
||||
const Button = forwardRef<ButtonRef, ButtonProps>(function Button(props, ref) {
|
||||
return <MaterialUIButton {...props} ref={ref} />;
|
||||
});
|
||||
|
||||
@@ -3,8 +3,6 @@ import { default as MaterialUIIconButton, IconButtonProps } from '@material-ui/c
|
||||
|
||||
type IconButtonRef = HTMLElementTagNameMap['button'];
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
// eslint-disable-next-line react/display-name
|
||||
const IconButton = forwardRef<IconButtonRef, IconButtonProps>(function IconButton(props, ref) {
|
||||
return <MaterialUIIconButton {...props} ref={ref} />;
|
||||
});
|
||||
|
||||
@@ -4,17 +4,15 @@ import { default as MaterialUITextField, TextFieldProps } from '@material-ui/cor
|
||||
// The default element type of MUI's TextField is 'div'
|
||||
type TextFieldRef = HTMLElementTagNameMap['div'];
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
// eslint-disable-next-line react/display-name
|
||||
const TextField = forwardRef<TextFieldRef, TextFieldProps>(function ToolTip({ InputProps, classes, ...props }, ref) {
|
||||
return (
|
||||
<MaterialUITextField
|
||||
{...props}
|
||||
innerRef={ref}
|
||||
InputProps={{
|
||||
...InputProps,
|
||||
classes,
|
||||
}}
|
||||
innerRef={ref}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -4,8 +4,6 @@ import { default as MaterialUITooltip, TooltipProps } from '@material-ui/core/To
|
||||
// The default element type of MUI's Tooltip is 'div' and the change of this prop is not allowed
|
||||
type TooltipRef = HTMLElementTagNameMap['div'];
|
||||
|
||||
/* eslint-disable verdaccio/jsx-spread */
|
||||
// eslint-disable-next-line react/display-name
|
||||
const Tooltip = forwardRef<TooltipRef, TooltipProps>(function ToolTip(props, ref) {
|
||||
return <MaterialUITooltip {...props} innerRef={ref} />;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user