Skip to content Skip to sidebar Skip to footer

Eslint, How To Accept Const And Arrow Function In Javascript?

This is probably somewhere around, but I simply can not find the answer. Below is my eslint config file, but it doesn't accept const and arrow functions. How to change these settin

Solution 1:

From eslint docs:

To address: If you are using any ECMAScript 6 feature flags in ecmaFeatures, you’ll need to use ecmaVersion: 6 instead. The ECMAScript 6 feature flags are:

arrowFunctions - enable arrow functions

binaryLiterals - enable binary literals

blockBindings - enable let and const (aka block bindings)

// In your .eslintrc
{
    env: {
        es6: true
    }
}

// Or in a configuration comment/*eslint-env es6*/

esLint there are a lot of examples

Hope it will help you

Post a Comment for "Eslint, How To Accept Const And Arrow Function In Javascript?"