Skip to content

Commit 617620c

Browse files
committed
fix(napi/oxlint): rule interface match ESLint
1 parent 31cc6b6 commit 617620c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

napi/oxlint2/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class Linter {
8787

8888
const rules = [];
8989
for (const { rule, ruleId } of this.pluginRegistry.getRules(ruleIds)) {
90-
rules.push(rule(createContext(ruleId)));
90+
rules.push(rule.create(createContext(ruleId)));
9191
}
9292

9393
// TODO: walk the AST

napi/oxlint2/test/fixtures/basic_custom_plugin/test_plugin/index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ export default {
33
name: "basic-custom-plugin",
44
},
55
rules: {
6-
"no-debugger": (context) => {
7-
// TODO: move this call into `DebuggerStatement`, once we are walking the ast.
8-
context.report({
9-
message: "Unexpected Debugger Statement",
10-
node: { start: 0, end: 0 },
11-
});
12-
return {
13-
DebuggerStatement(_debuggerStatement) {},
14-
};
6+
"no-debugger": {
7+
create(context) {
8+
// TODO: move this call into `DebuggerStatement`, once we are walking the ast.
9+
context.report({
10+
message: "Unexpected Debugger Statement",
11+
node: { start: 0, end: 0 },
12+
});
13+
return {
14+
DebuggerStatement(_debuggerStatement) {},
15+
};
16+
},
1517
},
1618
},
1719
};

0 commit comments

Comments
 (0)