Add support for arrow functions #952

valueof opened this Issue Mar 22, 2013 · 8 comments


None yet
5 participants

valueof commented Mar 22, 2013

ES6 implements arrow functions that look something like this:

function test() {
  return x () => { ... };

One major browser (Firefox) had already shipped support for this type of functions and, since they're officially in ES6, we also need to support them under the esnext flag.

What needs to be done

JSHint should correctly parse arrow functions (as per spec) keeping in mind the new scope, etc.

There's bounty on this bug

You can get paid to fix this bug! See our page on BountySource for more info.


rwaldron commented Mar 22, 2013


guyzmo referenced this issue Mar 28, 2013


fixes #952 #971


guyzmo commented Mar 29, 2013



valueof commented Apr 9, 2013


valueof closed this Apr 9, 2013


mgol commented Nov 20, 2013

@antonkovalyov I don't see it... Using the jsHint 2.3.0 the following code:

const g = x => x * x;

produces an error:

'x' is not defined

And yes, I have esnext turned on and it shows since jsHint doesn't complain about const here.


valueof commented Nov 20, 2013

This is a known bug with our arrow function support which I intend to fix very soon.


mgol commented Nov 21, 2013

@antonkovalyov Got it. What works, then? i tried wrapping 'x' in params and it didn't help.

Btw, I believe your example from the initial post is incorrect, arrow functions cannot be named in this way.

EDIT: oh well, it seems arrow functions can be named. I wonder why I haven't seen any examples of that before.

Mithgol commented Dec 25, 2013

@mzgol Fixed in #1363, I presume.


mgol commented Dec 25, 2013

@Mithgol Yes, it's fixed now. :) Thanks, @antonkovalyov!

@wiredearp wiredearp added a commit to Tradeshift/tradeshift-ui that referenced this issue Dec 6, 2016

@wiredearp wiredearp JSHint :)
Update package to survive jshint/jshint#952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment