eslint-plugin-parentheses-around-await
Version:
The ESLint plugin to ensure you don't try to use properties on a not-yet-awaited values.
20 lines • 656 B
JavaScript
;
const rule = {
create: context => {
return {
'AwaitExpression > MemberExpression > Identifier': (node) => {
if (node.type) {
context.report({
message: `If you want to access properties on an awaited value,
you should wrap the value with parantheses. If not,
you may get undefined which will lead to bugs.
`,
node,
});
}
},
};
},
};
module.exports = rule;
//# sourceMappingURL=parentheses-around-await.js.map