error Parsing error: The keyword 'const' is reserved ESLint Node JS

preview_player
Показать описание
The error Parsing error: The keyword 'const' is reserved typically indicates that ESLint is not properly configured to parse modern JavaScript syntax, such as ES6 features like const.

To resolve this issue, you need to ensure that ESLint is configured to parse modern JavaScript syntax.

1. Update ESLint Configuration

{
"parserOptions": {
"ecmaVersion": 6 // or 2015, which is the year ES6 was released
}
}


parserOptions: {
ecmaVersion: 6 // or 2015
}
};

You can specify the environment in the ESLint configuration file to ensure that it understands the context:

env: {
es6: true, // Enable ES6 syntax
node: true // or browser: true if you're working in a browser environment
},
parserOptions: {
ecmaVersion: 6 // or 2015
}
};
Рекомендации по теме