b0450aed56
* Add codefix for --noImplicitThis * Code review * Back to building post-merge * Remove redundant functions + update tests Infer-from-usage also inserts `this: any` parameters when needed, so I removed that from fixImplicitThis. Otherwise, fixImplicitThis has better suggestions than inferFromUsage, so I moved inferFromUsage later in the suggestion order. * More redundancy removal Don't need to add `@this` anymore either since inferFromUsage will do that. * More baseline updates From moving inferFromUsage down in priority I think? * remove now-redundant ad-hoc jsdoc emit * fix more bad merge Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
31 lines
516 B
TypeScript
31 lines
516 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @noImplicitThis: true
|
|
|
|
////class C {
|
|
//// m() {
|
|
//// function f() {
|
|
//// this;
|
|
//// }
|
|
//// const g = function() {
|
|
//// this;
|
|
//// };
|
|
//// }
|
|
////}
|
|
|
|
verify.codeFixAll({
|
|
fixId: "fixImplicitThis",
|
|
fixAllDescription: "Fix all implicit-'this' errors",
|
|
newFileContent:
|
|
`class C {
|
|
m() {
|
|
const f = () => {
|
|
this;
|
|
}
|
|
const g = () => {
|
|
this;
|
|
};
|
|
}
|
|
}`,
|
|
});
|