Skip to content

fix(eslint-plugin): [no-unnecessary-template] report on types #10207

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

Conversation

omril1
Copy link
Contributor

@omril1 omril1 commented Oct 25, 2024

PR Checklist

Overview

Copied the existing logic and modified it to work on template types instead of just template literal values

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @omril1!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 4c7c2c1
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6738ac021ed93d0008743de7
😎 Deploy Preview https://deploy-preview-10207--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Oct 25, 2024

@JoshuaKGoldberg
Copy link
Member

👋 @omril1 are you planning on continuing/un-drafting this soon? Anything we can help with?

@omril1
Copy link
Contributor Author

omril1 commented Nov 10, 2024

👋 @omril1 are you planning on continuing/un-drafting this soon? Anything we can help with?

I'll get to it in the next couple of days.
There isn't a lot of work left, I need to fix 1 failing test, add tests for enums and then look for ways to reduce code duplication.

@bradzacher bradzacher added the bug Something isn't working label Nov 16, 2024
JoshuaKGoldberg and others added 19 commits November 16, 2024 12:02
…10306)

chore(deps): update dependency webpack to v5.96.0

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
chore(deps): update dependency knip to v5.36.1

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…int#10297)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#10317)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#10320)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…pt-eslint#10192)

* feat(eslint-plugin): added related-getter-setter-pairs rule

* Fixed stack popping

* Fixed stack popping

* Correction: reported getter always has return type annotation

* Correction: reported getter always has return type annotation

* Update packages/eslint-plugin/docs/rules/related-getter-setter-pairs.mdx

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

---------

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
)

* test: fix jest plugin usage in integration test

* fixup
* feat: add to svg

* feat: add the Bluesky

* chore: add cspell like Bluesky

* fix: icon

* fix: sort social links
…eslint#10051)

* initial implementation

* tests

* docs

* more tests

* use checker.typeToString() over getTypeName()

* use link

* oops

* add tests

* remove unnecessary typescript 5.4 warning

* adjust format to new rules

* update error message to be more concise

* match implementation to be inline with no-unsafe-* rules

* rework tests

* refactor

* update snapshots

* fix error message showing original type instead of asserted type

* update snapshots

* add a warning for object stubbing on test files

* fix linting

* adjust test to lint fixes

* simplify type comparison

* rework code-comments and rename variables

* rework the opening paragraph to make it more beginner-friendly

* Update packages/eslint-plugin/docs/rules/no-unsafe-type-assertion.mdx

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>

* fix: narrow/widen in description

---------

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
Co-authored-by: typescript-eslint[bot] <typescript-eslint[bot]@users.noreply.github.com>
…nnecessary-template--report-on-template-types
Copy link

codecov bot commented Nov 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.73%. Comparing base (746560a) to head (4c7c2c1).
Report is 108 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10207      +/-   ##
==========================================
+ Coverage   86.63%   86.73%   +0.10%     
==========================================
  Files         433      434       +1     
  Lines       15202    15275      +73     
  Branches     4439     4463      +24     
==========================================
+ Hits        13170    13249      +79     
+ Misses       1675     1670       -5     
+ Partials      357      356       -1     
Flag Coverage Δ
unittest 86.73% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...in/src/rules/no-unnecessary-template-expression.ts 100.00% <100.00%> (ø)

... and 11 files with indirect coverage changes

@omril1 omril1 closed this Jan 1, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [no-unnecessary-template-expression] should report unnecessary template string in type context
7 participants