vercel / style-guide

Vercel's engineering style guide
Mozilla Public License 2.0
1.18k stars 29 forks source link

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

Open mrmckeb opened 2 months ago

mrmckeb commented 2 months ago

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/