Skip to content

Documentation for implementing plugins and TypeScript types? #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JoshuaKGoldberg opened this issue Oct 17, 2023 · 0 comments · Fixed by #186
Closed

Documentation for implementing plugins and TypeScript types? #184

JoshuaKGoldberg opened this issue Oct 17, 2023 · 0 comments · Fixed by #186

Comments

@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Oct 17, 2023

👋 good news: https://github.com/JoshuaKGoldberg/eslint-plugin-package-json now uses jsonc-eslint-parser as of 0.3.0!

Less good news: I'm having a bit of a hard time wrestling with TypeScript types trying to convert eslint-plugin-package-json to TypeScript in JoshuaKGoldberg/eslint-plugin-package-json#59. As noted in #159, the AST.JSON* types from jsonc-eslint-parser aren't assignable to or from ESTree.* types from estree. Example type assertions: https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/pull/59/files#diff-c14abd619a7569f9b82e00ce73302cacc0eca3d6462db5499652adeaf58c38faR36-R39

Is this ESTree<>JSONC types mismatch problem something that can be solved? If not, is there a workaround you'd recommend? And either way, could we document the answer?

For reference, it looks like the strategy in eslint-plugin-jsonc is to completely remove the built-in ESTree types?

JoshuaKGoldberg added a commit to JoshuaKGoldberg/eslint-plugin-package-json that referenced this issue Nov 8, 2023
Work in progress:

- [x] `npm run tsc` passes
- [x] `npm run test` passes (except for #60)
- [x] Filed docs issue on `jsonc-eslint-parser` to document how to work
effectively with ESTree:
ota-meshi/jsonc-eslint-parser#184

Fixes #35.

Converts source files to TypeScript. In doing so, switches the test
library from Mocha to Vitest so that no transpiling is needed for tests.

~Will wait for feedback on
ota-meshi/eslint-plugin-jsonc#269 before taking
that PR's strategy in here.~ ✅ Brings in
ota-meshi/eslint-plugin-jsonc#271
`RuleListener` type as well.

~Marking as blocked on #60. I'd like that to be resolved before making
any changes that happen to also change tests around.~ ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant