Skip to content

Commit 0b89332

Browse files
authored
fix: export IconProps as interface to allow extension by other projects (#63)
* fix: export IconProps as interface to allow extension by other projects * fix: lint files
1 parent b6750f9 commit 0b89332

File tree

4 files changed

+1546
-2014
lines changed

4 files changed

+1546
-2014
lines changed

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx --no -- commitlint --edit $1

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"scripts": {
1515
"test": "jest",
1616
"typescript": "tsc --noEmit",
17-
"lint": "eslint .",
17+
"lint": "eslint . --fix",
1818
"release": "release-it",
1919
"format": "prettier --write src/**/* src/lib/index.tsx",
2020
"generate": "node generator/generate-svg.mjs",
@@ -134,4 +134,4 @@
134134
]
135135
]
136136
}
137-
}
137+
}

src/lib/index.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ export type IconWeight =
1111

1212
export type PaintFunction = (color: string) => React.ReactNode | null;
1313

14-
interface SVGRProps {
15-
title?: string;
16-
titleId?: string;
17-
}
18-
19-
export type IconProps = {
14+
export interface IconProps {
2015
color?: string;
2116
size?: string | number;
2217
weight?: IconWeight;
@@ -25,7 +20,9 @@ export type IconProps = {
2520
testID?: string;
2621
duotoneColor?: string;
2722
duotoneOpacity?: number;
28-
} & SVGRProps;
23+
title?: string; // SVGRProps
24+
titleId?: string; // SVGRProps
25+
}
2926

3027
export type Icon = React.FC<IconProps>;
3128

0 commit comments

Comments
 (0)