title: eslint parsing error: Parsing error: Unexpected token =>
body: <p>I'm using node v7.10.0 that supports ES6 and because of that I don't transpile my code.</p>
  
  <p>ESLint v3.19.0 gives a error <code>Parsing error: Unexpected token =&gt;</code> at the following code.</p>
  
  <p><strong>Give errors:</strong></p>
  
  <pre><code>module.exports = {
  
      index: async (req, res) =&gt; {
          await functionThatReturnsSomePromise();
    }
  }
  </code></pre>
  
  <p>Also when I just use function it fails with the error <code>Parsing error: Unexpected token function</code></p>
  
  <p><strong>Give errors:</strong></p>
  
  <pre><code>module.exports = {
  
      index: async function(req, res) {
          await functionThatReturnsSomePromise();
    }
  }
  </code></pre>
  
  <p>When I define a class like this the linter doesn't complain about it:</p>
  
  <p><strong>No errors:</strong></p>
  
  <pre><code>class test {
  
      testing() {
          async () =&gt; {
              console.log('test');
          }
      }
  }
  </code></pre>
  
  <p><strong>.eslintrc</strong></p>
  
  <pre><code>{
    "extends": "eslint:recommended",
    "ecmaFeatures": {
      "binaryLiterals": true,                    // enable binary literals
       "blockBindings": true,                      // enable let and const (aka block bindings)
       "defaultParams": true,                     // enable default function parameters
       "forOf": true,                             // enable for-of loops
       "generators": true,                        // enable generators
       "objectLiteralComputedProperties": true,   // enable computed object literal property names
       "objectLiteralDuplicateProperties": true,  // enable duplicate object literal properties in strict mode
       "objectLiteralShorthandMethods": true,     // enable object literal shorthand methods
       "objectLiteralShorthandProperties": true,  // enable object literal shorthand properties
       "octalLiterals": true,                     // enable octal literals
       "regexUFlag": true,                        // enable the regular expression u flag
       "regexYFlag": true,                        // enable the regular expression y flag
       "templateStrings": true,                   // enable template strings
       "unicodeCodePointEscapes": true,           // enable code point escapes
       "jsx": true                                // enable JSX
    },
  
    "env": {
      "browser": false,     // browser global variables.
      "node": true,        // Node.js global variables and Node.js-specific rules.
      "es6": true,          // for ES6
      "amd": false,         // defines require() and define() as global variables as per the amd spec.
      "mocha": true,       // adds all of the Mocha testing global variables.
      "jasmine": false,     // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
      "phantomjs": false,   // phantomjs global variables.
      "jquery": false,      // jquery global variables.
      "prototypejs": false, // prototypejs global variables.
      "shelljs": false      // shelljs global variables.
    },
  
    "globals": {
      // e.g. "angular": true
    },
  
    "parserOptions": {
        "ecmaVersion": 7,
        "sourceType": "module",
        "ecmaFeatures": {
          arrowFunctions: true,
          defaultParams: true
        }
    },
  
    "rules": {
      ////////// Stylistic Issues //////////
  
      "no-underscore-dangle": 0,      // disallow dangling underscores in identifiers
  
  
      ////////// ECMAScript 6 //////////
  
      "no-var": 2          // require let or const instead of var (off by default)
    }
  }
  </code></pre>
  
  <p>How can I fix this?</p>