diff --git a/cypress/e2e/homePage.cy.ts b/cypress/e2e/homePage.cy.ts index a8b7e80cd..7ac8637db 100644 --- a/cypress/e2e/homePage.cy.ts +++ b/cypress/e2e/homePage.cy.ts @@ -3,7 +3,7 @@ import { HttpMethod, formatDate } from '@graasp/sdk'; import { StatusCodes } from 'http-status-codes'; -import i18n from '@/config/i18n'; +import i18n from '../../src/config/i18n'; import { AVATAR_UPLOAD_ICON_ID, AVATAR_UPLOAD_INPUT_ID, @@ -14,8 +14,7 @@ import { MEMBER_AVATAR_IMAGE_ID, MEMBER_CREATED_AT_ID, MEMBER_USERNAME_DISPLAY_ID, -} from '@/config/selectors'; - +} from '../../src/config/selectors'; import { BOB, MEMBER_WITH_AVATAR } from '../fixtures/members'; import { AVATAR_LINK, @@ -76,10 +75,9 @@ class TestHelper { } describe('Upload Avatar', () => { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - let helpers: TestHelper; beforeEach(() => { - helpers = new TestHelper({ currentMember: BOB }); + // eslint-disable-next-line no-new + new TestHelper({ currentMember: BOB }); cy.visit('/'); }); diff --git a/cypress/e2e/notFoundPage.cy.ts b/cypress/e2e/notFoundPage.cy.ts index d6ca2e152..879ae12a5 100644 --- a/cypress/e2e/notFoundPage.cy.ts +++ b/cypress/e2e/notFoundPage.cy.ts @@ -2,8 +2,7 @@ import { GO_TO_HOME_LINK_ID, NOT_FOUND_MESSAGE_ID, NOT_FOUND_TEXT_ID, -} from '@/config/selectors'; - +} from '../../src/config/selectors'; import { BOB } from '../fixtures/members'; describe('404 Page Test', () => { diff --git a/cypress/e2e/profile/password.cy.ts b/cypress/e2e/profile/password.cy.ts index 6512d6d3d..7c8ff1b95 100644 --- a/cypress/e2e/profile/password.cy.ts +++ b/cypress/e2e/profile/password.cy.ts @@ -1,7 +1,7 @@ import { FAILURE_MESSAGES, namespaces } from '@graasp/translations'; -import i18n, { ACCOUNT_NAMESPACE } from '@/config/i18n'; -import { PROFILE_PATH } from '@/config/paths'; +import i18n, { ACCOUNT_NAMESPACE } from '../../../src/config/i18n'; +import { PROFILE_PATH } from '../../../src/config/paths'; import { PASSWORD_CREATE_CONTAINER_ID, PASSWORD_DISPLAY_CONTAINER_ID, @@ -11,8 +11,7 @@ import { PASSWORD_INPUT_CURRENT_PASSWORD_ID, PASSWORD_INPUT_NEW_PASSWORD_ID, PASSWORD_SAVE_BUTTON_ID, -} from '@/config/selectors'; - +} from '../../../src/config/selectors'; import { ACCOUNT } from '../../../src/langs/constants'; import { BOB } from '../../fixtures/members'; diff --git a/cypress/e2e/profile/personalInformation.cy.ts b/cypress/e2e/profile/personalInformation.cy.ts index 192695975..a4c9b257b 100644 --- a/cypress/e2e/profile/personalInformation.cy.ts +++ b/cypress/e2e/profile/personalInformation.cy.ts @@ -1,5 +1,4 @@ -import { PROFILE_PATH } from 'config/paths'; - +import { PROFILE_PATH } from '../../../src/config/paths'; import { PERSONAL_INFO_CANCEL_BUTTON_ID, PERSONAL_INFO_DISPLAY_CONTAINER_ID, @@ -9,8 +8,7 @@ import { PERSONAL_INFO_INPUT_EMAIL_ID, PERSONAL_INFO_SAVE_BUTTON_ID, PERSONAL_INFO_USERNAME_DISPLAY_ID, -} from '@/config/selectors'; - +} from '../../../src/config/selectors'; import { BOB, MEMBERS } from '../../fixtures/members'; const changeUsername = (newUserName: string) => { diff --git a/cypress/e2e/profile/publicProfile.cy.ts b/cypress/e2e/profile/publicProfile.cy.ts index d165ac804..8f7d5ffef 100644 --- a/cypress/e2e/profile/publicProfile.cy.ts +++ b/cypress/e2e/profile/publicProfile.cy.ts @@ -1,4 +1,4 @@ -import { PROFILE_PATH } from '@/config/paths'; +import { PROFILE_PATH } from '../../../src/config/paths'; import { PUBLIC_PROFILE_BIO_ID, PUBLIC_PROFILE_EDIT_BUTTON_ID, @@ -9,8 +9,7 @@ import { PUBLIC_PROFILE_SAVE_BUTTON_ID, PUBLIC_PROFILE_TWITTER_HREF_ID, PUBLIC_PROFILE_TWITTER_ID, -} from '@/config/selectors'; - +} from '../../../src/config/selectors'; import { BOB, MEMBER_EMPTY_PUBLIC_PROFILE, diff --git a/cypress/e2e/settings/preferences.cy.ts b/cypress/e2e/settings/preferences.cy.ts index 6c974fceb..460a2ef6d 100644 --- a/cypress/e2e/settings/preferences.cy.ts +++ b/cypress/e2e/settings/preferences.cy.ts @@ -1,7 +1,7 @@ import { EmailFrequency } from '@graasp/sdk'; import { langs } from '@graasp/translations'; -import { SETTINGS_PATH } from '@/config/paths'; +import { SETTINGS_PATH } from '../../../src/config/paths'; import { PREFERENCES_ANALYTICS_SWITCH_ID, PREFERENCES_CANCEL_BUTTON_ID, @@ -11,8 +11,7 @@ import { PREFERENCES_LANGUAGE_DISPLAY_ID, PREFERENCES_LANGUAGE_SWITCH_ID, PREFERENCES_SAVE_BUTTON_ID, -} from '@/config/selectors'; - +} from '../../../src/config/selectors'; import { BOB, CURRENT_MEMBER } from '../../fixtures/members'; describe('Display preferences', () => { diff --git a/cypress/e2e/storage.cy.ts b/cypress/e2e/storage.cy.ts index 550068fbb..6fa148cca 100644 --- a/cypress/e2e/storage.cy.ts +++ b/cypress/e2e/storage.cy.ts @@ -1,7 +1,7 @@ import { formatDate, formatFileSize } from '@graasp/sdk'; -import i18n from '@/config/i18n'; -import { STORAGE_PATH } from '@/config/paths'; +import i18n from '../../src/config/i18n'; +import { STORAGE_PATH } from '../../src/config/paths'; import { MEMBER_STORAGE_FILE_NAME_ID, MEMBER_STORAGE_FILE_SIZE_ID, @@ -9,8 +9,7 @@ import { MEMBER_STORAGE_PARENT_FOLDER_ID, STORAGE_BAR_LABEL_ID, getCellId, -} from '@/config/selectors'; - +} from '../../src/config/selectors'; import { CURRENT_MEMBER, MEMBER_STORAGE_ITEM_RESPONSE, diff --git a/cypress/e2e/validateEmailPage.cy.ts b/cypress/e2e/validateEmailPage.cy.ts index b66c8f091..66af74094 100644 --- a/cypress/e2e/validateEmailPage.cy.ts +++ b/cypress/e2e/validateEmailPage.cy.ts @@ -2,14 +2,13 @@ import { HttpMethod } from '@graasp/sdk'; import { StatusCodes } from 'http-status-codes'; -import { EMAIL_CHANGE_VALIDATION_PATH } from '@/config/paths'; +import { EMAIL_CHANGE_VALIDATION_PATH } from '../../src/config/paths'; import { EMAIL_VALIDATION_BUTTON_ID, EMAIL_VALIDATION_CONFLICT_MESSAGE_ID, EMAIL_VALIDATION_SUCCESS_MESSAGE_ID, EMAIL_VALIDATION_UNAUTHORIZED_MESSAGE_ID, -} from '@/config/selectors'; - +} from '../../src/config/selectors'; import { CURRENT_MEMBER } from '../fixtures/members'; const API_HOST = Cypress.env('VITE_GRAASP_API_HOST'); diff --git a/tsconfig.app.json b/tsconfig.app.json index 501838a46..0d8156b98 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -2,11 +2,7 @@ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, - "lib": [ - "ES2020", - "DOM", - "DOM.Iterable" - ], + "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ @@ -22,12 +18,8 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] } }, - "include": [ - "src" - ] + "include": ["src"] } diff --git a/tsconfig.json b/tsconfig.json index ea9d0cd82..a2743dead 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,9 @@ { "path": "./tsconfig.node.json" } - ] + ], + "compilerOptions": { + // this is needed for cypress to compile to ESM ... Should be removed when not using cypress anymore + "module": "ESNext" + } } diff --git a/tsconfig.node.json b/tsconfig.node.json index ddefd78dd..538380469 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,9 +1,7 @@ { "compilerOptions": { "target": "ES2022", - "lib": [ - "ES2023" - ], + "lib": ["ES2023"], "module": "ESNext", "skipLibCheck": true, /* Bundler mode */ @@ -18,8 +16,5 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": [ - "vite-env.d.ts", - "vite.config.ts" - ] + "include": ["vite-env.d.ts", "vite.config.ts"] }