Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to combine --build and --noEmitOnError=false #43013

Closed
5 tasks done
KnisterPeter opened this issue Mar 1, 2021 · 4 comments
Closed
5 tasks done

Allow to combine --build and --noEmitOnError=false #43013

KnisterPeter opened this issue Mar 1, 2021 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@KnisterPeter
Copy link
Contributor

KnisterPeter commented Mar 1, 2021

Suggestion

πŸ” Search Terms

rapid-prototyping, fast local development, ignore certain errors

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

I would like to see an option to combine the existing noEmitOnError=false behavior with the build mode.

πŸ“ƒ Motivating Example

Allow fast iteration on your code while prototyping.

πŸ’» Use Cases

Fast iteration, local development

It is kind on annoying to test things out or debug sometimes in a bigger project with build mode.
Lets assume you need to build a feature and you start by importing things you will need. Note: Not every import used used currently. That may include an import which is completely unused.

This doesn't allow to iterate over your code, because it refuses to compile:

$ xxx/node_modules/.bin/tsc -b ./path/to/project
xxx/src/index.tsx:7:1 - error TS6192: All imports in import declaration are unused.

7 import { Script, BaseOptions } from 'vm';
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 1.

Some debugging

A developer needs to debug an error. Do make it easier to understand, certain parts of the file are commented out.
That will result in unused imports and in some cases, this will prevent the file to compile.
Now all unused imports need to be commented out or be removed.

This is very annoying, since they need to be added later on again.

Related context

As far as I know, this (noEmitOnError=false) does work on project builds.
In build mode builds this is refused with:

$ xxx/node_modules/.bin/tsc -b ./path/to/project --noEmitOnError=false
error TS5072: Unknown build option '--noEmitOnError=false'.

error Command failed with exit code 1.
@MartinJohns
Copy link
Contributor

Related: #25613

@RyanCavanaugh
Copy link
Member

#32651

rapid-prototyping, fast local development, ignore certain errors

I always suggest searching for the terms you yourself put in the title, since this is what other people are likely to have done:

image

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 2, 2021
@KnisterPeter
Copy link
Contributor Author

@RyanCavanaugh Sorry, I've searched a lot in the issues and didn't matched them. My fault

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants