FlowCrypt / flowcrypt-browser

FlowCrypt Browser extension for Chrome and Firefox
https://flowcrypt.com
Other
372 stars 48 forks source link

vscode - errors in content script #5746

Closed tomholub closed 2 days ago

tomholub commented 1 month ago

I can build it without errors, but the IDE is not happy. Are you seeing the same, or is it just me?

image
sosnovsky commented 1 month ago

Same for me - VS Code showing errors, but builds without any issues. Looks like some updates are needed for types in Bm - https://github.com/FlowCrypt/flowcrypt-browser/blob/dd2cdb80151bf7f7c69a51d75f2e936a905e7984/extension/js/common/browser/browser-msg.ts#L112

tomholub commented 1 month ago

From what I recall, when it builds fine but vscode is unhappy with specifically content script types, it's because vscode is set up with the rest of the browser extension code environment in mind, content scripts being code for a bit of a separate environment which confuses it.

I think the project follows the default ./tsconfig.json but content scripts follow ./conf/tsconfig.content_scripts.json, which then throws errors when working on content scripts with the ./tsconfig.json settings in vscode.

I guess one possibility would be to have a separate code-workspace file that is tailored for the content scripts only. Which is inconvenient. Or perhaps some other project settings, where it could use separate tsconfig for content scripts folder if possible.

But of course, if it can be managed to fix this just by updating types, then we could just do that.