TypeScript/tests/cases/fourslash/annotateWithTypeFromJSDoc1.ts
Nathan Shively-Sanders 60efb65931
infer-from-usage suggestions can't be ignored, and always do something when invoked. (#28206)
* Do not ts-ignore noImplicitAny suggestions

Still need to write tests.

* Add tests

* More tests

* Update baselines
2018-10-29 13:23:33 -07:00

18 lines
488 B
TypeScript

/// <reference path='fourslash.ts' />
// @Filename: test123.ts
/////** @type {number} */
////var [|x|];
verify.getSuggestionDiagnostics([
{ message: "JSDoc types may be moved to TypeScript types.", code: 80004 },
{ message: "Variable 'x' implicitly has an 'any' type, but a better type may be inferred from usage.", code: 7043 }]);
verify.codeFix({
description: "Annotate with type from JSDoc",
index: 0,
newFileContent:
`/** @type {number} */
var x: number;`,
});