Skip to content

Commit

Permalink
updates(eslint): enable require-await rule (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
manojava-gk authored Dec 5, 2023
1 parent bda2267 commit 5370703
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@typescript-eslint/no-unnecessary-type-assertion": 0,
"@typescript-eslint/prefer-includes": 0,
"@typescript-eslint/promise-function-async": 0,
"@typescript-eslint/require-await": 0,
"@typescript-eslint/restrict-plus-operands": 0,
"@typescript-eslint/triple-slash-reference": 0,
"@typescript-eslint/unbound-method": 0,
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Overlays
- Change Overlay Button from "Cancel" to "Close"
- ESLINT
- Enable require-await rule
- Enable return-await rule
- Enable prefer-reduce-type-parameter rule
- Enable prefer-readonly rule
Expand Down
6 changes: 4 additions & 2 deletions src/components/overlays/AddAppUserRoles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function AddAppUserRoles() {
const [activeStep, setActiveStep] = useState(1)
const [updateUserRoles] = useUpdateUserRolesMutation()

const handleConfirm = async () => {
const handleConfirm = () => {
if (!appId || !users || roles.length <= 0) return

users.map(async (user) => {
Expand Down Expand Up @@ -162,7 +162,9 @@ export default function AddAppUserRoles() {
</Button>
<Button
variant="contained"
onClick={() => handleConfirm()}
onClick={() => {
handleConfirm()
}}
disabled={!users || roles.length <= 0}
>
{t('content.addUserRight.confirmSelectedRoles')}
Expand Down
6 changes: 3 additions & 3 deletions src/components/overlays/AddMultipleUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ export default function AddMultipleUser() {
}
}

const handleConfirm = async () => {
const handleConfirm = () => {
if (isSuccess || isError) dispatch(closeOverlay())
if (uploadedFile && !roles.length) setIsFileUploaded(true)
else if (uploadedFile && roles.length) {
setLoading(true)
uploadedFile &&
Papa.parse(uploadedFile, {
skipEmptyLines: true,
complete: async (results) => {
complete: (results) => {
const csvData: Array<Array<string>> = results.data as Array<
Array<string>
>
Expand All @@ -192,7 +192,7 @@ export default function AddMultipleUser() {
}
}

const onChangeFile = async (selectedFile: File) => {
const onChangeFile = (selectedFile: File) => {
setUploadedFile(undefined)
Papa.parse(selectedFile, {
skipEmptyLines: true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/AppOverview/AddRoles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function AddRoles() {
refetch()
}, [state])

const handleSaveClick = async () => {
const handleSaveClick = () => {
setIsLoading(true)
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/AppOverview/ChangeDocuments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function ChangeDocuments() {
await updateAppChangeDocument(data).unwrap()
}

const onFileUpload = async (file: DropzoneFile) => {
const onFileUpload = (file: DropzoneFile) => {
if (appId && file) {
const setFileStatus = (status: UploadStatus) => {
setValue('uploadDocument', {
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/AppOverview/ChangeImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function ChangeImage() {
const uploadImageValue = getValues()
.uploadLeadImage as unknown as DropzoneFile

const handleSaveClick = async () => {
const handleSaveClick = () => {
setIsLoading(true)
if (appId && uploadImageValue) {
const setFileStatus = (status: UploadFileStatus) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/IDPManagement/IDPList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const MenuItemOpenOverlay = ({
}) => {
const dispatch = useDispatch()

const openOverlay = async (
const openOverlay = (
e: React.MouseEvent<HTMLElement, MouseEvent>,
overlay: OVERLAYS,
id: string
Expand All @@ -68,9 +68,9 @@ const MenuItemOpenOverlay = ({

return (
<MenuItem
onClick={(e: React.MouseEvent<HTMLElement, MouseEvent>) =>
onClick={(e: React.MouseEvent<HTMLElement, MouseEvent>) => {
openOverlay(e, overlay, id)
}
}}
>
{label}
</MenuItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default function NotificationItem({
setUserRead(item.userRead)
}, [item.userRead])

const toggle = async () => {
const toggle = () => {
const nextState = !open
if (nextState && !userRead) {
setUserRead(true)
Expand Down

0 comments on commit 5370703

Please sign in to comment.