eslint / json

JSON language plugin for ESLint
Apache License 2.0
44 stars 4 forks source link

fix: expose `plugin.configs` in types #59

Closed fasttime closed 4 days ago

fasttime commented 1 week ago

Prerequisites checklist

What is the purpose of this pull request?

Refactor code to fix the types

What changes did you make? (Give an overview)

This PR fixes the tsc-generated type of plugin.configs. It does so by moving the configs object into the plugin declaration rather that assigning its fields in a separate step. plugin.configs.recommended.plugins is left empty in the declaration and populated in a later step.

Related Issues

fixes #52

Is there anything you'd like reviewers to focus on?

There are currently no type tests in this plugin. Shall we add some type tests as part of this PR?

burtek commented 1 week ago

honestly, that's a clever fix. Was trying to figure out myself how to best approach this, but this is simple yet powerful and seems to get the job done. Haven't tested but looks like it should work