"node" environment is missing `URL` global
See original GitHub issueTell us about your environment
- ESLint Version:
4.19.1
- Node Version:
10.0.0
- npm Version:
5.6.0
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint@8.2.3
Please show your full configuration:
Configuration
{
"env": {
"jest": true,
"node": true
},
"extends": [
"bespoke",
"plugin:react/recommended"
],
"parser": "babel-eslint"
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
new URL(import.meta.url).pathname
eslint --ext .mjs --ignore-path .gitignore .
What did you expect to happen?
URL
to be a known global when specifying "node": true
. (SEE https://nodejs.org/api/url.html)
What actually happened? Please include the actual, raw output from ESLint.
4:17 error 'URL' is not defined no-undef
I’m using babel-eslint
until import.meta
is more widely supported.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[node] Missing global URL and URLSearchParams typings
Therefore the global URL and URLSearchParams has been removed again. This fix (actually a workaround for a missing declaration merging feature ...
Read more >dotenv file is not loading environment variables - Stack Overflow
This solved my issues in Node v8.14.1 : const path = require('path') require('dotenv').config({ path: path.resolve(__dirname, '../.env') }).
Read more >Working with Environment Variables in Node.js - Twilio
Environment variables are a great way to configure parts of your Node.js application. Learn how to work with them using helpful tools such ......
Read more >Using Environment Variables in Node.js for App Configuration ...
Learn why experienced Node.js developers use environment variables for app config and secrets, including how to manage default values and ...
Read more >Configure Node.js apps - Azure App Service - Microsoft Learn
Learn how to configure a Node.js app in the native Windows instances, or in a pre-built Linux container, in Azure App Service.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like this was added in globals v11.5, which we updated to in ESLint v5. Updating to the latest version of ESLint will fix this. Thanks!
@medikoo That would result in a larger maintenance burden for us as different Node versions go into or out of LTS. I’m not sure we have the resources to maintain the Node globals as you suggested. That is why I offered the workaround.