Skip to content

Commit 83b1ab2

Browse files
authored
Merge pull request #1036 from lumapps/chore/ci-code-type-check
chore(ci): add code type check
2 parents cdd0e17 + 8202d81 commit 83b1ab2

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

.github/workflows/validate-pull-request.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ jobs:
3939
sudo timedatectl set-timezone Europe/Paris
4040
yarn test
4141
42+
type-check:
43+
if: github.event.pull_request.draft == false
44+
timeout-minutes: 30
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: "Checkout repository"
48+
uses: actions/checkout@v3
49+
50+
- name: "Setup"
51+
uses: ./.github/actions/setup
52+
53+
- name: "Run code type check"
54+
run: yarn type-check
55+
56+
4257
Github-actions-validator:
4358
if: github.event.pull_request.draft == false
4459
runs-on: ubuntu-latest

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"setup:git-hooks": "yarn husky uninstall && yarn husky install || exit 0",
8585
"start": "yarn workspace lumx-site-demo start",
8686
"test": "yarn workspace @lumx/react test",
87+
"type-check": "yarn tsc -p tsconfig.json",
8788
"storybook:react": "yarn workspace @lumx/react start:storybook",
8889
"storybook": "yarn storybook:react",
8990
"generate:design-tokens": "yarn workspace @lumx/core generate:design-tokens"

packages/lumx-react/src/components/navigation/NavigationItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { forwardRefPolymorphic } from '@lumx/react/utils/forwardRefPolymorphic';
77
import { ThemeContext } from '@lumx/react/utils/ThemeContext';
88

99
type BaseNavigationItemProps = {
10-
/* Icon (SVG path). */
10+
/** Icon (SVG path). */
1111
icon?: string;
1212
/** Label content. */
1313
label: ReactNode;
@@ -65,7 +65,7 @@ export const NavigationItem = Object.assign(
6565
prefix: `${CLASSNAME}__link`,
6666
isSelected: isCurrentPage,
6767
})}
68-
ref={ref}
68+
ref={ref as React.Ref<any>}
6969
aria-current={isCurrentPage ? 'page' : undefined}
7070
{...buttonProps}
7171
{...forwardedProps}

packages/lumx-react/src/components/uploader/Uploader.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe(`<${Uploader.displayName}>`, () => {
7272
it('should render file input', () => {
7373
const label = 'Label';
7474
const accept = '*';
75-
const { uploader } = setup({ label, fileInputProps: { accept } });
75+
const { uploader } = setup({ label, fileInputProps: { accept } as any });
7676

7777
expect(uploader.tagName).toBe('LABEL');
7878
expect(uploader).toHaveTextContent(label);

packages/lumx-react/src/utils/forwardRefPolymorphic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import { ComponentRef } from '@lumx/react/utils/type';
44
/** Same as `React.forwardRef` but inferring Ref type from the `as` prop. */
55
export function forwardRefPolymorphic<E extends ElementType, P extends { as?: E }>(
66
render: (props: P, ref: ComponentRef<E>) => React.ReactElement | null,
7-
) {
8-
return React.forwardRef(render as any) as (props: P & { ref?: ComponentRef<E> }) => React.ReactElement | null;
7+
): (props: P & { ref?: ComponentRef<E> }) => React.ReactElement | null {
8+
return React.forwardRef(render as any) as any;
99
}

yarn.lock

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8528,18 +8528,7 @@ __metadata:
85288528
languageName: node
85298529
linkType: hard
85308530

8531-
"@types/react@npm:*, @types/react@npm:>=16":
8532-
version: 18.2.45
8533-
resolution: "@types/react@npm:18.2.45"
8534-
dependencies:
8535-
"@types/prop-types": "*"
8536-
"@types/scheduler": "*"
8537-
csstype: ^3.0.2
8538-
checksum: 40b256bdce67b026348022b4f8616a693afdad88cf493b77f7b4e6c5f4b0e4ba13a6068e690b9b94572920840ff30d501ea3d8518e1f21cc8fb8204d4b140c8a
8539-
languageName: node
8540-
linkType: hard
8541-
8542-
"@types/react@npm:^17, @types/react@npm:^17.0.2":
8531+
"@types/react@npm:*, @types/react@npm:>=16, @types/react@npm:^17, @types/react@npm:^17.0.2":
85438532
version: 17.0.73
85448533
resolution: "@types/react@npm:17.0.73"
85458534
dependencies:

0 commit comments

Comments
 (0)