Skip to content

Fix type of the plugin object's configs field#393

Open
rhysd wants to merge 1 commit intolo1tuma:mainfrom
rhysd:issue-392
Open

Fix type of the plugin object's configs field#393
rhysd wants to merge 1 commit intolo1tuma:mainfrom
rhysd:issue-392

Conversation

@rhysd
Copy link
Copy Markdown
Contributor

@rhysd rhysd commented May 31, 2025

Fix #392

By this change plugin.d.ts looks like the following. configs field is no longer optional.

import type { ESLint, Linter } from 'eslint';
export type MochaPlugin = ESLint.Plugin & {
    configs: {
        all: Linter.Config;
        recommended: Linter.Config;
    };
};
declare const mochaPlugin: MochaPlugin;
export default mochaPlugin;
//# sourceMappingURL=plugin.d.ts.map

Comment thread source/plugin.ts
}
},
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-type-assertion -- This field will be set later for cyclic references
configs: undefined as any
Copy link
Copy Markdown
Contributor Author

@rhysd rhysd May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hack is ugly but I could not find any other workaround for those cyclic references.

@mdmower-csnw
Copy link
Copy Markdown
Contributor

@rhysd - Should be able to close this pull request since #400 was accepted.

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 this pull request may close these issues.

configs field is wrongly optional in the type definition

2 participants