TypeScript/tests/cases/fourslash/codeFixUnusedIdentifier_prefix.ts
sergeir82 b346f5764e
prefix-unused-parameter-with-_ codefix now works in jsdoc @param (#36152)
* Fix prepending unused TypeScript variables with underscore doesn't rename JSDoc @param.
Fix test for quick fix "Prefix all unused declarations with '_' where possible".
Fixes #33021.

* Replace FindAllReferences.Core.eachSymbolReferenceInFile function call to more ligher call of getJSDocParameterTags when searching for a parameter in jsdoc.

* Remove redundant constant declaration.

* Add test for prefix single unused parameter in jsdoc.
2020-04-17 13:18:05 -07:00

26 lines
373 B
TypeScript

/// <reference path='fourslash.ts' />
// @noUnusedLocals: true
// @noUnusedParameters: true
/////**
//// * @param a
//// * @param b
//// */
////function f(a, b) {
//// const x = a;
////}
verify.codeFix({
description: "Prefix 'b' with an underscore",
index: 1,
newFileContent:
`/**
* @param a
* @param _b
*/
function f(a, _b) {
const x = a;
}`,
});