3

I've recently set strict: true in the tsconfig.json of a large project. I am working through each file fixing the issues this has brought up. My problem is that I need to visually check the site as I go, but until all the issues are fixed (there's a lot) it won't build.

Is it possible to have the strict compiler option for only specific files, ie. the ones I've fixed, so I can build the project and check if anything's broken?

bordeltabernacle
  • 1,603
  • 5
  • 24
  • 46

1 Answers1

2

Yes - you can place "use strict"; directly in your .ts at the top of the file (i.e., before your imports) to set strict-mode on just that file.

See the answers to this question for details and additional references.