0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -05:00

feat(unstable): type lint plugin visitor (#28005)

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 https://github.com/denoland/deno/pull/27977
This commit is contained in:
Marvin Hagemeister 2025-02-07 13:01:33 +01:00 committed by GitHub
parent 703fdd8607
commit 615bf8a4b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

File diff suppressed because it is too large Load diff