Skip to content

Commit e98ef3b

Browse files
committed
refactor: remove unused code
1 parent d08312e commit e98ef3b

File tree

10 files changed

+388
-65
lines changed

10 files changed

+388
-65
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"[json]": {
3-
"editor.defaultFormatter": "vscode.json-language-features",
3+
"editor.defaultFormatter": "dprint.dprint",
44
"editor.quickSuggestions": {
55
"strings": true
66
}

cspell.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"hatchpath",
4545
"Hoistable",
4646
"hrefs",
47+
"IIFEs",
4748
"innerhtml",
4849
"knip",
4950
"lifecycles",
@@ -53,7 +54,9 @@
5354
"metas",
5455
"Monaspace",
5556
"Nextra",
57+
"nocheck",
5658
"Noto",
59+
"opengraph",
5760
"pathe",
5861
"pattycake",
5962
"preact",
@@ -86,8 +89,6 @@
8689
"uncast",
8790
"unoptimized",
8891
"valibot",
89-
"weakref",
90-
"nocheck",
91-
"IIFEs"
92+
"weakref"
9293
]
9394
}

examples/vite-react-dom-ts-flat/eslint.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import js from "@eslint/js";
44
import tseslint from "typescript-eslint";
55
import react from "@eslint-react/eslint-plugin";
66
import reactHooks from "eslint-plugin-react-hooks";
7+
import reactRefresh from "eslint-plugin-react-refresh";
78

89
export default [
910
// JavaScript rules
@@ -41,6 +42,15 @@ export default [
4142
},
4243
rules: reactHooks.configs.recommended.rules,
4344
},
45+
{
46+
files: ["src/**/*.tsx"],
47+
plugins: {
48+
"react-refresh": reactRefresh,
49+
},
50+
rules: {
51+
"react-refresh/only-export-components": "warn",
52+
},
53+
},
4454
// Disable type checking for JavaScript files
4555
{
4656
files: ["*.js"],

knip.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"workspaces": {
3+
".": {
4+
"entry": "scripts/*.ts",
5+
"project": "scripts/**/*.ts"
6+
},
7+
"packages/*": {
8+
"entry": "index.ts",
9+
"project": "**/*.{ts,tsx}"
10+
},
11+
"packages/*/*": {
12+
"entry": "index.ts",
13+
"project": "**/*.{ts,tsx}"
14+
},
15+
"examples/*": {
16+
"entry": "{index,main}.{ts,tsx}",
17+
"project": "**/*.{ts,tsx}"
18+
},
19+
"website": {
20+
"entry": [
21+
"next.config.{js,ts,cjs,mjs}",
22+
"{instrumentation,middleware}.{js,ts}",
23+
"app/global-error.{js,jsx,ts,tsx}",
24+
"app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx}",
25+
"app/**/route.{js,jsx,ts,tsx}",
26+
"app/{manifest,sitemap,robots}.{js,ts}",
27+
"app/**/{icon,apple-icon}.{js,jsx,ts,tsx}",
28+
"app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}",
29+
"pages/**/*.{js,jsx,ts,tsx}",
30+
"src/{instrumentation,middleware}.{js,ts}",
31+
"src/app/global-error.{js,jsx,ts,tsx}",
32+
"src/app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx}",
33+
"src/app/**/route.{js,jsx,ts,tsx}",
34+
"src/app/{manifest,sitemap,robots}.{js,ts}",
35+
"src/app/**/{icon,apple-icon}.{js,jsx,ts,tsx}",
36+
"src/app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}",
37+
"src/pages/**/*.{js,jsx,ts,tsx}"
38+
],
39+
"project": "src/**/*.{ts,tsx}"
40+
}
41+
}
42+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"format:check": "dprint check",
4040
"format:package-json": "bun run --bun ./scripts/format-package-json.ts",
4141
"format:write": "dprint fmt",
42-
"inspect:deps": "skott -e .ts --trackBuiltinDependencies",
42+
"inspect:deps": "skott -e .ts",
4343
"inspect:eslint-config": "eslint --print-config ./packages > eslint-config.json",
4444
"lint": "pnpm run lint:spell && pnpm run lint:deps && pnpm run lint:type && pnpm run lint:ts && pnpm run lint:publish && pnpm run lint:examples && pnpm run lint:website",
4545
"lint:deps": "skott -m file-tree -e .ts -s",
@@ -89,6 +89,7 @@
8989
"eslint-plugin-vitest": "0.5.4",
9090
"fast-equals": "5.0.1",
9191
"husky": "9.0.11",
92+
"knip": "^5.24.1",
9293
"markdownlint": "0.34.0",
9394
"pathe": "1.1.2",
9495
"publint": "0.2.8",
@@ -107,7 +108,7 @@
107108
"typescript": "^5.5.3",
108109
"vitest": "1.6.0"
109110
},
110-
"packageManager": "pnpm@9.5.0-beta.3",
111+
"packageManager": "pnpm@9.4.0",
111112
"engines": {
112113
"bun": ">=1.0.15",
113114
"node": ">=18.18.0"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from "./create-rule";
22
export * from "./get-children-to-array-selector";
3-
export * from "./is-member-expression-of-react-member";

packages/plugins/eslint-plugin-react-x/src/utils/is-member-expression-of-react-member.ts

Lines changed: 0 additions & 29 deletions
This file was deleted.

packages/plugins/eslint-plugin/src/utils/pad-keys.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,3 @@ export function padKeysLeft<const T, const U extends string = "">(
99
): PadKeysLeft<T, U> {
1010
return transformKeys(obj, (key) => `${left}${key}`) as never;
1111
}
12-
13-
export type PadKeysRight<T, U extends string = ""> = T extends [] ? T
14-
: { [K in keyof T as `${Extract<K, string>}${U}`]: T[K] };
15-
16-
export function padKeysRight<const T, const U extends string = "">(
17-
obj: T,
18-
right: U,
19-
): PadKeysRight<T, U> {
20-
return transformKeys(obj, (key) => `${key}${right}`) as never;
21-
}

0 commit comments

Comments
 (0)