Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add support for arrow functions #952

valueof opened this Issue · 8 comments

5 participants


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.



@guyzmo guyzmo referenced this issue

fixes #952 #971





@valueof valueof closed this

@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.


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


@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.


@mzgol Fixed in #1363, I presume.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.