Skip to content

Commit e4ff498

Browse files
committed
Centralize TypeScript configuration and typecheck each workspace directly
- remove excessive keys from tsconfigs - can 'incremental' be set on root? - move compilerOptions.paths back to corresponding tsconfigs [Changes] - is this normal? [Fragment] ├── apps │ ├── browser │ │ ├── package.json │ │ └── tsconfig.json │ ├── editor │ │ ├── package.json │ │ └── tsconfig.json │ └── web │ ├── package.json │ └── tsconfig.json ├── package.json ├── packages │ ├── shared │ │ ├── package.json │ │ ├── tsconfig.build.json │ │ └── tsconfig.json │ └── ui │ ├── package.json │ └── tsconfig.json └── tsconfig.json
1 parent 1d927e0 commit e4ff498

10 files changed

Lines changed: 13 additions & 66 deletions

File tree

‎.eslintrc.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"rules": {
2424
"@typescript-eslint/explicit-function-return-type": "off",
2525
"@typescript-eslint/no-explicit-any": "off",
26+
"@typescript-eslint/ban-ts-comment": "off",
2627
"@typescript-eslint/no-unused-vars": [
2728
"warn",
2829
{ "argsIgnorePattern": "^_" }
@@ -42,6 +43,5 @@
4243
"node": true
4344
}
4445
}
45-
],
46-
"ignorePatterns": ["node_modules/", "dist/", "out/"]
46+
]
4747
}

‎apps/browser/src/content-scripts/send-prompt-content-script/utils/add-apply-response-button.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Message } from '@/types/messages'
21
import browser from 'webextension-polyfill'
32
import { apply_response_icon } from '../constants/apply-response-icon'
43
import { apply_response_button_title } from '../constants/dictionary'
@@ -8,6 +7,7 @@ import {
87
} from './apply-response-styles'
98
import { show_response_ready_notification } from './show-response-ready-notification'
109
import { session_state } from './session-state'
10+
import { Message } from '@/types/messages'
1111

1212
export function add_apply_response_button(params: {
1313
client_id: string

‎apps/browser/tsconfig.json‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
3-
"target": "ESNext",
4-
"lib": ["dom", "ESNext"],
5-
"module": "commonjs",
6-
"rootDir": "../../",
7-
"sourceMap": true,
8-
"esModuleInterop": true,
9-
"strict": true,
10-
"jsx": "react-jsx",
11-
"skipLibCheck": true,
124
"types": ["chrome", "webextension-polyfill", "node", "jest"],
135
"paths": {
146
"@/*": ["./src/*"],

‎apps/editor/tsconfig.json‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "ESNext",
5-
"lib": ["ESNext", "dom"],
6-
"sourceMap": true,
7-
"strict": true,
8-
"esModuleInterop": true,
9-
"jsx": "react-jsx",
10-
"jsxImportSource": "react",
114
"types": ["node", "react", "jest"],
12-
"skipLibCheck": true,
13-
"rootDir": "../../",
14-
"incremental": true,
155
"paths": {
166
"@/*": ["./src/*"],
177
"@shared/*": ["../../packages/shared/src/*"],

‎apps/web/tsconfig.json‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,20 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
3-
"target": "ES6",
4-
"lib": ["dom", "dom.iterable", "esnext"],
54
"allowJs": true,
6-
"strict": true,
75
"forceConsistentCasingInFileNames": true,
86
"noEmit": true,
9-
"esModuleInterop": true,
10-
"module": "esnext",
11-
"resolveJsonModule": true,
127
"isolatedModules": true,
138
"jsx": "preserve",
149
"types": ["node", "react", "jest"],
15-
"skipLibCheck": true,
16-
"rootDir": "../../",
1710
"paths": {
1811
"@/*": ["./src/*"]
1912
},
2013
"plugins": [
2114
{
2215
"name": "next"
2316
}
24-
],
25-
"jsxImportSource": "react"
17+
]
2618
},
2719
"include": [
2820
"next-env.d.ts",

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"test:watch": "jest --watch",
88
"lint": "eslint . --ext ts,tsx",
99
"lint:fix": "eslint . --ext ts,tsx --fix",
10-
"typecheck": "tsc --noEmit"
10+
"typecheck": "pnpm -r exec tsc --noEmit"
1111
},
1212
"devDependencies": {
1313
"@types/chrome": "0.3.7",

‎packages/shared/tsconfig.json‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
3-
"module": "commonjs",
4-
"target": "ESNext",
5-
"lib": ["ESNext", "dom"],
6-
"sourceMap": true,
7-
"strict": true,
8-
"esModuleInterop": true,
9-
"rootDir": "../../",
10-
"skipLibCheck": true,
114
"types": ["node", "jest"],
125
"paths": {
136
"@shared/*": ["./src/*"]

‎packages/ui/src/hooks/use-dayjs-locale.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const use_dayjs_locale = () => {
55
useEffect(() => {
66
const lang = document.documentElement.lang || 'en'
77
if (lang !== 'en') {
8+
// @ts-ignore
89
import(/* webpackInclude: /\.js$/ */ `dayjs/locale/${lang}`)
910
.then(() => {
1011
dayjs.locale(lang)

‎packages/ui/tsconfig.json‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
{
2+
"extends": "../../tsconfig.json",
23
"compilerOptions": {
34
"target": "es6",
4-
"lib": ["dom", "dom.iterable", "esnext"],
55
"allowJs": true,
6-
"skipLibCheck": true,
7-
"esModuleInterop": true,
86
"allowSyntheticDefaultImports": true,
9-
"strict": true,
107
"forceConsistentCasingInFileNames": true,
118
"noFallthroughCasesInSwitch": true,
12-
"module": "esnext",
13-
"resolveJsonModule": true,
149
"isolatedModules": true,
15-
"jsx": "react-jsx",
16-
"jsxImportSource": "react",
1710
"declaration": true,
1811
"types": ["node", "jest"],
1912
"sourceMap": true,
20-
"rootDir": "../../",
21-
"incremental": true,
2213
"paths": {
23-
"@/*": ["./src/*", "../../apps/editor/src/*"],
2414
"@shared/*": ["../shared/src/*"],
2515
"@ui/*": ["./src/*"]
2616
}
@@ -29,8 +19,6 @@
2919
"src/**/*.ts",
3020
"src/**/*.tsx",
3121
"../shared/src/*.ts",
32-
"../shared/src/*.tsx",
33-
"../../apps/editor/src/**/*.ts",
34-
"../../apps/editor/src/**/*.tsx"
22+
"../shared/src/*.tsx"
3523
]
3624
}

‎tsconfig.json‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
{
22
"compilerOptions": {
3-
"target": "ESNext",
4-
"module": "ESNext",
3+
"incremental": true,
54
"lib": ["DOM", "DOM.Iterable", "ESNext"],
65
"skipLibCheck": true,
7-
"strict": true,
86
"esModuleInterop": true,
9-
"resolveJsonModule": true,
107
"jsx": "react-jsx",
118
"types": ["jest", "chrome"],
129
"rootDir": ".",
1310
"paths": {
14-
"@/*": [
15-
"./apps/editor/src/*",
16-
"./apps/browser/src/*",
17-
"./apps/web/src/*",
18-
"./packages/ui/src/*"
19-
],
2011
"@shared/*": ["./packages/shared/src/*"],
2112
"@ui/*": ["./packages/ui/src/*"]
2213
}

0 commit comments

Comments
 (0)