npmnode.js95% confidence\u2191 372

ESLint: "error Parsing error: The keyword 'const' is reserved"

Full error message
I am getting this error from ESLint:

error  Parsing error: The keyword 'const' is reserved

from this code:

const express = require('express');
const app = express();
const _ = require('underscore');

I've tried removing node_modules and reinstalling all npm packages (as suggested here), but to no avail.

ESLint defaults to ES5 syntax-checking. You'll want to override to the latest well-supported version of JavaScript. Try adding a .eslintrc.json file to your project. Inside it: { "env": { "es6": true } } See also this example .eslintrc.json which might help.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/4bc6debda7e7234ec1fd3a913f0f39cdc8202a1124f4af8826769c20a75a643f
hash \u00b7 4bc6debda7e7234ec1fd3a913f0f39cdc8202a1124f4af8826769c20a75a643f
ESLint: "error Parsing error: The keyword 'const&#3… — DepScope fix | DepScope