Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/formatter/createPropFilter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default function createPropFilter<Value>(
props: Record<string, Value>,
filter: string[] | ((propValue: Value, key: string) => boolean),
) {
): (key: string) => boolean {
if (Array.isArray(filter)) {
return (key: string) => filter.indexOf(key) === -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type Options = {
// Options accepted by reactElementToJSXString
export type PublicOptions = Partial<Options>;

export const defaultOptions = {
export const defaultOptions: Options = {
filterProps: [],
showDefaultProps: true,
showFunctions: false,
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"jsx": "react-jsx",
"module": "ESNext",
"declaration": true,
"isolatedDeclarations": true,
"target": "ESNext",
"moduleResolution": "bundler",
"strict": true,
Expand Down
6 changes: 4 additions & 2 deletions tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "tsdown";
import { type UserConfig, defineConfig } from "tsdown";

export default defineConfig({
const config: UserConfig = defineConfig({
entry: ["src/index.ts"],
format: ["esm"],
sourcemap: true,
Expand All @@ -15,3 +15,5 @@ export default defineConfig({
},
target: ["node24", "es2020"],
});

export default config;
6 changes: 4 additions & 2 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vitest/config";
import { type ViteUserConfig, defineConfig } from "vitest/config";

export default defineConfig({
const config: ViteUserConfig = defineConfig({
plugins: [react()],
test: {
globals: false,
Expand All @@ -10,3 +10,5 @@ export default defineConfig({
mockReset: true,
},
});

export default config;
Loading