Skip to content

Commit 7664618

Browse files
committed
[workflow/test] Fixed the types, Added code check action
1 parent 096b621 commit 7664618

8 files changed

Lines changed: 37 additions & 78 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "CodeQL Analysis"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches:
8+
- master
9+
schedule:
10+
- cron: '0 0 * * 0'
11+
12+
jobs:
13+
codeql:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
21+
- name: Initialize CodeQL
22+
uses: github/codeql-action/init@v3
23+
with:
24+
languages: typescript, javascript
25+
26+
- name: Autobuild
27+
uses: github/codeql-action/autobuild@v3
28+
29+
- name: Perform CodeQL Analysis
30+
uses: github/codeql-action/analyze@v3

src/packages/react-native-material-elements/__test__/createThemeDimensions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createThemeDimensions, themeDimensions } from '../src';
2-
import { CreateThemeDimensions } from '../src/libraries/themes/types';
2+
import { CreateThemeDimensions } from '../src/libraries/types';
33

44
describe('createThemeDimensions', () => {
55
it('should merge custom and default theme dimensions', () => {

src/packages/react-native-material-elements/__test__/useThemedProps.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import React, { isValidElement } from 'react';
33
import { Text, View } from 'react-native';
44
import { useThemedProps } from '../src/hooks';
55
import { render, ThemeWrapper } from './test-utils';
6-
import { Theme } from '../src/libraries/themes/types';
76
import { green } from '../src';
7+
import { Theme } from '../src/libraries/types';
88

99
describe('useThemedProps', () => {
1010
it('should match icon component snapshot correctly', () => {

src/packages/react-native-material-elements/examples/Badge.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,7 @@ export const Ex8: React.FC = () => {
125125
const { theme } = useTheme();
126126

127127
return (
128-
<Badge
129-
badgeContent={100}
130-
max={1000}
131-
invisible={false}
132-
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
133-
badgeContentProps={{
134-
style: { fontWeight: 500, fontSize: 10, color: 'red' },
135-
}}>
128+
<Badge badgeContent={100} max={1000} invisible={false} anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}>
136129
<Box
137130
sx={{
138131
w: 200,
@@ -149,15 +142,7 @@ export const Ex9: React.FC = () => {
149142
const { theme } = useTheme();
150143

151144
return (
152-
<Badge
153-
badgeContent={100}
154-
max={1000}
155-
invisible={false}
156-
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
157-
badgeContentProps={{
158-
style: { fontWeight: 500, fontSize: 10, color: 'red' },
159-
onLayout: (event: LayoutChangeEvent) => console.log(event),
160-
}}>
145+
<Badge badgeContent={100} max={1000} invisible={false} anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}>
161146
<Box
162147
sx={{
163148
w: 200,

src/packages/react-native-material-elements/examples/form-validation/TextInputFormValidation01.tsx

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

src/packages/react-native-material-elements/examples/form-validation/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/packages/react-native-material-elements/src/hooks/useThemedProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'lodash';
22
import React, { isValidElement, useMemo } from 'react';
33
import { useThemeColorsSelector } from '../libraries';
4-
import { Theme } from '../libraries/themes/types';
4+
import { Theme } from '../libraries/types';
55

66
export type ThemedIconProp = ((theme: Theme) => React.ReactNode) | React.ReactNode;
77
type ThemedProp<T = any> = T | ((themeColors: ReturnType<typeof useThemeColorsSelector>) => T);

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"paths": {
55
"react": ["./node_modules/@types/react"]
66
}
7-
}
7+
},
8+
"exclude": ["node_modules", "**/*.test.ts", "**/*.test.tsx", "**/__tests__/**"]
89
}

0 commit comments

Comments
 (0)