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

Fix: Ignore import expressions in no-unused-expressions rule #13387

Merged
merged 1 commit into from Jun 5, 2020
Merged

Fix: Ignore import expressions in no-unused-expressions rule #13387

merged 1 commit into from Jun 5, 2020

Conversation

vkrol
Copy link
Contributor

@vkrol vkrol commented Jun 3, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Tell us about your environment

  • ESLint Version: 7.1.0
  • Node Version: 12.16.3
  • npm Version: 6.14.5

What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

Configuration
module.exports = {
	parserOptions: {
		ecmaVersion: 2020,
	},
	rules: {
		"no-unused-expressions": "error",
	},
};

What did you do? Please include the actual source code causing the issue.

import("foo");

What did you expect to happen?
No error.

What actually happened? Please include the actual, raw output from ESLint.

1:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions

What changes did you make? (Give an overview)

I added ImportExpression to the white list.

Is there anything you'd like reviewers to focus on?

No.

@jsf-clabot
Copy link

jsf-clabot commented Jun 3, 2020

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jun 3, 2020
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jun 4, 2020
@kaicataldo
Copy link
Member

I have verified this. Marked as accepted 👍.

Copy link
Member

@mdjermanovic mdjermanovic 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!

@kaicataldo kaicataldo merged commit e49732e into eslint:master Jun 5, 2020
@vkrol vkrol deleted the ignore-import-expressions-in-no-unused-expressions-rule branch June 6, 2020 12:39
nickbrowne added a commit to conversation/tc-eslint-config that referenced this pull request Sep 16, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 3, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants