Skip to content

Commit 95a8130

Browse files
committed
chore: narrow types
1 parent e7bb305 commit 95a8130

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ type ClassicConfigs = Record<SupportedTestingFramework, Linter.LegacyConfig>;
1212
type FlatConfigs = Record<`flat/${SupportedTestingFramework}`, Linter.Config>;
1313
type PluginConfigs = ClassicConfigs & FlatConfigs;
1414

15+
type TestingLibraryPlugin = Omit<ESLint.Plugin, 'rules' | 'configs'> & {
16+
rules: NonNullable<ESLint.Plugin['rules']>;
17+
configs: PluginConfigs;
18+
};
19+
1520
const PLUGIN_NAME = 'testing-library' as const;
1621

1722
function createPluginFlatConfigs() {
@@ -55,7 +60,7 @@ function createPluginLegacyConfigs() {
5560
};
5661
}
5762

58-
const testingLibraryPlugin: ESLint.Plugin = {
63+
const testingLibraryPlugin: TestingLibraryPlugin = {
5964
meta: {
6065
name: packageName,
6166
version: packageVersion,
@@ -64,7 +69,7 @@ const testingLibraryPlugin: ESLint.Plugin = {
6469
configs: {
6570
...createPluginFlatConfigs(),
6671
...createPluginLegacyConfigs(),
67-
} satisfies PluginConfigs,
72+
},
6873
};
6974

7075
export default testingLibraryPlugin;

0 commit comments

Comments
 (0)