Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Disallow Relative import #10009

Merged
merged 30 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
18af78d
package added
AdityaJ2305 Jan 16, 2025
4deec78
update the address
AdityaJ2305 Jan 16, 2025
95f433d
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 16, 2025
af35804
Empty-Commit
AdityaJ2305 Jan 16, 2025
943a999
fixed import in codebase
AdityaJ2305 Jan 16, 2025
b5a1a4d
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 16, 2025
0feaa4c
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 17, 2025
c615781
fix import lint fail
AdityaJ2305 Jan 17, 2025
09a38c8
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 17, 2025
785a4ab
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 17, 2025
b52df97
resolved conflicts
AdityaJ2305 Jan 17, 2025
e6da4e3
rm samefileimport
AdityaJ2305 Jan 17, 2025
437c732
file fix after rm samefileimport
AdityaJ2305 Jan 17, 2025
8b38470
file fix after rm samefileimport 2.0
AdityaJ2305 Jan 17, 2025
1c6c718
file fix after rm samefileimport 2.0
AdityaJ2305 Jan 17, 2025
021ba4c
Merge branch 'develop' into eslint_no_relative_path
rithviknishad Jan 18, 2025
293b09f
fix unused errors on some file
AdityaJ2305 Jan 18, 2025
fa041bb
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 18, 2025
e712618
eslint ignore specific lines
AdityaJ2305 Jan 19, 2025
18572d9
eslint ignore specific lines
AdityaJ2305 Jan 19, 2025
553623e
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 20, 2025
412197c
Revert "file fix after rm samefileimport 2.0"
AdityaJ2305 Jan 20, 2025
8502325
reset to allowsamedir
AdityaJ2305 Jan 20, 2025
426aa2b
Revert "file fix after rm samefileimport 2.0"
AdityaJ2305 Jan 20, 2025
0ecea01
reset to allowsamedir
AdityaJ2305 Jan 20, 2025
bb18675
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 20, 2025
a53aa91
resolved conflicts
AdityaJ2305 Jan 20, 2025
56bafb2
replace unused to _
AdityaJ2305 Jan 20, 2025
7eae09e
Merge branch 'develop' into eslint_no_relative_path
AdityaJ2305 Jan 20, 2025
086b795
resolved conflicts
AdityaJ2305 Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"plugins": [
"@typescript-eslint",
"i18next"
"i18next",
"no-relative-import-paths"
],
"rules": {
"no-unused-vars": "off",
Expand Down Expand Up @@ -77,6 +78,13 @@
]
}
}
],
"no-relative-import-paths/no-relative-import-paths": [
"error",
{
"allowSameFolder": true,
AdityaJ2305 marked this conversation as resolved.
Show resolved Hide resolved
"prefix": "@"
}
]
},
"ignorePatterns": [
Expand All @@ -91,4 +99,4 @@
"*.csv",
"Dockerfile"
]
}
}
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-i18next": "^6.1.0",
"eslint-plugin-mdx": "^3.1.5",
"eslint-plugin-no-relative-import-paths": "^1.6.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Routers/routes/questionnaireRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { QuestionnaireList } from "@/components/Questionnaire";
import QuestionnaireEditor from "@/components/Questionnaire/QuestionnaireEditor";
import { QuestionnaireShow } from "@/components/Questionnaire/show";

import { AppRoutes } from "../AppRouter";
import { AppRoutes } from "@/Routers/AppRouter";

const QuestionnaireRoutes: AppRoutes = {
"/questionnaire": () => <QuestionnaireList />,
Expand Down
3 changes: 2 additions & 1 deletion src/components/Common/Charts/ObservationChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import {
} from "@/components/ui/table";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";

import { Avatar } from "@/components/Common/Avatar";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { ObservationAnalyzeResponse } from "@/types/emr/observation";
import { Code } from "@/types/questionnaire/code";

import { Avatar } from "../Avatar";
import { ObservationHistoryTable } from "./ObservationHistoryTable";

export type ObservationPlotConfig = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Common/Charts/ObservationHistoryTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
TableRow,
} from "@/components/ui/table";

import { Avatar } from "@/components/Common/Avatar";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { ObservationWithUser } from "@/types/emr/observation";
import { Code } from "@/types/questionnaire/code";

import { Avatar } from "../Avatar";

interface PaginatedResponse<T> {
count: number;
next: string | null;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorPages/DefaultErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";

import { Button } from "../ui/button";
import { Button } from "@/components/ui/button";

type ErrorType = "PAGE_NOT_FOUND" | "PAGE_LOAD_ERROR" | "CUSTOM_ERROR";

Expand Down
12 changes: 6 additions & 6 deletions src/components/Facility/DuplicatePatientDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { useTranslation } from "react-i18next";

import CareIcon from "@/CAREUI/icons/CareIcon";

import DialogModal from "@/components/Common/Dialog";

import { PartialPatientModel } from "@/types/emr/newPatient";

import { Button } from "../ui/button";
import { Button } from "@/components/ui/button";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "../ui/table";
} from "@/components/ui/table";

import DialogModal from "@/components/Common/Dialog";

import { PartialPatientModel } from "@/types/emr/newPatient";

interface Props {
patientList: Array<PartialPatientModel>;
Expand Down
3 changes: 1 addition & 2 deletions src/components/Facility/EncounterCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { cn } from "@/lib/utils";
import CareIcon from "@/CAREUI/icons/CareIcon";

import { Badge } from "@/components/ui/badge";
import { buttonVariants } from "@/components/ui/button";

import { formatDateTime } from "@/Utils/utils";
import { Encounter, completedEncounterStatus } from "@/types/emr/encounter";

import { buttonVariants } from "../ui/button";

interface EncounterCardProps {
encounter: Encounter;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Files/AudioCaptureDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CareIcon from "@/CAREUI/icons/CareIcon";

import { useTimer } from "@/hooks/useTimer";

import useVoiceRecorder from "../../Utils/useVoiceRecorder";
import useVoiceRecorder from "@/Utils/useVoiceRecorder";

export interface AudioCaptureDialogProps {
show: boolean;
Expand Down
7 changes: 5 additions & 2 deletions src/components/Patient/MedicationStatementList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { formatDateTime } from "@/Utils/utils";

import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";

interface MedicationStatementListProps {
patientId: string;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { MedicationStatementList } from "@/components/Patient/MedicationStatementList";
import { AllergyList } from "@/components/Patient/allergy/list";
import { DiagnosisList } from "@/components/Patient/diagnosis/list";
import { SymptomsList } from "@/components/Patient/symptoms/list";

import { PatientProps } from ".";
import { MedicationStatementList } from "../MedicationStatementList";
import { AllergyList } from "../allergy/list";

export const HealthProfileSummary = (props: PatientProps) => {
const { id } = props;
Expand Down
3 changes: 1 addition & 2 deletions src/components/Patient/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { z } from "zod";
import CareIcon from "@/CAREUI/icons/CareIcon";
import SectionNavigator from "@/CAREUI/misc/SectionNavigator";

import Autocomplete from "@/components/ui/autocomplete";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
import {
Expand Down Expand Up @@ -56,8 +57,6 @@ import OrganizationSelector from "@/pages/Organization/components/OrganizationSe
import { PatientModel } from "@/types/emr/patient";
import { Organization } from "@/types/organization/organization";

import Autocomplete from "../ui/autocomplete";

interface PatientRegistrationPageProps {
facilityId: string;
patientId?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";

import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
Expand All @@ -28,8 +29,6 @@ import type {
} from "@/types/questionnaire/form";
import type { Question } from "@/types/questionnaire/question";

import { Switch } from "../../../components/ui/switch";

interface EncounterQuestionProps {
question: Question;
encounterId: string;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Questionnaire/QuestionnaireEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";

import Loading from "@/components/Common/Loading";

import mutate from "@/Utils/request/mutate";
import useQuery from "@/Utils/request/useQuery";
import {
Expand All @@ -44,7 +46,6 @@ import {
} from "@/types/questionnaire/questionnaire";
import questionnaireApi from "@/types/questionnaire/questionnaireApi";

import Loading from "../Common/Loading";
import { QuestionnaireForm } from "./QuestionnaireForm";

interface QuestionnaireEditorProps {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Questionnaire/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { useNavigate } from "raviger";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";

import Loading from "@/components/Common/Loading";

import useQuery from "@/Utils/request/useQuery";
import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire";
import questionnaireApi from "@/types/questionnaire/questionnaireApi";

import Loading from "../Common/Loading";

export function QuestionnaireList() {
const navigate = useNavigate();
const { data: response, loading } = useQuery(questionnaireApi.list);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Questionnaire/show.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ import {
} from "@/components/ui/dropdown-menu";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";

import Loading from "@/components/Common/Loading";

import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
import type { Question } from "@/types/questionnaire/question";
import questionnaireApi from "@/types/questionnaire/questionnaireApi";

import Loading from "../Common/Loading";
import CloneQuestionnaireSheet from "./CloneQuestionnaireSheet";
import ManageQuestionnaireOrganizationsSheet from "./ManageQuestionnaireOrganizationsSheet";
import ManageQuestionnaireTagsSheet from "./ManageQuestionnaireTagsSheet";
Expand Down
3 changes: 1 addition & 2 deletions src/components/Resource/ResourceCommentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import PaginatedList from "@/CAREUI/misc/PaginatedList";

import { Button } from "@/components/ui/button";

import { Avatar } from "@/components/Common/Avatar";
import CircularProgress from "@/components/Common/CircularProgress";
import TextAreaFormField from "@/components/Form/FormFields/TextAreaFormField";

Expand All @@ -14,8 +15,6 @@ import request from "@/Utils/request/request";
import { formatName } from "@/Utils/utils";
import { CommentModel } from "@/types/resourceRequest/resourceRequest";

import { Avatar } from "../Common/Avatar";

const CommentSection = (props: { id: string }) => {
const [commentBox, setCommentBox] = useState("");

Expand Down
3 changes: 1 addition & 2 deletions src/components/Resource/ResourceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Separator } from "@/components/ui/separator";

import Loading from "@/components/Common/Loading";
import Page from "@/components/Common/Page";
import { FacilityModel } from "@/components/Facility/models";
import CommentSection from "@/components/Resource/ResourceCommentSection";

import { RESOURCE_CATEGORY_CHOICES } from "@/common/constants";
Expand All @@ -21,8 +22,6 @@ import { formatDateTime, formatName } from "@/Utils/utils";
import { PatientModel } from "@/types/emr/patient";
import { ResourceRequest } from "@/types/resourceRequest/resourceRequest";

import { FacilityModel } from "../Facility/models";

function PatientCard({ patient }: { patient: PatientModel }) {
const { t } = useTranslation();
return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/Users/UserSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { toast } from "sonner";

import CareIcon from "@/CAREUI/icons/CareIcon";

import { Button } from "@/components/ui/button";

import LanguageSelector from "@/components/Common/LanguageSelector";
import UserColumns from "@/components/Common/UserColumns";
import UserAvatar from "@/components/Users/UserAvatar";
Expand All @@ -28,8 +30,6 @@ import routes from "@/Utils/request/api";
import request from "@/Utils/request/request";
import { UserBase } from "@/types/user/user";

import { Button } from "../ui/button";

export default function UserSummaryTab({
userData,
refetchUserData,
Expand Down
3 changes: 1 addition & 2 deletions src/components/ui/sidebar/patient-switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { useSidebar } from "@/components/ui/sidebar";

import { Avatar } from "@/components/Common/Avatar";

import { usePatientContext } from "@/hooks/usePatientUser";

import { classNames } from "@/Utils/utils";

import { useSidebar } from "../sidebar";

interface PatientSwitcherProps {
className?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/FacilitiesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants";

import query from "@/Utils/request/query";
import { PaginatedResponse } from "@/Utils/request/types";
import OrganizationFilter from "@/pages/Organization/components/OrganizationFilter";
import { FacilityData } from "@/types/facility/facility";
import facilityApi from "@/types/facility/facilityApi";

import OrganizationFilter from "../Organization/components/OrganizationFilter";
import { FacilityCard } from "./components/FacilityCard";

export function FacilitiesPage() {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Facility/components/FacilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { Card } from "@/components/ui/card";

import { Avatar } from "@/components/Common/Avatar";

import { FeatureBadge } from "@/pages/Facility/Utils";
import { FacilityData } from "@/types/facility/facility";

import { FeatureBadge } from "../Utils";

interface Props {
facility: FacilityData;
className?: string;
Expand Down
3 changes: 1 addition & 2 deletions src/pages/PublicAppointments/PatientRegistration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import { HTTPError } from "@/Utils/request/types";
import { dateQueryString } from "@/Utils/utils";
import OrganizationSelector from "@/pages/Organization/components/OrganizationSelector";
AdityaJ2305 marked this conversation as resolved.
Show resolved Hide resolved
import {
AppointmentPatient,
AppointmentPatientRegister,
Expand All @@ -44,8 +45,6 @@ import {
TokenSlot,
} from "@/types/scheduling/schedule";

import OrganizationSelector from "../Organization/components/OrganizationSelector";

const initialForm: AppointmentPatientRegister & {
ageInputType: "age" | "date_of_birth";
} = {
Expand Down
4 changes: 2 additions & 2 deletions src/types/emr/allergyIntolerance/allergyIntolerance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Code } from "../../questionnaire/code";
import { UserBase } from "../../user/user";
import { Code } from "@/types/questionnaire/code";
import { UserBase } from "@/types/user/user";

// Base type for allergy data
export interface AllergyIntolerance {
Expand Down
4 changes: 2 additions & 2 deletions src/types/emr/diagnosis/diagnosis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Code } from "../../questionnaire/code";
import { UserBase } from "../../user/user";
import { Code } from "@/types/questionnaire/code";
import { UserBase } from "@/types/user/user";

export const DIAGNOSIS_CLINICAL_STATUS = [
"active",
Expand Down
Loading
Loading