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

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 19, 2024
1 parent 4d6d0d5 commit 56de4c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
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 56de4c4

Please sign in to comment.