Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mrmckeb opened this issue Apr 9, 2024 · 0 comments
Open

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

mrmckeb opened this issue Apr 9, 2024 · 0 comments
Labels
enhancement New feature or request eslint

Comments

@mrmckeb
Copy link
Contributor

mrmckeb commented Apr 9, 2024

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 mrmckeb added enhancement New feature or request eslint labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request eslint
Projects
None yet
Development

No branches or pull requests

1 participant