TypeScript/tests/cases/fourslash/codeFixUnusedIdentifier_all_prefix.ts
Andy d40d54984e
Support deleting all unused type parameters in a list, and deleting @template tag (#25748)
* Support deleting all unused type parameters in a list, and deleting @template tag

* Support type parameter in 'infer'
2018-07-27 11:55:31 -07:00

20 lines
544 B
TypeScript

/// <reference path='fourslash.ts' />
// @noUnusedLocals: true
// @noUnusedParameters: true
////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:
`function f(_a, _b) {
const x = 0; // Can't be prefixed, ignored
}
type Length<T> = T extends ArrayLike<infer _U> ? number : never;`,
});