IssueRaiser

Disable type checking for node_modules entirely

## Search Terms skipLibCheck node_modules ignore library exclude ## Suggestion Either a new option or the existing option `skipLibCheck` should be able to disable type checking for node_modules. ## Use Cases A library author might have a faulty import or might only provide typescript files for his library and not transpiled code. As a user of this library I want to be able to disable type checking for a library (or all) because I trust this library has been tested enough in other ways. Another issue where I found a library shipping ts files and causing errors for the user: https://github.com/microsoft/TypeScript/issues/15363 The response at the end is very relevant > I understand that libraries **shouldn't** publish `*.ts` files, but sometimes, they just **do**, and we can't control every other library easily. > I think typescript should not try to apply this kind of setting (here `noImplicitAny`) to the `node_modules` simply because it is meant to be applied to the user code being compiled, not the external dependencies. _Originally posted by @victornoel in https://github.com/microsoft/TypeScript/issues/15363#issuecomment-309459043_ ## Examples I had the case that a library came with a `dist/` folder and almost all types were perfectly arranged in .d.ts files. But one file was making an import from `../index.d.ts`(which seems to be for development purposes, the lib main file is `dist/index.d.ts`) which in turn then imported `src/ClassA.ts` The library author us

Posted by gempir on Sep 8, 2020, 6:10 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Logistics)

Disable type checking for node_modules entirely

gempirSep 8, 2020, 6:10 AM

## Search Terms skipLibCheck node_modules ignore library exclude ## Suggestion Either a new option or the existing option `skipLibCheck` should be able to disable type checking for node_modules. ## Use Cases A library author might have a faulty import or might only provide typescript files for his library and not transpiled code. As a user of this library I want to be able to disable type checking for a library (or all) because I trust this library has been tested enough in other ways. Another issue where I found a library shipping ts files and causing errors for the user: https://github.com/microsoft/TypeScript/issues/15363 The response at the end is very relevant > I understand that libraries **shouldn't** publish `*.ts` files, but sometimes, they just **do**, and we can't control every other library easily. > I think typescript should not try to apply this kind of setting (here `noImplicitAny`) to the `node_modules` simply because it is meant to be applied to the user code being compiled, not the external dependencies. _Originally posted by @victornoel in https://github.com/microsoft/TypeScript/issues/15363#issuecomment-309459043_ ## Examples I had the case that a library came with a `dist/` folder and almost all types were perfectly arranged in .d.ts files. But one file was making an import from `../index.d.ts`(which seems to be for development purposes, the lib main file is `dist/index.d.ts`) which in turn then imported `src/ClassA.ts` The library author us

Comments (0)

No comments yet. Start the discussion.

Comment on this issue