24842b4002
* 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
23 lines
396 B
TypeScript
23 lines
396 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
// @strict: true
|
|
/////**
|
|
//// * @template T
|
|
//// * @param {number} a
|
|
//// * @param {T} b
|
|
//// */
|
|
////function f(a, b) {
|
|
//// return a || b;
|
|
////}
|
|
|
|
verify.codeFix({
|
|
description: "Annotate with type from JSDoc",
|
|
newFileContent:
|
|
`/**
|
|
* @template T
|
|
* @param {number} a
|
|
* @param {T} b
|
|
*/
|
|
function f<T>(a: number, b: T) {
|
|
return a || b;
|
|
}`,
|
|
});
|