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

Add eslint plugin babel #110

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

franciscomorais
Copy link

@franciscomorais franciscomorais commented Mar 27, 2020

This PR adds the eslint-plugin-babel plugin to replace the no-unused-expressions rule to babel/no-unused-expressions. This rule doesn't work well with optical chaining, like this:

var foo = null;

foo?.bar();

Add babel plugin and replace no-unused-expressions rule to
babel/no-unused-expressions to accept calls with optical chain.
test/fixtures/correct.js Outdated Show resolved Hide resolved
test/fixtures/correct.js Outdated Show resolved Hide resolved
test/fixtures/correct.js Outdated Show resolved Hide resolved
test/fixtures/incorrect.js Show resolved Hide resolved
test/fixtures/incorrect.js Outdated Show resolved Hide resolved
test/fixtures/incorrect.js Outdated Show resolved Hide resolved
test/fixtures/incorrect.js Outdated Show resolved Hide resolved
test/fixtures/incorrect.js Show resolved Hide resolved
test/fixtures/incorrect.js Outdated Show resolved Hide resolved
@franciscomorais
Copy link
Author

@joaonice ping.

@@ -43,6 +43,7 @@
},
"dependencies": {
"babel-eslint": "10.0.1",
"eslint-plugin-babel": "^5.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

eslint-plugin-babel was renamed to @babel/eslint-plugin, please update this to use that one instead.

@bsonntag
Copy link
Contributor

I'll take over this.

@bsonntag
Copy link
Contributor

Hm, turns out we need to upgrade to Eslint v7 first to be able to use @babel/eslint-plugin...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment