Skip to content

Commit

Permalink
fix: lint config; fix: ts & lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vikdiesel committed Sep 14, 2022
1 parent 235555e commit 2d99bc1
Show file tree
Hide file tree
Showing 22 changed files with 226 additions and 40 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["next/core-web-vitals", "eslint-config-prettier", 'eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
};
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion components/AsideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {
menu: MenuAsideItem[]
isAsideMobileExpanded: boolean
isAsideLgActive: boolean
onAsideLgClose: Function
onAsideLgClose: () => void
}

export default function AsideMenu({
Expand Down
2 changes: 1 addition & 1 deletion components/AsideMenuLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useAppSelector } from '../src/stores/hooks'
type Props = {
menu: MenuAsideItem[]
className?: string
onAsideLgCloseClick: Function
onAsideLgCloseClick: () => void
}

export default function AsideMenuLayer({ menu, className = '', ...props }: Props) {
Expand Down
2 changes: 1 addition & 1 deletion components/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Props = {
disabled?: boolean
roundedFull?: boolean
isGrouped?: boolean
onClick?: Function
onClick?: (e: React.MouseEvent) => void
}

export default function BaseButton({
Expand Down
2 changes: 1 addition & 1 deletion components/BaseButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Children, cloneElement, ReactNode } from 'react'
import React, { ReactNode } from 'react'

type Props = {
type?: string
Expand Down
2 changes: 1 addition & 1 deletion components/CardBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props = {
isModal?: boolean
children: ReactNode
footer?: ReactNode
onClick?: Function
onClick?: (e: React.MouseEvent) => void
}

export default function CardBox({
Expand Down
2 changes: 1 addition & 1 deletion components/CardBoxClient.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mdiTrendingDown, mdiTrendingNeutral, mdiTrendingUp } from '@mdi/js'
import React from 'react'
import { Client, ColorKey } from '../interfaces'
import { Client } from '../interfaces'
import BaseLevel from './BaseLevel'
import CardBox from './CardBox'
import PillTag from './PillTag'
Expand Down
2 changes: 1 addition & 1 deletion components/CardBoxTransaction.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mdiCashMinus, mdiCashPlus, mdiCreditCard, mdiReceipt } from '@mdi/js'
import React from 'react'
import { ColorKey, Transaction } from '../interfaces'
import { Transaction } from '../interfaces'
import BaseLevel from './BaseLevel'
import CardBox from './CardBox'
import IconRounded from './IconRounded'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import BaseButton from './BaseButton'
import BaseIcon from './BaseIcon'
import BaseLevel from './BaseLevel'
import CardBox from './CardBox'
import NumberDynamic from './NumberDynamic'
import PillTagTrend from './PillTagTrend'

type Props = {
Expand Down
4 changes: 1 addition & 3 deletions components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ type Props = {
export default function NavBar({ menu, className = '', children }: Props) {
const [isMenuNavBarActive, setIsMenuNavBarActive] = useState(false)

const handleMenuNavBarToggleClick = (e: MouseEvent) => {
e.preventDefault()

const handleMenuNavBarToggleClick = () => {
setIsMenuNavBarActive(!isMenuNavBarActive)
}

Expand Down
2 changes: 1 addition & 1 deletion components/NavBarItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function NavBarItem({ item }: Props) {

const itemLabel = item.isCurrentUser ? userName : item.label

const handleMenuClick = (e: React.MouseEvent) => {
const handleMenuClick = () => {
if (item.menu) {
setIsDropdownActive(!isDropdownActive)
}
Expand Down
10 changes: 2 additions & 8 deletions components/NavBarItemPlain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Props = {
display?: string
useMargin?: boolean
children: ReactNode
onClick?: Function
onClick?: (e: React.MouseEvent) => void
}

export default function NavBarItemPlain({
Expand All @@ -22,14 +22,8 @@ export default function NavBarItemPlain({
useMargin ? 'my-2 mx-3' : 'py-2 px-3'
}`

const handleClick = (e: React.MouseEvent) => {
if (onClick) {
onClick(e)
}
}

return (
<div className={`${classBase} ${classAddon}`} onClick={handleClick}>
<div className={`${classBase} ${classAddon}`} onClick={onClick}>
{children}
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion components/OverlayLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Props = {
zIndex?: string
type?: string
children?: ReactNode
onClick: Function
onClick: (e: React.MouseEvent) => void
}

export default function OverlayLayer({
Expand Down
1 change: 0 additions & 1 deletion components/PillTagTrend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
mdiChevronDown,
mdiAlertCircleOutline,
mdiInformationOutline,
mdiCheckAll,
mdiCheckCircleOutline,
mdiAlertOutline,
} from '@mdi/js'
Expand Down
2 changes: 1 addition & 1 deletion components/SectionFullScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = {
children: ReactNode
}

export default function SectionFullScreen({ bg, children }) {
export default function SectionFullScreen({ bg, children }: Props) {
const darkMode = useAppSelector((state) => state.style.darkMode)

let componentClass = 'flex min-h-screen items-center justify-center '
Expand Down
2 changes: 1 addition & 1 deletion components/UserAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @next/next/no-img-element */
// Why disabled:
// Why disabled:
// avatars.dicebear.com provides svg avatars
// next/image needs dangerouslyAllowSVG option for that

Expand Down
Loading

0 comments on commit 2d99bc1

Please sign in to comment.