How to stop checking node_modules

On small projects, I like the automatic listing of MS Code. But the moment the project starts pulling npm dependencies, it becomes useless

Completely unnecessary errors

Is there a way to set up specific folders to check? I know "search.excludeFolders"

, but it doesn't help with this problem.

+3


source to share


1 answer


If you are using TypeScript, you can create a file tsconfig.json

and choose from three options:



  • Provide an explicit list of files to compile, thereby preventing errors from being shown node_modules/*

    .
  • Don't explicitly list the files (by default, all files ./**/*.ts

    will be compiled), but place them tsconfig.json

    inside your source folder, which node_modules

    will automatically be excluded from compilation.
  • Use the new feature exclude

    in tsconfig.json

    (available soon).
+2


source







All Articles