diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d840a927d..088b2aca85 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -480,6 +480,7 @@ jobs: - skip_job - check_config - restore_yarn_cache + - restore_yarn_tools_cache - run: command: yarn prettier:check name: Prettier @@ -490,7 +491,7 @@ jobs: command: yarn workspace web stylelint name: Stylelint - run: - command: yarn workspaces run ts:check + command: yarn ts:check name: TS check - unit_test - notify diff --git a/.circleci/src/jobs/check.yml b/.circleci/src/jobs/check.yml index 35733626d6..d07efbbe0f 100644 --- a/.circleci/src/jobs/check.yml +++ b/.circleci/src/jobs/check.yml @@ -11,6 +11,7 @@ steps: - skip_job - check_config - restore_yarn_cache + - restore_yarn_tools_cache - run: name: Prettier command: yarn prettier:check @@ -22,6 +23,6 @@ steps: command: yarn workspace web stylelint - run: name: TS check - command: yarn workspaces run ts:check + command: yarn ts:check - unit_test - notify diff --git a/.eslintrc.js b/.eslintrc.js index 0969be87b9..14f1cd1b9a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -132,7 +132,7 @@ module.exports = { ], }, parserOptions: { - project: './tsconfig.json', + project: true, }, overrides: [ { diff --git a/api-client/tsconfig.json b/api-client/tsconfig.json index eb628215f7..2ed94f3a86 100644 --- a/api-client/tsconfig.json +++ b/api-client/tsconfig.json @@ -4,7 +4,7 @@ "composite": true, "lib": ["ES5", "ES6", "dom"], "outDir": "dist", - "types": ["jest", "node"], - "typeRoots": ["src/@types", "node_modules/@types", "../node_modules/@types"] - } + "types": ["jest"] + }, + "include": ["src/**/*", "jest.config.ts", "jest.setup.ts"] } diff --git a/build-configs/tsconfig.json b/build-configs/tsconfig.json index 8f6fa89a68..1e743a0c13 100644 --- a/build-configs/tsconfig.json +++ b/build-configs/tsconfig.json @@ -8,6 +8,7 @@ "node" // for scripts in tools/ ] }, + "include": ["**/*"], "references": [ { "path": "../translations" diff --git a/e2e-tests/native/test/pageobjects/dashboard.page.ts b/e2e-tests/native/test/pageobjects/dashboard.page.ts index 8509314125..caaea8bd9d 100644 --- a/e2e-tests/native/test/pageobjects/dashboard.page.ts +++ b/e2e-tests/native/test/pageobjects/dashboard.page.ts @@ -5,15 +5,15 @@ class DashboardPage extends Page { super('Dashboard-Page') } - get searchIcon() { + get searchIcon(): ReturnType { return $('~Search') } - get headerOverflowButton() { + get headerOverflowButton(): ReturnType { return $('~More options') } - get languageIcon() { + get languageIcon(): ReturnType { return $('~Change language') } } diff --git a/e2e-tests/native/test/pageobjects/landing.page.ts b/e2e-tests/native/test/pageobjects/landing.page.ts index afc523121d..619a85fc98 100644 --- a/e2e-tests/native/test/pageobjects/landing.page.ts +++ b/e2e-tests/native/test/pageobjects/landing.page.ts @@ -9,11 +9,11 @@ class LandingPage extends Page { super('Landing-Page') } - get cities() { + get cities(): ReturnType { return $$('~City-Entry') } - get search() { + get search(): ReturnType { return $('~Search-Input') } diff --git a/e2e-tests/native/test/pageobjects/search.page.ts b/e2e-tests/native/test/pageobjects/search.page.ts index 01418fb0f4..e173ade1fb 100644 --- a/e2e-tests/native/test/pageobjects/search.page.ts +++ b/e2e-tests/native/test/pageobjects/search.page.ts @@ -5,7 +5,7 @@ class SearchPage extends Page { super('Search-Page') } - get search() { + get search(): ReturnType { return $('~Content-Search-Input') } } diff --git a/e2e-tests/tsconfig.json b/e2e-tests/tsconfig.json index 94e4681ce1..7d5cca9f44 100644 --- a/e2e-tests/tsconfig.json +++ b/e2e-tests/tsconfig.json @@ -1,12 +1,13 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "composite": true, "skipLibCheck": true, "module": "NodeNext", "moduleResolution": "NodeNext", - "noEmit": true, "types": ["node", "@wdio/globals/types", "@wdio/jasmine-framework"], - "sourceMap": false + "sourceMap": false, + "outDir": "dist" }, "include": ["web", "native", "shared"] } diff --git a/e2e-tests/web/test/pageobjects/dashboard.page.ts b/e2e-tests/web/test/pageobjects/dashboard.page.ts index 2e54e52f7d..f6b78d4caf 100644 --- a/e2e-tests/web/test/pageobjects/dashboard.page.ts +++ b/e2e-tests/web/test/pageobjects/dashboard.page.ts @@ -2,15 +2,15 @@ import { Routes } from '../../../shared/constants.js' import { CategoriesPage } from './categories.page.js' class DashboardPage extends CategoriesPage { - get languageIcon() { + get languageIcon(): ReturnType { return $("//header//button[@aria-label='Change language']") } - get searchIcon() { + get searchIcon(): ReturnType { return $("//header//a[@aria-label='Search']") } - get locationIcon() { + get locationIcon(): ReturnType { return $("//header//a[@aria-label='Change location']") } diff --git a/e2e-tests/web/test/pageobjects/landing.page.ts b/e2e-tests/web/test/pageobjects/landing.page.ts index f127fa74e6..a3ac51cac9 100644 --- a/e2e-tests/web/test/pageobjects/landing.page.ts +++ b/e2e-tests/web/test/pageobjects/landing.page.ts @@ -5,15 +5,15 @@ import Page from './page.js' * sub page containing specific selectors and methods for a specific page */ class LandingPage extends Page { - get cities() { + get cities(): ReturnType { return $$('//main//a') } - get search() { + get search(): ReturnType { return $('//main//input') } - city(name: string) { + city(name: string): ReturnType { return $(`=${name}`) } diff --git a/e2e-tests/web/test/pageobjects/search.page.ts b/e2e-tests/web/test/pageobjects/search.page.ts index 88bfdc1d66..d33ff4016b 100644 --- a/e2e-tests/web/test/pageobjects/search.page.ts +++ b/e2e-tests/web/test/pageobjects/search.page.ts @@ -2,7 +2,7 @@ import { Routes } from '../../../shared/constants.js' import Page from './page.js' class SearchPage extends Page { - get search() { + get search(): ReturnType { return $('//input') } diff --git a/e2e-tests/web/wdio-browserstack.conf.ts b/e2e-tests/web/wdio-browserstack.conf.ts index 56c38df2b7..f24ed2af77 100644 --- a/e2e-tests/web/wdio-browserstack.conf.ts +++ b/e2e-tests/web/wdio-browserstack.conf.ts @@ -5,7 +5,7 @@ const capabilities = browsers .filter(browser => process.argv.includes(`--${browser}`)) .map(browser => browserstackCapabilities[browser]) -export const config = Object.assign(defaultConfig, { +export const config: WebdriverIO.Config = Object.assign(defaultConfig, { maxInstances: 1, user: process.env.E2E_BROWSERSTACK_USER, diff --git a/native/tsconfig.json b/native/tsconfig.json index e3b3eaed30..29f24ffeeb 100644 --- a/native/tsconfig.json +++ b/native/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "composite": true, "allowJs": true, "allowSyntheticDefaultImports": true, "baseUrl": ".", @@ -9,9 +10,6 @@ "module": "es2020", "outDir": "dist", "paths": { - "api-client/*": ["../api-client/*"], - "build-configs/*": ["../build-configs/*"], - "translations/*": ["../translations/*"], "normalize-strings": ["../api-client/src/@types/normalize-strings"], "@dr.pogodin/react-native-static-server": ["src/@types/react-native-static-server"], "@react-native-async-storage/async-storage/jest/async-storage-mock": ["src/@types/untyped"] @@ -20,7 +18,19 @@ "typeRoots": ["./src/@types", "./node_modules/@types", "../node_modules/@types"], "types": ["jest", "node", "react-native", "styled-components-react-native"] }, - "include": ["src/**/*", "./jest.setup.ts", "index.ts", "jest.config.ts", "metro.config.ci.js", "metro.config.js"], + "include": [ + "src/**/*", + "jest.setup.ts", + "index.ts", + "jest.config.ts", + "babel.config.js", + "metro.config.ci.js", + "metro.config.js", + ".yarn/plugins/root-command.js", + "react-native.config.js", + "run.js", + "src/assets/licenses.json" + ], "references": [ { "path": "../translations" diff --git a/package.json b/package.json index 8b4fda1877..ecf1816304 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "test:ci": "yarn test --coverage --ci", "circleci:update-config": "{ cat .circleci/autogenerated_header.yml; circleci config pack .circleci/src; } > .circleci/config.yml && circleci config validate", "prettier:check": "prettier --check .", - "prettier:write": "prettier --write ." + "prettier:write": "prettier --write .", + "ts:check": "tsc --build" }, "resolutions": { "luxon": "^3.4.2", diff --git a/tools/tsconfig.json b/tools/tsconfig.json index e5ceffb975..688fb16998 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "composite": true, "esModuleInterop": true, "module": "NodeNext", "moduleResolution": "NodeNext", @@ -8,8 +9,10 @@ "noUncheckedIndexedAccess": true, "resolveJsonModule": true, "skipLibCheck": true, - "strict": true + "strict": true, + "outDir": "dist" }, + "include": ["*"], "ts-node": { "esm": true } diff --git a/translations/tsconfig.json b/translations/tsconfig.json index 29bd493810..6c32824e8c 100644 --- a/translations/tsconfig.json +++ b/translations/tsconfig.json @@ -5,13 +5,15 @@ "outDir": "dist", "types": [ "jest", - "node" // for require() in src/__tests__/loadTranslations.spec.ts + "node" // for scripts in tools in src/__tests__/loadTranslations.spec.ts ] }, "include": [ "translations.json", "override-translations/aschaffenburg.json", "override-translations/malte.json", + "jest.config.ts", + "jest.setup.ts", "src/**/*", "tools/**/*" ] diff --git a/tsconfig.json b/tsconfig.json index e6a42b1160..e818fc3f3a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { + "composite": true, + "allowJs": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "lib": ["ES5", "ES6"], @@ -10,6 +12,18 @@ "resolveJsonModule": true, "strict": true, "target": "ESNext", - "useDefineForClassFields": false - } + "skipLibCheck": true, + "useDefineForClassFields": false, + "outDir": "dist" + }, + "include": ["jest.config.ts", ".prettierrc.js", ".eslintrc.js", ".eslintrc_changed.js"], + "references": [ + { "path": "api-client" }, + { "path": "build-configs" }, + { "path": "e2e-tests" }, + { "path": "native" }, + { "path": "tools" }, + { "path": "translations" }, + { "path": "web" } + ] } diff --git a/web/tsconfig.json b/web/tsconfig.json index 6e94d9a567..06fc4bb423 100644 --- a/web/tsconfig.json +++ b/web/tsconfig.json @@ -12,17 +12,21 @@ "outDir": "dist", "sourceMap": true, "paths": { - "api-client/*": ["../api-client/*"], - "build-configs/*": ["../build-configs/*"], - "translations/*": ["../translations/*"], "normalize-strings": ["../api-client/src/@types/normalize-strings"] }, "skipLibCheck": true, "target": "ES2019", - "typeRoots": ["./src/@types", "./node_modules/@types", "../node_modules/@types"], "types": ["jest", "node", "react"] }, - "include": ["src/**/*", "tools/*", "./jest.setup.ts", "jest.config.ts"], + "include": [ + "src/**/*", + "tools/*", + "jest.setup.ts", + "jest.config.ts", + "stylelint.config.js", + "www/iframe.js", + "assets/licenses.json" + ], "references": [ { "path": "../translations"