Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 609 Bytes

no-native.md

File metadata and controls

23 lines (16 loc) · 609 Bytes

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

🚫 This rule is disabled in the following configs: ✅ flat/recommended, ✅ recommended.

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

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

Invalid

const x = Promise.resolve('bad')