diff --git a/cypress/e2e/facility_spec/facility_creation.cy.ts b/cypress/e2e/facility_spec/facility_creation.cy.ts index d95832965bb..d2d0351c414 100644 --- a/cypress/e2e/facility_spec/facility_creation.cy.ts +++ b/cypress/e2e/facility_spec/facility_creation.cy.ts @@ -1,6 +1,6 @@ -import { FacilityCreation } from "pageObject/facility/FacilityCreation"; -import { generatePhoneNumber } from "utils/commonUtils"; -import { generateFacilityData } from "utils/facilityData"; +import { FacilityCreation } from "@/pageObject/facility/FacilityCreation"; +import { generatePhoneNumber } from "@/utils/commonUtils"; +import { generateFacilityData } from "@/utils/facilityData"; const LOCATION_HIERARCHY = { localBody: "Aluva", diff --git a/cypress/e2e/login_spec/loginpage.cy.ts b/cypress/e2e/login_spec/loginpage.cy.ts index 89e67763ade..8ca52275170 100644 --- a/cypress/e2e/login_spec/loginpage.cy.ts +++ b/cypress/e2e/login_spec/loginpage.cy.ts @@ -1,4 +1,4 @@ -import { LoginPage } from "../../pageObject/auth/LoginPage"; +import { LoginPage } from "@/pageObject/auth/LoginPage"; describe("Login Page", () => { const loginPage = new LoginPage(); diff --git a/cypress/e2e/patient_spec/patient_creation.cy.ts b/cypress/e2e/patient_spec/patient_creation.cy.ts index 06cb1a606b2..cbeb15a241d 100644 --- a/cypress/e2e/patient_spec/patient_creation.cy.ts +++ b/cypress/e2e/patient_spec/patient_creation.cy.ts @@ -1,13 +1,14 @@ -import { patientCreation } from "pageObject/Patients/PatientCreation"; -import { patientDashboard } from "pageObject/Patients/PatientDashboard"; -import { patientVerify } from "pageObject/Patients/PatientVerify"; -import { FacilityCreation } from "pageObject/facility/FacilityCreation"; import { generateAddress, generateName, generatePhoneNumber, } from "utils/commonUtils"; +import { patientCreation } from "@/pageObject/Patients/PatientCreation"; +import { patientDashboard } from "@/pageObject/Patients/PatientDashboard"; +import { patientVerify } from "@/pageObject/Patients/PatientVerify"; +import { FacilityCreation } from "@/pageObject/facility/FacilityCreation"; + const facilityCreation = new FacilityCreation(); const ENCOUNTER_TYPE = "Observation"; const ENCOUNTER_STATUS = "In Progress"; diff --git a/cypress/e2e/patient_spec/patient_encounter.cy.ts b/cypress/e2e/patient_spec/patient_encounter.cy.ts index 7680762a012..ac13650585d 100644 --- a/cypress/e2e/patient_spec/patient_encounter.cy.ts +++ b/cypress/e2e/patient_spec/patient_encounter.cy.ts @@ -1,5 +1,5 @@ -import { PatientEncounter } from "pageObject/Patients/PatientEncounter"; -import { FacilityCreation } from "pageObject/facility/FacilityCreation"; +import { PatientEncounter } from "@/pageObject/Patients/PatientEncounter"; +import { FacilityCreation } from "@/pageObject/facility/FacilityCreation"; const facilityCreation = new FacilityCreation(); const patientEncounter = new PatientEncounter(); diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts index 3c45b3057c0..c43eae3d02f 100644 --- a/cypress/e2e/users_spec/user_creation.cy.ts +++ b/cypress/e2e/users_spec/user_creation.cy.ts @@ -1,10 +1,10 @@ -import { UserCreation } from "pageObject/Users/UserCreation"; -import { FacilityCreation } from "pageObject/facility/FacilityCreation"; +import { UserCreation } from "@/pageObject/Users/UserCreation"; +import { FacilityCreation } from "@/pageObject/facility/FacilityCreation"; import { generateName, generatePhoneNumber, generateUsername, -} from "utils/commonUtils"; +} from "@/utils/commonUtils"; describe("User Creation", () => { const facilityCreation = new FacilityCreation(); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index 597454eb00c..6b5ac7d593a 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -62,6 +62,7 @@ Cypress.Commands.add("getAttached", (selector: string) => { $el = getElement(Cypress.$($d)); // Ensure $el is an HTMLElement before checking if it is detached if ($el.length && $el[0] instanceof HTMLElement) { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(Cypress.dom.isDetached($el[0])).to.be.false; // Access the first HTMLElement } else { throw new Error("Element is not an HTMLElement or is detached."); diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index f887c29aead..76cc5965d64 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -1 +1 @@ -import "./commands"; +import "@/support/commands"; diff --git a/cypress/support/index.ts b/cypress/support/index.ts index 4a8bd309951..cdab9462722 100644 --- a/cypress/support/index.ts +++ b/cypress/support/index.ts @@ -1,4 +1,4 @@ -import { ErrorMessageItem } from "./commands"; +import { ErrorMessageItem } from "@/support/commands"; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/cypress/tsconfig.json b/cypress/tsconfig.json index 3fbb7b08f69..e4db1f71f13 100644 --- a/cypress/tsconfig.json +++ b/cypress/tsconfig.json @@ -13,7 +13,10 @@ "es2020" ], "typeRoots": ["./support"], - "resolveJsonModule": true + "resolveJsonModule": true, + "paths": { + "@/*": ["./*"], + } }, "include": ["**/*.cy.ts", "support/commands.ts", "**/*.ts"] } diff --git a/eslint.config.mjs b/eslint.config.mjs index da34692bca6..35fd03f40b7 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -34,6 +34,7 @@ export default [ ...globals.node, React: true, }, + parser: tsParser, parserOptions: { ecmaFeatures: { jsx: true, diff --git a/plugins/treeShakeCareIcons.ts b/plugins/treeShakeCareIcons.ts index 3ce077f5d5f..a817bfa2272 100644 --- a/plugins/treeShakeCareIcons.ts +++ b/plugins/treeShakeCareIcons.ts @@ -61,7 +61,7 @@ export function treeShakeCareIcons( // Generates a map of used icon names to their paths from UniconPaths.json, including any whitelisted icons. function getTreeShakenUniconPaths() { const usedIcons = [...getAllUsedIconNames(), ...options.iconWhitelist]; - const treeshakenCareIconPaths = {}; + const treeshakenCareIconPaths: { [key: string]: string } = {}; for (const iconName of usedIcons) { const path = allUniconPaths[iconName]; diff --git a/scripts/sort-locales.js b/scripts/sort-locales.js index 62c3e3d8ba1..4d970452dcc 100644 --- a/scripts/sort-locales.js +++ b/scripts/sort-locales.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires const fs = require("fs"); const file = "public/locale/en.json"; diff --git a/tailwind.config.js b/tailwind.config.js index 3235b2673d7..cd0c7d0c353 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ const colors = require("tailwindcss/colors"); const secondary = { diff --git a/tsconfig.json b/tsconfig.json index bba22c5da97..dbbb18dbcd8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,6 @@ }, "typeRoots": ["./node_modules/@types", "./src/remote-modules.d.ts"] }, - "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "care.config.ts"], + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts", "care.config.ts","scripts/**/*.ts","cypress.config.ts","plugins/**/*.ts"], "exclude": ["src/**/*.gen.tsx"] }