forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): remove no-useless-template-literals (typescript-…
…eslint#9207) * remove no-useless-template-literals rule * fix no-useless-template-literals docs * revert removal * keep as tombstone page * fix doc * fix docs test * fix doc
- Loading branch information
Showing
10 changed files
with
3 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 2 additions & 20 deletions
22
packages/eslint-plugin/docs/rules/no-useless-template-literals.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
--- | ||
description: 'Disallow unnecessary template literals.' | ||
--- | ||
:::danger Deprecated | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
This rule has been renamed to [`no-unnecessary-template-expression`](./no-unnecessary-template-expression.mdx). See [#8544](https://github.com/typescript-eslint/typescript-eslint/issues/8544) for more information. | ||
|
||
> 🛑 This file is source code, not the primary documentation location! 🛑 | ||
> | ||
> See **https://typescript-eslint.io/rules/no-useless-template-literals** for documentation. | ||
This rule reports template literals that contain substitution expressions (also variously referred to as embedded expressions or string interpolations) that are unnecessary and can be simplified. | ||
|
||
:::warning | ||
This rule is being renamed to [`no-unnecessary-template-expression`](./no-unnecessary-template-expression.mdx). | ||
The current name, `no-useless-template-literals`, will be removed in a future major version of typescript-eslint. | ||
|
||
After the creation of this rule, it was realized that the name `no-useless-template-literals` could be misleading, seeing as this rule only targets template literals with substitution expressions. | ||
In particular, it does _not_ aim to flag useless template literals that look like `` `this` `` and could be simplified to `"this"`. | ||
If you are looking for such a rule, you can configure the [`@stylistic/ts/quotes`](https://eslint.style/rules/ts/quotes) rule to do this. | ||
::: | ||
|
||
{/* Intentionally Omitted: When Not To Use It */} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
176 changes: 0 additions & 176 deletions
176
packages/eslint-plugin/src/rules/no-useless-template-literals.ts
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-useless-template-literals.shot
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.