-
-
Save kexline4710/ac641696da94b5a08f16a928115543b4 to your computer and use it in GitHub Desktop.
module.exports = { | |
meta: { | |
type: "suggestion", | |
docs: { | |
description: "Enforce Brandon and Ashlynn as unified function", | |
recommended: true, | |
url: "https://eslint.org/docs/rules/together-forever" | |
}, | |
schema: [] | |
}, | |
create: (context) => ({ | |
FunctionDeclaration(node) { | |
if (node.id.name === "brandon") { | |
context.report({ | |
node: node, | |
message: "Append this function with 'AndAshlynn'" | |
}) | |
} | |
} | |
} | |
}; |
I added this to the herbie web project and needed to fix a small syntax error ⬇️
'use strict';
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'Enforce Brandon and Ashlynn as unified function',
recommended: true,
url: 'https://eslint.org/docs/rules/together-forever',
},
schema: [],
},
create: (context) => ({
FunctionDeclaration: (node) => {
if (node.id.name === 'brandon') {
context.report({
node,
message: "Append this function with 'AndAshlynn'",
});
}
},
}),
};
I LOVE THIS SO MUCH 😍
Do you know of any styling preferences he has around quotations/indentations/other? PUT YOUR NITPICKY BRANDON HATS ON. Is there aannnnnyyyything here that would bother the crap out of him?
If you compare this to Brandon's published eslint config, I think you're all set! He's a pretty big comment guy, so it might fun to slip one in there somewhere? (or maybe a TODO
🤔 )
Long shot, but do you happen to know any details about his terminal styling? I can picture it in my head, but will likely just go with a dark mode styling (dark charcoal background, light foreground) if I don't have those details.
Based on the pics I sent in the text thread, my guess is that he uses a portion of the One Dark Pro theme?
Hi lovely reviewers! My goal is to make a cute and (mostly) valid custom eslint rule into a print as a small gift for B and A's wedding. I'm trying to keep it simple and under 25 lines. This proposed rule hypothetically enforces any
brandon()
function be appended withAndAshlynn
. I know theCallExpression
andArrowFunctionExpression
nodes are also relevant, but didn't add those for brevity.Reviewer Asks
Thanks!