TSLint errors cause compile failure (can't use console.log or debugger statements in development) #329
Description
Another similar issue 171 deals with Typescript errors caused by semantic checks like noUnusedGlobals. This issue refers to the fact that TSLint errors cause compile errors.
The difference between this and the above issue is that it is possible to argue that it is good for developers to be forced to adhere to tsc's semantic checks as they develop, and indeed in the above linked issue many people do argue this.
It is much harder to argue that developers should be forbidden from using console.log or debugger statements during development. How else are we supposed to debug our applications?
Current workarounds:
- Disable the TSLint rule (now console.log statements may find their way into release code)
- Eject the app and configure it to not make TSLint errors fatal
Is this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
N/a
Which terms did you search for in User Guide?
console.log, debugger, tslint
Environment
npm ls react-scripts-ts
(if you haven’t ejected): react-scripts-ts@2.16.0node -v
: v8.10.0npm -v
: n/ayarn --version
(if you use Yarn): 1.6.0
Then, specify:
- Operating system: Mac
- Browser and version (if relevant): n/a
Steps to Reproduce
(Write your steps here:)
create-react-app my-app --scripts-version=react-scripts-ts
- Edit
src/App.tsx' to add a
debugger` statement yarn start
Expected Behavior
Debugger pauses on debugger
statement
Actual Behavior
Failed to compile
/Users/bernie/Desktop/untitled folder/demo/src/App.tsx
(8,5): Use of debugger statements is forbidden