How to fix ‘console.log are not allowed’ error with TypeScript tslint?

Sometimes, we want to fix ‘console.log are not allowed’ error with TypeScript tslint.

In this article, we’ll look at how to fix ‘console.log are not allowed’ error with TypeScript tslint.

How to fix ‘console.log are not allowed’ error with TypeScript tslint?

To fix ‘console.log are not allowed’ error with TypeScript tslint, we can disable the no-console rule.

To do this, we write

{
  //...
  "rules": {
    "no-console": false
  }
  //...
}

in tslint.json in our project.

Conclusion

To fix ‘console.log are not allowed’ error with TypeScript tslint, we can disable the no-console rule.