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

async (t) => { } - Expected parentheses around arrow function argument. #416

Closed
azhang opened this issue Feb 10, 2016 · 12 comments

Comments

@azhang
Copy link

commented Feb 10, 2016

I'm getting Expected parentheses around arrow function argument. errors with my async arrow functions. Perhaps this is more of a eslint issue than a standardjs issue?

@feross

This comment has been minimized.

Copy link
Member

commented Feb 10, 2016

There's already another discussion about this here: #414

@feross feross closed this Feb 10, 2016

@azhang

This comment has been minimized.

Copy link
Author

commented Feb 10, 2016

Oh, actually I don't get that issue. I only get errors on async arrow functions.

(t) => {} works
async (t) => {} errors

Sent from my iPhone

On Feb 10, 2016, at 1:43 PM, Feross Aboukhadijeh notifications@github.com wrote:

Closed #416.


Reply to this email directly or view it on GitHub.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 10, 2016

Oh didn't realize this was only for async arrow functions.

@feross feross reopened this Feb 10, 2016

@dhax

This comment has been minimized.

Copy link

commented Feb 11, 2016

having the same issue with async arrow function with basic setup:

   "standard": {
    "parser": "babel-eslint"
  },
  "devDependencies": {
    "babel-eslint": "^4.1.8",
    "babel-preset-es2015-node5": "^1.1.2",
    "babel-preset-stage-0": "^6.3.13",
    "babel-register": "^6.4.3",
    "standard": "^6.0.4"
  }
@cesarandreu

This comment has been minimized.

Copy link
Contributor

commented Feb 11, 2016

Having the same issue. This prevents us from upgrading to standard v6.

@azhang

This comment has been minimized.

Copy link
Author

commented Feb 11, 2016

I made an issue in the babel-eslint repo as well: babel/babel-eslint#252

@benjyhirsch

This comment has been minimized.

Copy link

commented Feb 13, 2016

This is a known issue with some of the rules in babel-eslint, hence https://github.com/babel/eslint-plugin-babel

From the description:

An eslint plugin companion to babel-eslint. babel-eslint does a great job at adapting eslint for use with Babel, but it can't change the built in rules to support experimental features. eslint-plugin-babel re-implements problematic rules so they do not give false positives or negatives.

One of the rules is:

babel/arrow-parens: Handles async functions correctly

@cesarandreu

This comment has been minimized.

Copy link
Contributor

commented Feb 18, 2016

This issue keeps us from upgrading, we're using async arrow functions a lot. Even if we add eslint-plugin-babel, according to #404 it seems v7 is gonna be removing "rules", so we'd have no way of replacing the eslint rule with the plugin rule?

Hmm, maybe making a standard-babel would make sense?

@feross

This comment has been minimized.

Copy link
Member

commented Feb 20, 2016

@cesarandreu That's certainly one option, but I wonder if we shouldn't just disable/change this rule given the opposition to it in the other issue #414 (comment)

@cesarandreu

This comment has been minimized.

Copy link
Contributor

commented Feb 29, 2016

That'd also work :D. I've kinda grown to like it, just because it's consistent, but since it breaks with async arrow functions it's annoying :(.

@sotojuan sotojuan referenced this issue Apr 4, 2016
10 of 10 tasks complete
@namuol

This comment has been minimized.

Copy link

commented Apr 9, 2016

TL;DR -- Here's the workaround that solves the problem:

npm install eslint-plugin-babel --save-dev

Then, in your eslintrc:

{
  // ...

  "plugins": [
    "babel"
  ],

  "rules": {
    // ...
    "arrow-parens": 0,
    "babel/arrow-parens": 2
  }
}
@feross

This comment has been minimized.

Copy link
Member

commented Apr 24, 2016

This should be fixed now in standard version 7.0.0-beta.0 which removed the arrow function parens rule.

@feross feross closed this Apr 24, 2016

cecton added a commit to mu-semtech/mu-javascript-template that referenced this issue May 9, 2016

Upgrade standard to 7.0
Syntax issue with the linter on ES6 async arrow functions

standard/standard#416

cecton added a commit to mu-semtech/mu-javascript-template that referenced this issue May 9, 2016

Promisify (#2)
* Added sparql module has helper for the template

* .gitignore

* Update custom handler example using async/await

* Upgrade standard to 7.0

Syntax issue with the linter on ES6 async arrow functions

standard/standard#416

* Update hapi-sparql and the examples

* Improves test and better coverage

* Disable eslint on codeclimate

This is duplicated with the build on Travis CI because it runs already
the linter.

* Implements SPARQL validation

* Enforces linting when committing and pushing

* Improves code by removing redundancy

* Imports escaping methods from hapi-sparql

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
6 participants
You can’t perform that action at this time.