Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

TSLint errors cause compile failure (can't use console.log or debugger statements in development) #329

Closed
@BernieSumption

Description

@BernieSumption

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:

  1. Disable the TSLint rule (now console.log statements may find their way into release code)
  2. 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

  1. npm ls react-scripts-ts (if you haven’t ejected): react-scripts-ts@2.16.0
  2. node -v: v8.10.0
  3. npm -v: n/a
  4. yarn --version (if you use Yarn): 1.6.0

Then, specify:

  1. Operating system: Mac
  2. Browser and version (if relevant): n/a

Steps to Reproduce

(Write your steps here:)

  1. create-react-app my-app --scripts-version=react-scripts-ts
  2. Edit src/App.tsx' to add a debugger` statement
  3. 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

image

Reproducible Demo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions