Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions source/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ const recommendedRules: Linter.RulesRecord = {
'mocha/consistent-spacing-between-blocks': 'error'
} as const;

const mochaPlugin: ESLint.Plugin = {
export type MochaPlugin = ESLint.Plugin & {
configs: {
all: Linter.Config;
recommended: Linter.Config;
};
};

const mochaPlugin: MochaPlugin = {
rules: {
'handle-done-callback': handleDoneCallbackRule,
'max-top-level-suites': maxTopLevelSuitesRule,
Expand All @@ -104,7 +111,9 @@ const mochaPlugin: ESLint.Plugin = {
'valid-suite-title': validSuiteTitleRule,
'valid-test-title': validTestTitleRule,
'no-empty-title': noEmptyTitleRule
}
},
// 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
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.

};

mochaPlugin.configs = {
Expand Down
Loading