custom lint rule for no logfile calls

initial package setup
This commit is contained in:
2025-04-30 01:29:18 -06:00
parent 9535222fb7
commit 65f0b4e0b7
3 changed files with 40 additions and 5 deletions

26
no-log.ts Normal file
View File

@@ -0,0 +1,26 @@
const plugin: Deno.lint.Plugin = {
name: "no-log",
rules: {
"no-log": {
create(context) {
return {
// Identifier(node) {
// if (node.name === "log") {
// context.report({
// node,
// message: "Do not use log",
// });
// }
// },
'ExpressionStatement > CallExpression[callee.name="log"]'(node) {
context.report({
node,
message: "Clean up log statements",
});
},
};
},
},
},
};
export default plugin;