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

feat(eslint-plugin): [restrict-template-expressions] improve error message #1926

Conversation

ulrichb
Copy link
Contributor

@ulrichb ulrichb commented Apr 22, 2020

This makes it easier to understand the error especially when type inference is involved.

Also refactor (isInnerUnionOrIntersectionConformingTo()) and improve its name by making it more specific (the previous "UnderlyingExpressionType" wasn't really clear).

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @ulrichb!

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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

…(add invalid type)

* Also refactor (`isInnerUnionOrIntersectionConformingTo()`) and improve its name.
* Also add `TWithNoConstraint` test case.
@codecov
Copy link

codecov bot commented Apr 22, 2020

Codecov Report

Merging #1926 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1926      +/-   ##
==========================================
- Coverage   93.93%   93.93%   -0.01%     
==========================================
  Files         172      172              
  Lines        7829     7828       -1     
  Branches     2245     2245              
==========================================
- Hits         7354     7353       -1     
  Misses        217      217              
  Partials      258      258              
Flag Coverage Δ
#unittest 93.93% <100.00%> (-0.01%) ⬇️
Impacted Files Coverage Δ
...-plugin/src/rules/restrict-template-expressions.ts 100.00% <100.00%> (ø)

@ulrichb ulrichb force-pushed the feat/ImproveRestrictTemplateMessage branch from bd90c8b to e49b80f Compare April 22, 2020 11:05
@bradzacher bradzacher added the enhancement New feature or request label Apr 22, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for this!

@bradzacher bradzacher changed the title feat(eslint-plugin): [restrict-template-expressions] Improve message (add invalid type) feat(eslint-plugin): [restrict-template-expressions] improve error message May 17, 2020
@bradzacher bradzacher merged commit 1af59ba into typescript-eslint:master May 17, 2020
@ulrichb ulrichb deleted the feat/ImproveRestrictTemplateMessage branch May 17, 2020 19:50
@ulrichb
Copy link
Contributor Author

ulrichb commented May 17, 2020

@bradzacher: Thanks for your review and merging!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants