Skip to content

Commit

Permalink
docs: restrict-template-expressions - remove mention of numbers being…
Browse files Browse the repository at this point in the history
… allowed (#8734)

docs(restrict-template-expressions): remove mention of numbers being allowed

In the `recommended` config, numbers are allowed, but so are several
other types. In the `strict` config, numbers are not allowed. Either
way, "string and number" might not be the right documentation for what's
allowed.
  • Loading branch information
llllvvuu committed Mar 24, 2024
1 parent 4132374 commit c787fe4
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem';
JavaScript automatically [converts an object to a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) in a string context, such as when concatenating it with a string using `+` or embedding it in a template literal using `${}`.
The default `toString()` method of objects returns `"[object Object]"`, which is often not what was intended.
This rule reports on values used in a template literal string that aren't strings, numbers, or BigInts, optionally allowing other data types that provide useful stringification results.
This rule reports on values used in a template literal string that aren't strings, optionally allowing other data types that provide useful stringification results.

:::note

Expand Down

0 comments on commit c787fe4

Please sign in to comment.