-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Closed
Copy link
Labels
Domain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
TypeScript Version: 3.8.0-beta
Search Terms:
- quick fix
- declare property
Code
For the code:
class Foo {
constructor() {
this._bar = 1;
}
}
new Foo().other = 'a';
Trigger the quick fix to declare a missing property on _bar
.
Expected behavior:
The quick fix adds a private property _bar
:
class Foo {
private _bar: number;
constructor() {
this._bar = 1;
}
}
Actual behavior:
The quick fix adds a standard public property:
class Foo {
_bar: number;
constructor() {
this._bar = 1;
}
}
Playground Link:
Related Issues:
/cc @JacksonKearl
Metadata
Metadata
Assignees
Labels
Domain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript