ota-meshi / eslint-plugin-jsonc

ESLint plugin for JSON(C|5)? files
https://ota-meshi.github.io/eslint-plugin-jsonc/
MIT License
181 stars 17 forks source link

chore: add JSONC AST node types to RuleListener nodes #269

Closed JoshuaKGoldberg closed 8 months ago

JoshuaKGoldberg commented 8 months ago

Augments the RuleListener interface with two mappings from AST.JSONNode["type"]. One adds the node types under their name (e.g. "JSONLiteral"); the other adds them under their name + ":exit". We utilize a similar strategy in typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/blob/4c8edcfb7d3cc02d07d2329c87da4377c1cbf969/packages/utils/src/ts-eslint/Rule.ts#L289

Also removes the now-redundant explicit type annotations from the node parameters in rule listener functions.

Fixes #268.

changeset-bot[bot] commented 8 months ago

⚠️ No Changeset found

Latest commit: d37340fa96ba0f66d46c410eebba22995a3ff94c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

ota-meshi commented 8 months ago

It may need to be refactored if a type annotation utility is added to jsonc-eslint-parser, but for now this PR is good so I'll merge it. Thank you!