Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 567 Bytes

no-native.md

File metadata and controls

22 lines (15 loc) · 567 Bytes

Require creating a Promise constructor before using it in an ES5 environment (promise/no-native)

🚫 This rule is disabled in the ✅ recommended config.

Ensure that Promise is included fresh in each file instead of relying on the existence of a native promise implementation. Helpful if you want to use bluebird or if you don't intend to use an ES6 Promise shim.

Valid

var Promise = require('bluebird')
var x = Promise.resolve('good')

Invalid

var x = Promise.resolve('bad')