You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having both a .ts file and the respective .js file both open in VSCode, you get a "Cannot re-declare block-scoped variable" error messages which disappears once you close the .js file.
Steps to reproduce:
1- Create a hello.ts file with the following code:
const msg: string = "Hello Typescript World!";
console.log(msg);
let id: number = 5
id = '5'
2- Save it and compile it with Typescript compiler. The file should have one Type 'string' error
3- Open the generated hello.js file
4- Switch back to the hello.ts file and notice the two additional "Cannot re-declare block-scoped variable" errors.
5- Close the hello.js file and notice the two errors are gone.
Expected behavior:
No "Cannot re-declare block-scoped variable" errors should be raised.
The text was updated successfully, but these errors were encountered:
walidsi
changed the title
False Errors in .ts files when opening both .ts and respective .js file side by side
False Errors in .ts file when opening both .ts and respective .js file side by side
Oct 6, 2022
walidsi
changed the title
False Errors in .ts file when opening both .ts and respective .js file side by side
False Typescript errors in .ts file when opening both .ts and respective .js file side by side
Oct 6, 2022
When having both a .ts file and the respective .js file both open in VSCode, you get a "Cannot re-declare block-scoped variable" error messages which disappears once you close the .js file.
Steps to reproduce:
1- Create a hello.ts file with the following code:
2- Save it and compile it with Typescript compiler. The file should have one Type 'string' error
3- Open the generated hello.js file
4- Switch back to the hello.ts file and notice the two additional "Cannot re-declare block-scoped variable" errors.
5- Close the hello.js file and notice the two errors are gone.
Expected behavior:
The text was updated successfully, but these errors were encountered: