Promise' is not defined. (no-undef)
See original GitHub issue- ESLint Version: 4.14.0
- Node Version: 6.11.1
- npm Version: 5.3.0
What parser (default, Babel-ESLint, etc.) are you using? default
const promise = new Promise((resolve, reject) => {});
eslint config
{
"env": {
"browser": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
},
"extends": ["kentcdodds/possible-errors", "kentcdodds/best-practices"],
"rules": {
"global-require": "off"
}
}
What did you expect to happen? No un-def error for es6 globals (Promise)
What actually happened? Throws un-def error for ‘Promise’
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
ESlint : which config for Promise and Async - Stack Overflow
/*eslint no-undef: 0*/. Or you can change the eslint config file (change the rules). And you are good to go! Hope this helps!...
Read more >How to Fix “Promise resolver undefined is not a function” in ...
The promise executor is a function accepting two other functions: resolve and reject . If you're running into the “Promise resolver undefined ......
Read more >no-undef - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >eslint error 'Promise' is not defined no-undef の対処方法
eslint error Promise is not defined no-undef の対処方法を紹介します。 eslintで下記のようにPromiseが定義されていませんとエラーが出る場合が ...
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 FreeTop 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
Top GitHub Comments
Do you have
es6: true
set under theenv
key in your ESLint config?@bharathvaj1995 ecmaVersion only affects the parser, so it allows ES6 syntax (such as let/const). The environment will set ecmaVersion for you, but will also enable all of the ES6 globals (such as Promise, Map, Set). If you want ES7 (or later) and ES6 globals, you would do env es6:true and ecmaVersion: (something greater than 6)… Hope that makes sense!