Skip to content

Commit

Permalink
fix: typescript type resolution (#8662)
Browse files Browse the repository at this point in the history
* fix: typeRoots

* fix: bad @types/sass package

* fix: timeout types

* fix: better setTimeout type
  • Loading branch information
tracernz authored May 27, 2024
1 parent 7cfdab4 commit 1a6e658
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 33 deletions.
2 changes: 1 addition & 1 deletion fbw-a32nx/mach.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const imagePlugin = require('esbuild-plugin-inline-image');
const postCssPlugin = require('esbuild-style-plugin');
const postCssPlugin = require('esbuild-style-plugin-v2');
const tailwind = require('tailwindcss');
const postCssColorFunctionalNotation = require('postcss-color-functional-notation');
const postCssInset = require('postcss-inset');
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/atsu/fmsclient/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/instruments/src/DCDU/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const DCDU: React.FC = () => {
const [state, setState] = useState(isColdAndDark ? DcduState.Off : DcduState.On);
const [systemStatusMessage, setSystemStatusMessage] = useState(MailboxStatusMessage.NoMessage);
const [systemStatusTimer, setSystemStatusTimer] = useState<number | null>(null);
const [screenTimeout, setScreenTimeout] = useState<number | null>(null);
const [screenTimeout, setScreenTimeout] = useState<ReturnType<typeof setTimeout> | null>(null);
const [messages, setMessages] = useState(new Map<number, DcduMessageBlock>());
const publisherRef = useRef<Publisher<AtsuMailboxMessages> | null>();
const messagesRef = useRef<Map<number, DcduMessageBlock>>();
Expand Down
2 changes: 1 addition & 1 deletion fbw-a32nx/src/systems/instruments/src/SD/Pages/Eng/Eng.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ const EngineColumn = ({ x, y, engineNumber, fadecOn }: ComponentPositionProps) =
setTempAmber(false);
}

let timeout: number;
let timeout: ReturnType<typeof setTimeout>;
if (engineOilTemperature > OIL_TEMP_HIGH_ADVISORY) {
timeout = setTimeout(() => {
if (engineOilTemperature > OIL_TEMP_HIGH_ADVISORY) {
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/sentry-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/simbridge-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-a32nx/src/systems/tcas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../../fbw-common/src/typings"]
"typeRoots": [
"../../../../fbw-common/src/typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
3 changes: 2 additions & 1 deletion fbw-a32nx/src/systems/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"resolveJsonModule" : true,
"skipLibCheck": true,
"typeRoots": [
"../../../fbw-common/src/typings"
"../../../fbw-common/src/typings",
"../../../node_modules/@types",
],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
2 changes: 1 addition & 1 deletion fbw-a380x/mach.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const imagePlugin = require('esbuild-plugin-inline-image');
const postCssPlugin = require('esbuild-style-plugin');
const postCssPlugin = require('esbuild-style-plugin-v2');
const tailwind = require('tailwindcss');
const postCssColorFunctionalNotation = require('postcss-color-functional-notation');
const postCssInset = require('postcss-inset');
Expand Down
5 changes: 4 additions & 1 deletion fbw-a380x/src/systems/atsu/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../typings"]
"typeRoots": [
"../../typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
8 changes: 5 additions & 3 deletions fbw-a380x/src/systems/fmgc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../typings"]
"typeRoots": [
"../../typings",
"../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
"../../typings/**/*.d.ts",
"../../node_modules/@types/jest/index.d.ts"
]
}
}
5 changes: 4 additions & 1 deletion fbw-a380x/src/systems/tcas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../typings", "../node_modules/@types"],
"typeRoots": [
"../../typings",
"../../../../node_modules/@types"
],
},
"include": [
"src/**/*",
Expand Down
3 changes: 2 additions & 1 deletion fbw-a380x/src/systems/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"resolveJsonModule" : true,
"skipLibCheck": true,
"typeRoots": [
"../../../fbw-common/src/typings"
"../../../fbw-common/src/typings",
"../../../node_modules/@types",
],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
5 changes: 4 additions & 1 deletion fbw-common/src/systems/datalink/aoc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../typings"]
"typeRoots": [
"../../../typings",
"../../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-common/src/systems/datalink/atc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../typings"]
"typeRoots": [
"../../../typings",
"../../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
5 changes: 4 additions & 1 deletion fbw-common/src/systems/datalink/router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"moduleResolution": "node",
"target": "ESNext",
"noEmit": true,
"typeRoots": ["../../../typings"]
"typeRoots": [
"../../../typings",
"../../../../../node_modules/@types",
]
},
"include": [
"src/**/*",
Expand Down
1 change: 1 addition & 0 deletions fbw-common/src/systems/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"resolveJsonModule" : true,
"typeRoots": [
"../typings",
"../../../node_modules/@types",
],
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"byte-data": "^19.0.1",
"classnames": "^2.2.6",
"esbuild-plugin-inline-image": "^0.0.8",
"esbuild-style-plugin": "^1.6.0",
"esbuild-style-plugin-v2": "^1.6.5",
"geolib": "^3.3.3",
"i18next": "^21.6.14",
"json5": "^2.2.3",
Expand Down Expand Up @@ -195,4 +195,4 @@
"uuid": "^9.0.0",
"ws": "^7.4.5"
}
}
}
19 changes: 6 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1a6e658

Please sign in to comment.