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

Most upvoted comments

Promise is eventually going to be an existing global, why not do something like:

var Bluebird = require('bluebird');
Bluebird.extend(Promise); 

?

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