🌈 style(eslint): add eslint rules

This commit is contained in:
xuan
2022-11-26 14:35:05 +08:00
parent f3aa20f049
commit 99a920975f
245 changed files with 14909 additions and 14349 deletions
+12 -12
View File
@@ -1,9 +1,9 @@
import React, { FC, MutableRefObject } from "react"
import SelectSaleType from "../SelectSaleType"
import SelectTimePicker from "../SelectTimePicker"
import type { FC } from 'react'
import React, { MutableRefObject } from 'react'
import SelectSaleType from '../SelectSaleType'
import SelectTimePicker from '../SelectTimePicker'
import SelectMarketingDepartment from '../SelectMarketingDepartment'
interface PropsType {
children?: React.ReactNode
}
@@ -11,23 +11,23 @@ interface PropsType {
const GroupItem = [
SelectMarketingDepartment.name,
SelectSaleType.name,
SelectTimePicker.name
SelectTimePicker.name,
]
const SelectGroup: FC<PropsType> = (props: PropsType) => {
const {children} = props
const { children } = props
function handleChange(children,childEle) {
return function (value: any){
function handleChange(children, childEle) {
return function(value: any) {
childEle.props.onChange(value)
children.forEach((child)=>{
children.forEach((child) => {
child.ref?.current.closePopup()
})
}
}
function handleCloseOverlay(children) {
return function (){
children.forEach((child)=>{
return function() {
children.forEach((child) => {
child.ref?.current.closePopup()
})
}
@@ -36,7 +36,7 @@ const SelectGroup: FC<PropsType> = (props: PropsType) => {
const renderChildren = () => {
return React.Children.map(children, (child) => {
const childEle = child as React.FunctionComponentElement<any>
return React.cloneElement(childEle, {onChange: handleChange(children,childEle), onCloseOverlay: handleCloseOverlay(children)})
return React.cloneElement(childEle, { onChange: handleChange(children, childEle), onCloseOverlay: handleCloseOverlay(children) })
})
}
return <>{renderChildren()}</>