I seem to have run into an AirBnB linting paradox.
I have the following line:
const pagePromiseGenerator = (graphql, createPage) => (gqlNodeName, pageComponent) => new Promise((resolve, reject) => {
which is over 100 characters long. So I can convert it to:
const pagePromiseGenerator = (graphql, createPage) => {
return (gqlNodeName, pageComponent) => new Promise((resolve, reject) => {
But that violates the AirBnB arrow body style rule. Should I just disable linting for this line, or is there a better way?
You can satisfy both rules. You'll see in the implicit-arrow-linebreak docs that you can wrap an implicit return in parentheses:
const pagePromiseGenerator = (graphql, createPage) => (
(gqlNodeName, pageComponent) => new Promise((resolve, reject) => {
// some code here
})
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With