custom lint rule for no logfile calls
initial package setup
This commit is contained in:
26
no-log.ts
Normal file
26
no-log.ts
Normal 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;
|
Reference in New Issue
Block a user