Skip to content

Commit a0bbbd8

Browse files
authored
refactor: improve compatible types (#1210)
1 parent 8a86b93 commit a0bbbd8

File tree

5 files changed

+9
-8
lines changed
  • packages

5 files changed

+9
-8
lines changed

packages/plugins/eslint-plugin-react-hooks-extra/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RuleConfig } from "@eslint-react/kit";
21
import type { CompatibleConfig } from "@eslint-react/kit";
32

43
import * as recommendedConfig from "./configs/recommended";

packages/plugins/eslint-plugin-react-naming-convention/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RuleConfig } from "@eslint-react/kit";
21
import type { CompatibleConfig } from "@eslint-react/kit";
32

43
import * as recommendedConfig from "./configs/recommended";

packages/plugins/eslint-plugin-react-web-api/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RuleConfig } from "@eslint-react/kit";
21
import type { CompatibleConfig } from "@eslint-react/kit";
32

43
import * as recommendedConfig from "./configs/recommended";

packages/plugins/eslint-plugin-react-x/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RuleConfig } from "@eslint-react/kit";
21
import type { CompatibleConfig } from "@eslint-react/kit";
32

43
import * as recommendedConfig from "./configs/recommended";

packages/utilities/kit/src/types.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,25 @@ export interface SettingsConfig {
7070
* The following types that are intentionally wide/inaccurate, that exist
7171
* for the purpose of satisfying both `defineConfig()` and `tseslint.config()`.
7272
* See https://github.com/typescript-eslint/typescript-eslint/issues/10899
73-
* See https://github.com/typescript-eslint/typescript-eslint/blob/3a65920088a37d5a28ebb6f36fb82b7a091d3cb1/packages/typescript-eslint/src/compatibility-types.ts
7473
*/
7574

75+
export interface CompatibleRule {
76+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
77+
meta: Record<string, any>;
78+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
79+
create: (...args: any[]) => any;
80+
}
81+
7682
export interface CompatiblePlugin {
7783
meta: {
7884
name: string;
7985
version: string;
8086
};
81-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
82-
rules: Record<string, any>;
87+
rules: Record<string, CompatibleRule>;
8388
}
8489

8590
export interface CompatibleConfig {
8691
name?: string;
8792
rules?: Record<string, RuleConfig>;
88-
settings?: SettingsConfig | undefined;
93+
settings?: SettingsConfig;
8994
}

0 commit comments

Comments
 (0)