Skip to content

Commit

Permalink
Turn off no-undef as TypeScript handles it, lint --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
amjithtitus09 committed Dec 16, 2024
1 parent eb5728a commit ffa6d1a
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 14 deletions.
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default [
globals: {
...globals.browser,
...globals.node,
React: true,
},
parserOptions: {
ecmaFeatures: {
Expand Down Expand Up @@ -72,6 +73,7 @@ export default [
},
],
"@typescript-eslint/no-explicit-any": "warn",
"no-undef": "off",
},
},

Expand Down
3 changes: 1 addition & 2 deletions src/CAREUI/interactive/SlideOver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default function SlideOver({
<Dialog
as="div"
className="relative z-30"
// eslint-disable-next-line @typescript-eslint/no-empty-function
onClose={closeOnBackdropClick ? setOpen : () => {}}
>
<TransitionChild
Expand Down Expand Up @@ -117,7 +116,7 @@ export default function SlideOver({
className="flex h-8 w-8 items-center justify-center rounded-lg text-2xl hover:bg-black/20"
onClick={() => {
setOpen(false);
onCloseClick && onCloseClick();
onCloseClick?.();
}}
>
<CareIcon icon="l-arrow-left" />
Expand Down
3 changes: 1 addition & 2 deletions src/Locale/update_locale.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-undef */
import {
existsSync,
mkdirSync,
Expand Down Expand Up @@ -61,7 +60,7 @@ function getAllJSONFiles(folderName) {
dir.forEach((file) => {
try {
files[file] = JSON.parse(readFile(`./${folderName}/${file}`));
} catch (e) {
} catch {
throw new Error(`Cannot parse ${file} file!`);
}
});
Expand Down
1 change: 0 additions & 1 deletion src/PluginEngine.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable i18next/no-literal-string */
import React, { Suspense } from "react";

import ErrorBoundary from "@/components/Common/ErrorBoundary";
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/HistoryAPIProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useLocationChange } from "raviger";
import { ReactNode, createContext, useState } from "react";

export const HistoryContext = createContext<string[]>([]);
// eslint-disable-next-line @typescript-eslint/no-empty-function

export const ResetHistoryContext = createContext(() => {});

export default function HistoryAPIProvider(props: { children: ReactNode }) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/Common/ExcelFIleDragAndDrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ExcelFileDragAndDrop({
const closeModal = () => {
setSelectedFile(undefined);
setFileData([]);
onClose && onClose();
onClose?.();
};

const onSelectFile = (file: Blob) => {
Expand Down Expand Up @@ -98,7 +98,7 @@ export default function ExcelFileDragAndDrop({
setParsedData(parsedData);
setValidData(ParsedDataWithOutErrors);
if (ParsedDataWithOutErrors.length !== 0) {
setIsValid && setIsValid(true);
setIsValid?.(true);
}
}
}, [fileData]);
Expand Down Expand Up @@ -199,7 +199,7 @@ export default function ExcelFileDragAndDrop({
setFileData([]);
setErrors([]);
setValidData([]);
setIsValid && setIsValid(false);
setIsValid?.(false);
dragProps.setDragOver(false);
dragProps.setFileDropError("");
}}
Expand Down Expand Up @@ -229,6 +229,7 @@ export default function ExcelFileDragAndDrop({
target="_blank"
download
onClick={(e) => e.stopPropagation()}
rel="noreferrer"
>
<CareIcon
icon="l-download-alt"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const SidebarShrinkContext = createContext<{
setShrinked: (state: boolean) => void;
}>({
shrinked: false,
// eslint-disable-next-line @typescript-eslint/no-empty-function

setShrinked: () => {},
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/Resource/ResourceBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function BoardView() {
cacheBlacklist: ["title"],
});
const [boardFilter, setBoardFilter] = useState(ACTIVE);
// eslint-disable-next-line

const appliedFilters = formatFilter(qParams);
const { t } = useTranslation();

Expand Down
3 changes: 0 additions & 3 deletions src/service-worker.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/// <reference lib="webworker" />

/* eslint-disable no-restricted-globals */
// This service worker can be customized!
// See https://developers.google.com/web/tools/workbox/modules
// for the list of available Workbox modules, or add any other
Expand All @@ -13,7 +11,6 @@ import { precacheAndRoute } from "workbox-precaching";

declare const self: ServiceWorkerGlobalScope;

// eslint-disable-next-line no-restricted-globals
const _ignored = self.__WB_MANIFEST.map((_) => {
return _;
});
Expand Down

0 comments on commit ffa6d1a

Please sign in to comment.