Skip to content

Commit 1966592

Browse files
committed
fix: fix ts types
2 parents 10b24b0 + 74a6eac commit 1966592

File tree

17 files changed

+75
-90
lines changed

17 files changed

+75
-90
lines changed

apps/website/app/base.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
@import "fumadocs-ui/css/neutral.css";
33
@import "fumadocs-ui/css/preset.css";
44

5+
@source "../components/fumadocs-ui/**/*.js";
6+
57
@source ".";
68
@source "../components";
79
@source "../content";
8-
@source "../components/fumadocs-ui/dist/**/*.js";

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,18 @@
115115
},
116116
"pnpm": {
117117
"overrides": {
118-
"is-core-module": "npm:@socketregistry/is-core-module@^1.0.7",
119-
"safe-buffer": "npm:@socketregistry/safe-buffer@^1.0.6",
120-
"safer-buffer": "npm:@socketregistry/safer-buffer@^1.0.6",
121-
"typedarray": "npm:@socketregistry/typedarray@^1.0.5",
122118
"@types/react": "^19.0.10",
123119
"@types/react-dom": "^19.0.4",
124120
"cross-spawn": "^7.0.6",
125121
"esbuild": "^0.25.0",
122+
"is-core-module": "npm:@socketregistry/is-core-module@^1.0.7",
126123
"next": "^15.1.7",
127124
"react": "^19.0.0",
128125
"react-dom": "^19.0.0",
126+
"safe-buffer": "npm:@socketregistry/safe-buffer@^1.0.6",
127+
"safer-buffer": "npm:@socketregistry/safer-buffer@^1.0.6",
129128
"ts-api-utils": "^2.0.1",
129+
"typedarray": "npm:@socketregistry/typedarray@^1.0.5",
130130
"typescript": "^5.7.3"
131131
}
132132
}
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import type { Linter } from "eslint";
2-
1+
import type { RulePreset } from "@eslint-react/shared";
32
import * as allConfig from "./configs/all";
43
import { plugin } from "./plugin";
54

6-
function makeConfig(config: Linter.Config): Linter.Config {
5+
function makeConfig(config: { name: string; rules: RulePreset }) {
76
return {
87
...config,
98
plugins: {
10-
...config.plugins,
11-
"react-dom": plugin,
9+
"react-x": plugin,
1210
},
1311
};
1412
}
1513

16-
function toLegacyConfig({ rules }: Linter.Config): Linter.LegacyConfig {
14+
function makeLegacyConfig(config: { rules: RulePreset }) {
1715
return {
18-
plugins: ["react-debug"],
19-
rules,
16+
...config,
17+
plugins: ["react-x"],
2018
};
2119
}
2220

2321
export default {
2422
...plugin,
2523
configs: {
2624
["all"]: makeConfig(allConfig),
27-
["all-legacy"]: toLegacyConfig(allConfig),
25+
["all-legacy"]: makeLegacyConfig(allConfig),
2826
},
2927
};

packages/plugins/eslint-plugin-react-debug/src/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ export const plugin = {
2121
/** @deprecated Use `hook` instead */
2222
"react-hooks": hook,
2323
},
24-
// remove this type assertion when the typescript-eslint and eslint type incompatible issue is resolved
25-
} as unknown as ESLint.Plugin;
24+
} as const;
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import type { Linter } from "eslint";
2-
1+
import type { RulePreset } from "@eslint-react/shared";
32
import * as recommendedConfig from "./configs/recommended";
43
import { plugin } from "./plugin";
54

6-
function makeConfig(config: Linter.Config): Linter.Config {
5+
function makeConfig(config: { name: string; rules: RulePreset }) {
76
return {
87
...config,
98
plugins: {
10-
...config.plugins,
11-
"react-dom": plugin,
9+
"react-x": plugin,
1210
},
1311
};
1412
}
1513

16-
function toLegacyConfig({ rules }: Linter.Config): Linter.LegacyConfig {
14+
function makeLegacyConfig(config: { rules: RulePreset }) {
1715
return {
18-
plugins: ["react-dom"],
19-
rules,
16+
...config,
17+
plugins: ["react-x"],
2018
};
2119
}
2220

2321
export default {
2422
...plugin,
2523
configs: {
2624
["recommended"]: makeConfig(recommendedConfig),
27-
["recommended-legacy"]: toLegacyConfig(recommendedConfig),
25+
["recommended-legacy"]: makeLegacyConfig(recommendedConfig),
2826
},
2927
};

packages/plugins/eslint-plugin-react-dom/src/plugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ export const plugin = {
3737
/** @deprecated Use `no-void-elements-with-children` instead */
3838
"no-children-in-void-dom-elements": noVoidElementsWithChildren,
3939
},
40-
// remove this type assertion when the typescript-eslint and eslint type incompatible issue is resolved
41-
} as unknown as ESLint.Plugin;
40+
} as const;
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import type { Linter } from "eslint";
2-
1+
import type { RulePreset } from "@eslint-react/shared";
32
import * as recommendedConfig from "./configs/recommended";
43
import { plugin } from "./plugin";
54

6-
function makeConfig(config: Linter.Config): Linter.Config {
5+
function makeConfig(config: { name: string; rules: RulePreset }) {
76
return {
87
...config,
98
plugins: {
10-
...config.plugins,
11-
"react-hooks-extra": plugin,
9+
"react-x": plugin,
1210
},
1311
};
1412
}
1513

16-
function toLegacyConfig({ rules }: Linter.Config): Linter.LegacyConfig {
14+
function makeLegacyConfig(config: { rules: RulePreset }) {
1715
return {
18-
plugins: ["react-hooks-extra"],
19-
rules,
16+
...config,
17+
plugins: ["react-x"],
2018
};
2119
}
2220

2321
export default {
2422
...plugin,
2523
configs: {
2624
["recommended"]: makeConfig(recommendedConfig),
27-
["recommended-legacy"]: toLegacyConfig(recommendedConfig),
25+
["recommended-legacy"]: makeLegacyConfig(recommendedConfig),
2826
},
2927
};

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ export const plugin = {
3131
/** @deprecated Use `no-useless-custom-hooks` instead */
3232
"no-redundant-custom-hook": noUselessCustomHooks,
3333
},
34-
// remove this type assertion when the typescript-eslint and eslint type incompatible issue is resolved
35-
} as unknown as ESLint.Plugin;
34+
} as const;
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
import type { Linter } from "eslint";
2-
1+
import type { RulePreset } from "@eslint-react/shared";
32
import * as recommendedConfig from "./configs/recommended";
43
import { plugin } from "./plugin";
54

6-
function makeConfig(config: Linter.Config): Linter.Config {
5+
function makeConfig(config: { name: string; rules: RulePreset }) {
76
return {
87
...config,
98
plugins: {
10-
...config.plugins,
11-
"react-naming-convention": plugin,
9+
"react-x": plugin,
1210
},
1311
};
1412
}
1513

16-
function toLegacyConfig({ rules }: Linter.Config): Linter.LegacyConfig {
14+
function makeLegacyConfig(config: { rules: RulePreset }) {
1715
return {
18-
plugins: ["react-naming-convention"],
19-
rules,
16+
...config,
17+
plugins: ["react-x"],
2018
};
2119
}
2220

2321
export default {
2422
...plugin,
2523
configs: {
2624
["recommended"]: makeConfig(recommendedConfig),
27-
["recommended-legacy"]: toLegacyConfig(recommendedConfig),
25+
["recommended-legacy"]: makeLegacyConfig(recommendedConfig),
2826
},
2927
};

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ export const plugin = {
1717
"filename-extension": filenameExtension,
1818
"use-state": useState,
1919
},
20-
// remove this type assertion when the typescript-eslint and eslint type incompatible issue is resolved
21-
} as unknown as ESLint.Plugin;
20+
} as const;

0 commit comments

Comments
 (0)