Closed
Description
Suggestion
π Search Terms
allow unused imports, allow unused functions
β Viability Checklist
My suggestion meets these guidelines:
- [ X ] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [ X ] This wouldn't change the runtime behavior of existing JavaScript code
- [ X ] This could be implemented without emitting different JS based on the types of the expressions
- [ X ] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [ X ] This feature would agree with the rest of TypeScript's Design Goals.
β Suggestion
I, as developer, dont want to be constantly annoyed by the compiler exciting because I uncommented some function while debugging code, such that it became unused.
Ideally I would like the compiler to spit out warning during development and spit out errors during production compile.
I can also imagine to add compiler options such as "allowUnusedImport" and "allowUnusedFunction". Currently only unused Variables and parameters are supported.
π Motivating Example
function debuggedFunction(): void {
... some code ...
// someFunctionIBrieflyWantToCommentOut();
... some code ...
}
private someFunctionIBrieflyWantToCommentOut(): void {
... some code ...
}
π» Use Cases
- Development
- Debugging