Skip to content

Commit

Permalink
2026: better tsconfig breakdown
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahsporck committed Oct 17, 2023
1 parent 6a480f1 commit b8e4d06
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,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
2 changes: 1 addition & 1 deletion .circleci/src/jobs/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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"
],
"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": ["*"],
"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

0 comments on commit b8e4d06

Please sign in to comment.