TypeScript/tests/cases/fourslash/annotateWithTypeFromJSDoc20.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

21 lines
366 B
TypeScript

/// <reference path='fourslash.ts' />
// @strict: true
/////**
//// * @param {number} a
//// * @param {T} b
//// */
////function f<T>(a, b) {
////}
verify.codeFix({
description: "Annotate with type from JSDoc",
errorCode: 80004, // ignore 'unused T'
newFileContent:
`/**
* @param {number} a
* @param {T} b
*/
function f<T>(a: number, b: T) {
}`,
});