Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
import { defineRule, nodeKinds } from "@biomejs/runtime/plugin";
export const rule = defineRule({
run(node) {
const CALLS = nodeKinds("JS_CALL_EXPRESSION", "JS_NEW_EXPRESSION");
return CALLS.has(node.parent);
},
});import { defineRule, nodeKinds } from "@biomejs/runtime/plugin";
const CALLS = nodeKinds("JS_CALL_EXPRESSION", "JS_NEW_EXPRESSION");
const CALLS_AND_IMPORTS = CALLS.union(nodeKinds("JS_IMPORT_CALL_EXPRESSION"));
export const rule = defineRule({
run(node) {
return CALLS_AND_IMPORTS.has(node.parent);
},
});Popular · 1 of 50
Require kind sets in Biome JS plugins to be created at the top level of the module.
import { defineRule, nodeKinds } from "@biomejs/runtime/plugin";
export const rule = defineRule({
run(node) {
const CALLS = nodeKinds("JS_CALL_EXPRESSION", "JS_NEW_EXPRESSION");
return CALLS.has(node.parent);
},
});import { defineRule, nodeKinds } from "@biomejs/runtime/plugin";
const CALLS = nodeKinds("JS_CALL_EXPRESSION", "JS_NEW_EXPRESSION");
const CALLS_AND_IMPORTS = CALLS.union(nodeKinds("JS_IMPORT_CALL_EXPRESSION"));
export const rule = defineRule({
run(node) {
return CALLS_AND_IMPORTS.has(node.parent);
},
});