TypeScript/tests/cases/fourslash/annotateWithTypeFromJSDoc17.ts
Andy 24842b4002
When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors (#22361)
* When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors

* Improve performance: do not add unused suggestion diagnostics unless asking for a suggestion

* Add "unused" flag to diagnostics

* Code review

* reportsUnused -> reportsUnnecessary

* Fix test
2018-04-05 12:33:00 -07:00

20 lines
391 B
TypeScript

/// <reference path='fourslash.ts' />
////class C {
//// /**
//// * @param {number} x - the first parameter
//// */
//// constructor(readonly x) {
//// }
////}
verify.codeFix({
description: "Annotate with type from JSDoc",
newFileContent:
`class C {
/**
* @param {number} x - the first parameter
*/
constructor(readonly x: number) {
}
}`,
});