Skip to content

Commit

Permalink
feat(unstable): type lint plugin visitor (#28005)
Browse files Browse the repository at this point in the history
This PR strongly types the JS plugin visitor.

```ts
export default {
  name: "foo",
  rules: {
    bar: {
      create(ctx) {
        return {
          // Plain ast node visitor
          Identifier(node) {},

          // Exit visitor
          "Identifier:exit"(node) {},

          // Custom selectors, `node` needs to be typed manually
          "FunctionDeclaration > Identifier"(node: Deno.lint.Identifier) {}
        }
      }
    }
  }
}

```

Follow up to #27977
  • Loading branch information
marvinhagemeister authored Feb 7, 2025
1 parent 703fdd8 commit 615bf8a
Showing 1 changed file with 237 additions and 170 deletions.
Loading

0 comments on commit 615bf8a

Please sign in to comment.