bluebird: "Promise" is now a global - Breaks linting
All of my builds are now failing because of jshint/jshint#1747
In short: Promise
is a global reserved word and the latest jshint version will break with the error “Redefinition of ‘Promise’.”.
Case in point by @rwaldron:
Would you write this?
var Array = require("my-array-implementation");
…or pave over any other built-in object?
A strategy has to be devised to move Bluebird away from this conflict, documents, globals, etc, with an urgency for the README.md
file.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 28 (10 by maintainers)
Commits related to this issue
- fucking disco petkaantonov/bluebird#301 — committed to thanpolas/nodeON-helpers by thanpolas 10 years ago
- fix(jshint): refs https://github.com/petkaantonov/bluebird/issues/301 — committed to CleverStack/node-seed by pilsy 9 years ago
Promise is eventually going to be an existing global, why not do something like:
?
This would fill in all the methods that don’t already exist, allow to continue using Promise, which is good for not having to edit a bunch of lines in old code, and satisfy JSHint all at once…?
If you don’t actually have the global Promise constructor, it would create it as a global