Exclude node_modules from indexing but keep typescript declarations.

The problem is if I exclude node_modules from indexing Iose IntelliSense and all the help regarding the packages I use.
However, If I don't exclude it, I see node_modules stuff appear in search, refactor, and other unnecessary places.

All I want to do is to only keep TS Declarations and not to see node_modules packages anywhere in search.

1

The IDE auto-excludes node_modules, but adds direct project dependencies to javascript library for completion/navigation, etc. so that they still appear in search when using the scopes that include libraries, this is expected

You can disable the auto-generated library and create a new one, adding the required folders with types definitions to it only

0

I had a problem completion didn't work so I stopped excluding node_modules.
What do you mean by direct project dependencies? doesn't IDE include dev dependencies for code completion/navigation, etc?

0

Direct means the dependencies listed in package.json, both dependencies and devDependencies.

0

so If node_modules is marked as excluded still the code completion should be available, right?.

0

Yes - if the auto-created library is there

0

Elena Pogorelova What if they are dependencies of dependencies? My autocomplete and TypeScript breaks for those :(

0

Only the direct dependencies are included in the library. Indirect ones (dependencies of dependencies) are normally excluded. But you can un-exclude them by marking the corresponding folder Not Excluded (right-click the folder, choose Mark Directory As | Not Excluded).

0

请先登录再写评论。