0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-12 16:59:32 -05:00
denoland-deno/plugin.js
2024-12-01 04:53:47 +01:00

21 lines
550 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",
},
});
},
);
console.log("Loaded plugin", PLUGIN_NAME);