Skip to content

Commit

Permalink
feat: disable @typescript-eslint/restrict-template-expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
tksst committed Mar 31, 2024
1 parent ab7f27c commit b6efa41
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/disable-restrict-template-expressions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tksst/eslint-config": minor
---

Disable [@typescript-eslint/restrict-template-expressions](https://typescript-eslint.io/rules/restrict-template-expressions/). It's too restrictive for me.
11 changes: 0 additions & 11 deletions src/lib/__snapshots__/calculated.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1060,17 +1060,6 @@ exports[`ESLint calculated config Snapshot > .ts 1`] = `
"allowRegExp": false,
},
],
"@typescript-eslint/restrict-template-expressions": [
2,
{
"allowAny": false,
"allowBoolean": false,
"allowNever": false,
"allowNullish": false,
"allowNumber": false,
"allowRegExp": false,
},
],
"@typescript-eslint/return-await": [
1,
"always",
Expand Down
5 changes: 5 additions & 0 deletions src/lib/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,7 @@ exports[`config snapshot > config.typeScript 1`] = `
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": [
"warn",
"always",
Expand Down Expand Up @@ -1792,6 +1793,7 @@ exports[`config snapshot > config.typeScriptOnly 1`] = `
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": [
"warn",
"always",
Expand Down Expand Up @@ -2802,6 +2804,7 @@ exports[`preset snapshots > preset.typeScript 1`] = `
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": [
"warn",
"always",
Expand Down Expand Up @@ -3837,6 +3840,7 @@ exports[`preset snapshots > preset.typeScript jest: true 1`] = `
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": [
"warn",
"always",
Expand Down Expand Up @@ -4878,6 +4882,7 @@ exports[`preset snapshots > preset.typeScript vitest: true 1`] = `
"@typescript-eslint/no-useless-empty-export": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/return-await": [
"warn",
"always",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ const typeScriptOnly = [
"@typescript-eslint/no-unused-expressions": "error",
// this is set by @eslint/js recommended but not needed for TypeScript
"valid-typeof": "off",
// This is enabled by typescript-eslint/recommended-type-checked, but it is too strict for me.
"@typescript-eslint/restrict-template-expressions": "off",
},
},
] satisfies Linter.FlatConfig[];
Expand Down

0 comments on commit b6efa41

Please sign in to comment.