Catches unnecessary template expressions such as string expressions within a template literal.
A single options object has the following properties.
Whether to enable the fixer. Defaults to true.
| Context | everywhere |
| Tags | `` |
| Recommended | false |
| Settings | |
| Options | enableFixer |
The following patterns are considered problems:
/**
* @type {`A${'B'}`}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {`A${'B'}`}
*/
// "jsdoc/ts-no-unnecessary-template-expression": ["error"|"warn", {"enableFixer":false}]
// Message: Found an unnecessary string literal within a template.
/**
* @type {(`A${'B'}`)}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {`A${'B'}`|SomeType}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {`${B}`}
*/
// Message: Found a lone template expression within a template.
/**
* @type {`${B}`}
*/
// "jsdoc/ts-no-unnecessary-template-expression": ["error"|"warn", {"enableFixer":false}]
// Message: Found a lone template expression within a template.
/**
* @type {`A${'B'}${'C'}`}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {`A${'B'}C`}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {`${'B'}`}
*/
// Message: Found an unnecessary string literal within a template.
/**
* @type {(`${B}`)}
*/
// Message: Found a lone template expression within a template.
/**
* @type {`${B}` | number}
*/
// Message: Found a lone template expression within a template.The following patterns are not considered problems:
/**
* @type {`AB`}
*/
/**
* @type {`A${C}B`}
*/
/**
* @param {BadType<} someName
*/
/**
* @param {`A${'B'}`} someName
*/
// Settings: {"jsdoc":{"mode":"jsdoc"}}