Skip to content

Commit

Permalink
feat: resolve eslint console
Browse files Browse the repository at this point in the history
  • Loading branch information
kris liu authored and kris-liu-smile committed Nov 22, 2022
1 parent b5a6313 commit e39aac7
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 43 deletions.
1 change: 1 addition & 0 deletions apps/storefront/src/components/B3InfiniteScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const B3InfiniteScroll = (props: InfiniteScrollProps) => {

const handleLoadMore = () => {
if (!isLoading) {
console.log(allCount)
onPaginationChange({
offset: offset + first,
first,
Expand Down
8 changes: 4 additions & 4 deletions apps/storefront/src/components/filter/B3FilterPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
Box,
} from '@mui/material'

import {
useMobile,
} from '@/hooks'
// import {
// useMobile,
// } from '@/hooks'

import {
distanceDay,
Expand Down Expand Up @@ -53,7 +53,7 @@ const B3FilterPickers = ({
pickerKey: endPickerKey = 'end',
} = endPicker

const [isMobile] = useMobile()
// const [isMobile] = useMobile()

const [startValue, setStartValue] = useState<Date | number | string>(startDateDefaultValue)
const [endValue, setEndValue] = useState<Date | number | string>(endDateDefaultValue)
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/components/form/B3ControlPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
TextField,
} from '@mui/material'
import {
useState,
} from 'react'
// import {
// useState,
// } from 'react'
import {
Controller,
} from 'react-hook-form'
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/components/layout/B3Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
useContext,
} from 'react'
import {
styled,
} from '@mui/material/styles'
// import {
// styled,
// } from '@mui/material/styles'

import {
Box,
Expand Down
2 changes: 0 additions & 2 deletions apps/storefront/src/components/layout/B3Mainheader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
useState,
useEffect,
useContext,
} from 'react'

Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/components/layout/B3Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const B3Nav = ({
const {
state: {
isB2BUser,
isAgenting,
role,
// isAgenting,
// role,
},
} = useContext(GlobaledContext)

Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/components/layout/B3RenderRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export const B3RenderRouter = (props: B3RenderRouterProps) => {
const {
state: {
isB2BUser,
isAgenting,
role,
// isAgenting,
// role,
},
} = useContext(GlobaledContext)

Expand Down
4 changes: 2 additions & 2 deletions apps/storefront/src/pages/dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import {

import {
B3SStorage,
storeHash,
// storeHash,
} from '@/utils'

const Dashboard = () => {
const {
state: {
isB2BUser,
isAgenting,
// isAgenting,
role,
customerId,
B3UserId,
Expand Down
1 change: 0 additions & 1 deletion apps/storefront/src/pages/login/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ const ForgotPassword = (props: ForgotPasswordProps) => {
setLoading(false)
navigate('/login?loginFlag=2')
} catch (e) {
// eslint-disable-next-line no-console
console.log(e)
}
}
Expand Down
1 change: 0 additions & 1 deletion apps/storefront/src/pages/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ export default function Login(props:RegisteredProps) {
setLogo(registerLogo)
setLoading(false)
} catch (e) {
// eslint-disable-next-line no-console
console.log(e)
}
}
Expand Down
1 change: 0 additions & 1 deletion apps/storefront/src/pages/login/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import {
B3Lang,
} from '@b3/lang'
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/pages/order/components/OrderStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ReactNode,
} from 'react'
// import {
// ReactNode,
// } from 'react'

import {
B3Tag,
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/pages/order/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import {
distanceDay,
} from '@/utils'

import {
orderStatusCode,
} from './shared/getOrderStatus'
// import {
// orderStatusCode,
// } from './shared/getOrderStatus'

export interface FilterSearchProps {
[key: string]: string | number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
OrderCurrency,
} from '../../../types'

interface OrderDialogProps<T> {
interface OrderDialogProps {
open: boolean,
setOpen: (open: boolean) => void,
products?: OrderProductItem[],
Expand All @@ -45,7 +45,7 @@ interface OrderDialogProps<T> {
currencyInfo: OrderCurrency,
}

export const OrderDialog: <T>(props: OrderDialogProps<T>) => ReactElement = ({
export const OrderDialog: (props: OrderDialogProps) => ReactElement = ({
open,
products = [],
type,
Expand Down Expand Up @@ -150,6 +150,7 @@ export const OrderDialog: <T>(props: OrderDialogProps<T>) => ReactElement = ({
<OrderCheckboxProduct
products={editableProducts}
onProductChange={handleProductChange}
currencyInfo={currencyInfo}
/>
</DialogContent>

Expand Down
1 change: 0 additions & 1 deletion apps/storefront/src/pages/registered/RegisterComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ export default function RegisterComplete(props: RegisterCompleteProps) {

return fileList
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
throw error
}
Expand Down
3 changes: 0 additions & 3 deletions apps/storefront/src/pages/registered/Registered.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ export default function Registered(props: RegisteredProps) {
}
setLogo(registerLogo)
} catch (e) {
// eslint-disable-next-line no-console
console.log(e)
}
}
Expand Down Expand Up @@ -261,7 +260,6 @@ export default function Registered(props: RegisteredProps) {
await loginCheckout(data)
window.location.reload()
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
}
} else {
Expand All @@ -286,7 +284,6 @@ export default function Registered(props: RegisteredProps) {
}
clearRegisterInfo()
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
}
}
Expand Down
4 changes: 0 additions & 4 deletions apps/storefront/src/pages/registered/RegisteredBCToB2B.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export default function RegisteredBCToB2B(props: RegisteredProps) {
}
setLogo(registerLogo)
} catch (e) {
// eslint-disable-next-line no-console
console.error(e)
}
}
Expand Down Expand Up @@ -290,7 +289,6 @@ export default function RegisteredBCToB2B(props: RegisteredProps) {

return fileList
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
throw error
}
Expand Down Expand Up @@ -394,7 +392,6 @@ export default function RegisteredBCToB2B(props: RegisteredProps) {
setErrorMessage('')
return true
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
throw error
}
Expand Down Expand Up @@ -444,7 +441,6 @@ export default function RegisteredBCToB2B(props: RegisteredProps) {
}
}
} catch (err: any) {
// eslint-disable-next-line no-console
console.log(err)
setErrorMessage(err?.message || err)
} finally {
Expand Down
6 changes: 3 additions & 3 deletions apps/storefront/src/pages/seleRep/SeleRep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import {

import {
B3SStorage,
storeHash,
// storeHash,
} from '@/utils'

const SeleRep = () => {
const {
state: {
isB2BUser,
isAgenting,
// isB2BUser,
// isAgenting,
role,
customerId,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/shared/service/bc/api/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ import {

export const getBCForgotPassword = (data: CustomFieldItems): CustomFieldItems => B3Request.post(`${bcBaseUrl}/login.php?action=send_password_email`, RequestType.BCRest, data)

export const getBcCurrentJWT = (data: CustomFieldItems): CustomFieldItems => B3Request.get(`${bcBaseUrl}/customer/current.jwt`, RequestType.BCRest, data)
export const getBcCurrentJWT = (data: CustomFieldItems) => B3Request.get(`${bcBaseUrl}/customer/current.jwt`, RequestType.BCRest, data)
2 changes: 1 addition & 1 deletion apps/storefront/src/shared/service/request/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

const originFetch = window.fetch

function b3Fetch<T>(path: string, init: any, type?: string) {
function b3Fetch(path: string, init: any, type?: string) {
return new Promise((resolve, reject) => {
originFetch(path, init).then((res: Response) => (path.includes('current.jwt') ? res.text() : res.json())).then(async (res) => {
if (res?.code === 500) {
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/utils/loginInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const getCurrentJwtAndB2BToken = async (userType: number) => {
if (userType === 3) {
const data = await getB2BToken(res)
if (data) {
const B3B2BToken: string = (data as B2BToken).authorization.result.token
const B3B2BToken = (data as B2BToken).authorization.result.token
B3SStorage.set('B3B2BToken', B3B2BToken)
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-b3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'no-shadow': 0,
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-console': 'off',
semi: ['error', 'never'],
quotes: ['error', 'single'],
'max-len': [
Expand Down

0 comments on commit e39aac7

Please sign in to comment.