Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit 8061d8b

Browse files
roottoolclaude
andauthored
refactor: TypeScript config improvements and code quality fixes (#63)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ec01447 commit 8061d8b

5 files changed

Lines changed: 8 additions & 12 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"dist"
2424
],
2525
"type": "module",
26+
"sideEffects": false,
2627
"main": "./dist/index.js",
2728
"module": "./dist/index.js",
2829
"types": "./dist/index.d.ts",

src/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
/**
2-
* safe-formdata: Boundary-focused FormData parser
3-
*
4-
* See AGENTS.md for design rules and boundary definition.
5-
*/
1+
import type { ParseResult } from "#types/ParseResult";
62

73
export { parse } from "#parse";
84

95
export type { IssueCode } from "#types/IssueCode";
106
export type { ParseIssue } from "#types/ParseIssue";
11-
export type { ParseResult } from "#types/ParseResult";
12-
13-
import type { ParseResult } from "#types/ParseResult";
7+
export type { ParseResult };
148

159
export type SuccessResult = Extract<ParseResult, { data: Record<string, string | File> }>;
1610
export type FailureResult = Extract<ParseResult, { data: null }>;

src/issues/forbiddenKeys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*
1515
* @see {@link https://github.com/roottool/safe-formdata/blob/main/AGENTS.md#prototype-safety AGENTS.md > Security rules > Prototype safety}
1616
*/
17-
export const FORBIDDEN_KEYS = new Set<string>([
17+
export const FORBIDDEN_KEYS: ReadonlySet<string> = new Set([
1818
"__proto__",
1919
"prototype",
2020
"constructor",
21-
] as const satisfies readonly string[]);
21+
]);

tsconfig.examples.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"noEmit": true,
55
"declaration": false,
6-
"declarationMap": false
6+
"declarationMap": false,
7+
"isolatedDeclarations": false
78
},
89
"include": ["examples/**/*.ts"]
910
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"moduleResolution": "nodenext",
88
"rewriteRelativeImportExtensions": true,
99
"erasableSyntaxOnly": true,
10+
"isolatedDeclarations": true,
1011
"verbatimModuleSyntax": true,
1112

1213
// Emit
@@ -15,7 +16,6 @@
1516
"declarationMap": true,
1617
"sourceMap": true,
1718
"outDir": "./dist",
18-
"removeComments": true,
1919

2020
// Type Checking (strict mode)
2121
"strict": true,

0 commit comments

Comments
 (0)