This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
restrictTemplateExpressions
, @typescript-eslint/restrict-template-expressions
#4347
jpike88
started this conversation in
Suggestions
Replies: 1 comment
-
This rule requires type info. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
JavaScript will call toString() on an object when it is converted to a string, such as when + adding to a string or in ${} template literals. The default Object .toString() returns "[object Object]", which is often not what was intended. This rule reports on values used in a template literal string that aren't primitives and don't define a more useful .toString() method.
Beta Was this translation helpful? Give feedback.
All reactions