I'm using eslint for a Node.js application. I'm running node version v10.6.0, but when I run eslint
in the root directory of my project, I get error messages like the following:
The 'URL' is not supported until Node.js 10.0.0. The configured version range is '>=6.0.0'
My .eslintrc.json
looks like this:
{
"extends": [
"eslint:recommended",
"plugin:node/recommended",
],
"parserOptions": {
"sourceType": "module"
}
}
and my package.json
contains:
"engine": {
"node": ">=10.6.0"
}
How can I tell eslint that I'm using a newer node version? I'm using eslint v5.2.0.
While ESLint is designed to be run on the command line, it's possible to use ESLint programmatically through the Node. js API. The purpose of the Node. js API is to allow plugin and tool authors to use the ESLint functionality directly, without going through the command line interface.
There are two primary ways to configure ESLint: Configuration Comments - use JavaScript comments to embed configuration information directly into a file. Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.
Go to C:\Users\\{YourWindowsUsername}\AppData\Local\Microsoft\TypeScript\ESLint . Open the package. json file. You should see the version of ESLint that is installed, in my case it is "eslint": "4.19.
ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins.
The engine
property in the package.json
file is incorrect and should be engines
instead. This is the property that eslint uses to determine the node version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With