Skip to content

Commit ee9ecbe

Browse files
committed
fix(linter/plugins): fix TS type for fixer methods (#14166)
Another faulty type I found. `NodeOrToken` type was too restrictive. The `node` argument passed to fixer methods just needs to have `start` and `end` properties.
1 parent 3106ba0 commit ee9ecbe

File tree

1 file changed

+4
-1
lines changed
  • apps/oxlint/src-js/plugins

1 file changed

+4
-1
lines changed

apps/oxlint/src-js/plugins/fix.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ export type Fix = { range: Range; text: string };
1919
type Range = [number, number];
2020

2121
// Currently we only support `Node`s, but will add support for `Token`s later
22-
type NodeOrToken = Node;
22+
interface NodeOrToken {
23+
start: number;
24+
end: number;
25+
}
2326

2427
// Fixer, passed as argument to `fix` function passed to `Context#report()`.
2528
//

0 commit comments

Comments
 (0)