0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-08 07:16:56 -05:00
denoland-deno/plugin.js
Bartek Iwańczuk 49c2d9e2bb
add visitor
2024-12-01 05:14:46 +01:00

22 lines
565 B
JavaScript

// TODO(bartlomieju): this should be rule name, not plugin name
const PLUGIN_NAME = "test-plugin";
const RULE1_NAME = "first-rule";
Deno.core.ops.op_lint_register_lint_plugin(PLUGIN_NAME);
Deno.core.ops.op_lint_register_lint_plugin_rule(
PLUGIN_NAME,
RULE1_NAME,
function create(context) {
console.log("Hello from", `${PLUGIN_NAME}/${RULE1_NAME}`);
context.report({
message: "Error from " + `${PLUGIN_NAME}/${RULE1_NAME}`,
data: {
some: "Data",
},
});
return {};
},
);
console.log("Loaded plugin", PLUGIN_NAME);