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

2026: Better tsconfig breakdown #2526

Merged
merged 4 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ jobs:
- skip_job
- check_config
- restore_yarn_cache
- restore_yarn_tools_cache
- run:
command: yarn prettier:check
name: Prettier
Expand All @@ -493,7 +494,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:
directory: api-client
Expand Down
3 changes: 2 additions & 1 deletion .circleci/src/jobs/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ steps:
- skip_job
- check_config
- restore_yarn_cache
- restore_yarn_tools_cache
- run:
name: Prettier
command: yarn prettier:check
Expand All @@ -22,7 +23,7 @@ steps:
command: yarn workspace web stylelint
- run:
name: TS check
command: yarn workspaces run ts:check
command: yarn ts:check
- unit_test:
directory: api-client
- unit_test:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module.exports = {
],
},
parserOptions: {
project: './tsconfig.json',
project: true,
},
overrides: [
{
Expand Down
6 changes: 3 additions & 3 deletions api-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
1 change: 1 addition & 0 deletions build-configs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"node" // for scripts in tools/
]
},
"include": ["**/*"],
"references": [
{
"path": "../translations"
Expand Down
18 changes: 14 additions & 4 deletions native/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": ".",
Expand All @@ -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"]
Expand All @@ -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"
steffenkleinle marked this conversation as resolved.
Show resolved Hide resolved
],
"references": [
{
"path": "../translations"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"test:changed": "yarn workspace native test -o && yarn workspace web test -o && yarn workspace api-client test -o && yarn workspace translations test -o",
"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",
Expand Down
4 changes: 3 additions & 1 deletion tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
"noUncheckedIndexedAccess": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true
"strict": true,
"outDir": "dist"
},
"include": ["*"],
steffenkleinle marked this conversation as resolved.
Show resolved Hide resolved
"ts-node": {
"esm": true
}
Expand Down
4 changes: 3 additions & 1 deletion translations/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*"
]
Expand Down
13 changes: 12 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"compilerOptions": {
"composite": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES5", "ES6"],
Expand All @@ -11,5 +12,15 @@
"strict": true,
"target": "ESNext",
"useDefineForClassFields": false
}
},
"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" }
]
}
14 changes: 9 additions & 5 deletions web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down