style-guide icon indicating copy to clipboard operation
style-guide copied to clipboard

Loosen `@typescript-eslint/restrict-template-expressions`

Open mrmckeb opened this issue 10 months ago • 0 comments

The new strict rules are very restrictive, requiring numbers to be stringified. This might make sense in UIs, but for things logs this is probably too much.

For example, the following is currently an error:

console.log(`Counted ${number} users`);

We could loosen this to allow the following:

const options: Options = [
  {  
    allowAny: false,
    allowNullish: false,
    allowNever: false,
    // Considered low risk.
    allowBoolean: true,
    allowNumber: true,
    allowRegExp: true,
  },
];

For more, see: https://typescript-eslint.io/rules/restrict-template-expressions/

mrmckeb avatar Apr 09 '24 04:04 mrmckeb