b346f5764e
* 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.
28 lines
698 B
TypeScript
28 lines
698 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @noUnusedLocals: true
|
|
// @noUnusedParameters: true
|
|
|
|
/////**
|
|
//// * @param a First parameter.
|
|
//// * @param b Second parameter.
|
|
//// */
|
|
////function f(a, b) {
|
|
//// const x = 0; // Can't be prefixed, ignored
|
|
////}
|
|
////type Length<T> = T extends ArrayLike<infer U> ? number : never;
|
|
|
|
verify.codeFixAll({
|
|
fixId: "unusedIdentifier_prefix",
|
|
fixAllDescription: "Prefix all unused declarations with '_' where possible",
|
|
newFileContent:
|
|
`/**
|
|
* @param _a First parameter.
|
|
* @param _b Second parameter.
|
|
*/
|
|
function f(_a, _b) {
|
|
const x = 0; // Can't be prefixed, ignored
|
|
}
|
|
type Length<T> = T extends ArrayLike<infer _U> ? number : never;`,
|
|
});
|