Hi,
Premise: I looked carefully for existing issues but didn't find a working answer (although I found many speaking about the same topic).
I am working with Visual Studio 2017, on an ASP.NET MVC Core application where the front end will be implemented using React, ES6 and Babel. No TypeScript.
I have a node_modules folder, hidden in FS and excluded from project, which contains some source .ts files from an external library (react-router).
When I open the solution, after few minutes 4 errors appear as compilation error (TS2304 Cannot find name 'object')

What I tried to do:
- Add following configuration to inside .csproj file + Close and Reopen solution
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
- Disable JavaScript/TypeScript new service + Close and Reopen solution

But this wasn't sufficient. To resolve, I needed to disable the TypeScript extension completely from VS and close every instance of VS 2017.
- Disable TypeScript extension

Which in turn removed completely the "JavaScript/TypeScript" entry from Options / Text Editor settings.
Expected behavior:
TS2304 Errors should not appear for files that are not included in the project. In the same way as C# files that are not included in the project (or are not set to "Compile" build action) do not affect compilation (for example). This should not require any special action.
Actual behavior:
Behavior of TypeScript files is inconsistent with other programming languages used in VS. Compilation errors such as TS2304 are appearing also for files that are excluded from project and even hidden in file system.
Kind Regards,
Roberto
Hi,
Premise: I looked carefully for existing issues but didn't find a working answer (although I found many speaking about the same topic).
I am working with Visual Studio 2017, on an ASP.NET MVC Core application where the front end will be implemented using React, ES6 and Babel. No TypeScript.
I have a
node_modulesfolder, hidden in FS and excluded from project, which contains some source .ts files from an external library (react-router).When I open the solution, after few minutes 4 errors appear as compilation error (TS2304 Cannot find name 'object')
What I tried to do:
But this wasn't sufficient. To resolve, I needed to disable the TypeScript extension completely from VS and close every instance of VS 2017.
Which in turn removed completely the "JavaScript/TypeScript" entry from
Options / Text Editorsettings.Expected behavior:
TS2304 Errors should not appear for files that are not included in the project. In the same way as C# files that are not included in the project (or are not set to "Compile" build action) do not affect compilation (for example). This should not require any special action.
Actual behavior:
Behavior of TypeScript files is inconsistent with other programming languages used in VS. Compilation errors such as TS2304 are appearing also for files that are excluded from project and even hidden in file system.
Kind Regards,
Roberto