You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The types for this plugin are generated automatically using TypeScript's type inference because there is no explicit JSDoc type annotation for the main export. Type inference relies on several assumptions to work correctly and can easily break if the code is changed or refactored, but with the current setup, a breakage in the types would go unnoticed.
What do you think is the correct solution?
There should be unit tests for the types.
Participation
I am willing to submit a pull request for this change.
Additional comments
An example of incorrect types that was noticed in #59 is the case in which a nested property is assigned a value after the plugin object is declared. The naive assignment using plugin.configs.recommended.plugins.json = plugin; would cause TypeScript to discard part of the type information from the previous declaration and end up with an incomplete type in the generated .d.ts files.
The text was updated successfully, but these errors were encountered:
Environment
ESLint version: v9.15.0
@eslint/json version: v9.15.0
Node version: v23.2.0
npm version: 10.9.0
Operating System: Windows
What problem do you want to solve?
The types for this plugin are generated automatically using TypeScript's type inference because there is no explicit JSDoc type annotation for the main export. Type inference relies on several assumptions to work correctly and can easily break if the code is changed or refactored, but with the current setup, a breakage in the types would go unnoticed.
What do you think is the correct solution?
There should be unit tests for the types.
Participation
Additional comments
An example of incorrect types that was noticed in #59 is the case in which a nested property is assigned a value after the plugin object is declared. The naive assignment using
plugin.configs.recommended.plugins.json = plugin;
would cause TypeScript to discard part of the type information from the previous declaration and end up with an incomplete type in the generated .d.ts files.The text was updated successfully, but these errors were encountered: