Description
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.