question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type check command

See original GitHub issue

Description

One way I leverage TypeScript is when making a behavioral change to my project is to ensure the source of the change is a compilation mistake.

Being able to run a type check over the entire project through VS Code and use the TypeScript problem matcher to ensure they are surfaced in the Problems tab

Motivation

Being able to surface all build errors in a repo is very handy, especially when making a change to one to the shared projects.

Suggested Implementation

Until the solution file exists, running tsc -p apps/*/tsconfig.json --noEmit --incremental for each app tsconfig?

Alternate Implementations

Maintain a solution tsconfig.all.json, I read there were some issues with having one so having it named differently should stop it being picked up by VSCode. I think we would then need tsconfig.check.json for each project which sets no-emit and incremental.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:35
  • Comments:40 (10 by maintainers)

github_iconTop GitHub Comments

21reactions
petrkrejcikcommented, Dec 1, 2021

@JakeGinnivan Again - thank you 👍

For anybody interested: this is a repo with working command tsCheck- https://github.com/petrkrejcik/nx-test Steps to add it to your monorepo:

  1. Copy tools/executors/tsCheck
  2. Add to your workspace.json to all desired projects:
{
  "targets": {
    "tsCheck": {
      "executor": "./tools/executors/tsCheck:tsCheck"
    }
  }
}
  1. Run nx run <appName>:tsCheck
12reactions
developer239commented, Aug 7, 2021

@JakeGinnivan that looks nice but I am not sure if the solution is to not use nrwl’s app plugins. 😅 Although I totally understand that this may take months to be resolved…


I know this is open source and everything but do people really use in production something that doesn’t tell them typescript errors by default? We can always write our own solution but that kind of kills the point of “standardization”. 🙂 I focus on code quality and this is a major blocker for me.

Every project should have:

  • eslint
  • prettier
  • stylelint (if FE application)
  • git hooks (lint-staged, husky and commit lint)
  • easy type checking (ignoring an error now and then can easily make the project have hundreds of issues later)

otherwise it should never make it to production. 🙉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - tsc CLI Options - TypeScript
Flag Type Default ‑‑allowJs boolean false ‑‑allowUmdGlobalAccess boolean false ‑‑allowUnreachableCode boolean
Read more >
How to type check a single file from command line, using the ...
Normally I run tsc -p ./tsconfig.json which type checks all files in the .
Read more >
type-check | Yarn - Package Manager
type -check is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax....
Read more >
Type Checking
json to enable rules that work with the type checker. TSLint will lint all files included in your project as specified in tsconfig.json...
Read more >
Introduction to TypeScript type check - eduCBA
TypeScript type check is used to validate the type of any variable at runtime. Type checking has proven to be a good feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found