Use shorthand promise methodsJS-C1004
If the executor argument to a promise constructor only calls the reject or resolve and exits, then the code can refactored to use Promise#reject or Promise#resolve instead.
Bad Practice
new Promise((resolve, reject) => {
resolve(getItem())
})
new Promise(function (resolve, reject) {
reject("oops")
})
Recommended
Promise.resolve(getItem())
Promise.reject("oops")