Promise现在是es6中的全局保留字,而linters则抛出错误.那么这样做的缺陷是什么呢?
var Promise = require("bluebird");
或者我应该这样做
var BluebirdPromise = require("bluebird");
解决方法
看起来重新宣布承诺没有问题,只要它不是全球性的.但第二个是更好的方法
Many of us do that. There’s no problem. You’re just using a faster implementation,that’s all. But note that you may use more and more promises given by varIoUs libraries,so this is a very limited replacement (there are discussions in the node world about ways to define a library as a global promise provider). – Denys Séguret