-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): remove no-useless-template-literals #9207
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
Merged
kirkwaiblinger
merged 8 commits into
typescript-eslint:v8
from
y-hsgw:remove-no-useless-template-literals
Jun 4, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b5aae54
remove no-useless-template-literals rule
y-hsgw 87d2982
fix no-useless-template-literals docs
y-hsgw af63225
revert removal
y-hsgw 9401d15
keep as tombstone page
y-hsgw c7a4ba5
fix doc
y-hsgw 015248b
Merge branch 'v8' of https://github.com/y-hsgw/typescript-eslint into…
y-hsgw 8cfc409
fix docs test
y-hsgw 2936bd5
fix doc
y-hsgw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to call out that this will probably cause merge conflicts when #8688 and #8673 get merged to main. But, the resolution is basically trivial (prefer this changeset over the other one), so I'm guessing there's no reason to consider blocking the PR or anything.
cc @JoshuaKGoldberg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, agreed!