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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [no-unused-expressions] inherit messages from base rule #1992

Merged
merged 1 commit into from May 9, 2020

Conversation

G-Rath
Copy link
Contributor

@G-Rath G-Rath commented May 9, 2020

I'm not sure what changed in ESLint 7 that means this is now an error as it was working up until now and nothing else seems to be broken.

I've checked & tested all the other base rules and they either do this or have their own messages, so I don't think it's worth creating an internal rule over (but am happy to do so if it becomes a regular thing - feel free to @ me if so 馃檪 )

This works in both eslint 6 & 7, so 馃し

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @G-Rath!

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.

@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #1992 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1992   +/-   ##
=======================================
  Coverage   93.91%   93.91%           
=======================================
  Files         171      171           
  Lines        7789     7789           
  Branches     2240     2240           
=======================================
  Hits         7315     7315           
  Misses        217      217           
  Partials      257      257           
Flag Coverage 螖
#unittest 93.91% <酶> (酶)
Impacted Files Coverage 螖
...s/eslint-plugin/src/rules/no-unused-expressions.ts 100.00% <酶> (酶)

@yokomotod
Copy link

I found same issue, and I think it's caused by this change: https://github.com/eslint/eslint/pull/12859/files#diff-1a6966737e2148033ccfbc1f11ef3761

which affects here.

@bradzacher
Copy link
Member

I'm not sure what changed in ESLint 7 that means this is now an error as it was working up until now and nothing else seems to be broken.

Before the rule had no messageIds, and the report used raw strings.
Now the rule does use messageIds (you and I added them to heaps of rules!!), so now the context.report is attempting to use a messageId which doesn't exist.

@bradzacher bradzacher added the bug Something isn't working label May 9, 2020
@bradzacher bradzacher changed the title fix(no-unused-expressions): inherit messages from base rule fix(eslint-plugin): [no-unused-expressions] inherit messages from base rule May 9, 2020
@bradzacher bradzacher merged commit 51ca404 into typescript-eslint:master May 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2020
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.

None yet

3 participants