Skip to content

Commit

Permalink
rename JSX to React.JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberCookie committed Jan 16, 2025
1 parent 960d42b commit 71456a1
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions client_core/router/Router/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function Router(props: RouterProps) {
const lastIndex = childrenDepth - 1
if (prevChildrenArray[lastIndex].traversePath == childrenArray[lastIndex].traversePath) {
childrenArray.push({
El: () => '' as unknown as JSX.Element,
El: () => '' as unknown as React.JSX.Element,
traversePath: `${childrenArray[lastIndex].traversePath}/`,
historyState: null
})
Expand Down Expand Up @@ -163,7 +163,7 @@ function Router(props: RouterProps) {
}


return resultElement as JSX.Element
return resultElement as React.JSX.Element
}


Expand Down
2 changes: 1 addition & 1 deletion client_core/router/Router/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type GetPageParams = {
onEnter: ChildrenArrayEl['onEnter']
onLeave: ChildrenArrayEl['onLeave']
urlParams: URLparams
resultElement: JSX.Element | undefined
resultElement: React.JSX.Element | undefined
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function getSearchOptions(props: MergedProps, state: State, onSelect: onSelectIn
const { searchString, arrowSelectIndex } = state
const searchLower = searchString?.toLowerCase()

const options: JSX.Element[] = []
const options: React.JSX.Element[] = []
let selectedOption, selectedOptionIndex
for (let i = 0; i < searchOptions.length; i++) {
const option = searchOptions[i]
Expand Down
2 changes: 1 addition & 1 deletion client_core/ui/DropdownSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const DropdownSearch = component<Props, DefaultProps>(
const isShowOptions = isFocused
&& (showOnFocus || (searchString ? searchString.length : 0) >= minInputLength)

let optionsElement: JSX.Element | undefined
let optionsElement: React.JSX.Element | undefined
let selectedOption: Option | undefined
let selectedOptionIndex: number | undefined
if (isShowOptions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type GetStepperButtons = (
onPickerFocus: ComponentFocusEventHandler | undefined
}
) => {
stepperElement: JSX.Element
stepperElement: React.JSX.Element
isDisabledUp: boolean
isDisabledDown: boolean
}
Expand Down
6 changes: 3 additions & 3 deletions client_core/ui/Pagination/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const getPageElement: GetPageElement = (page: number, { curPage, theme }) => (
key={ page } data-page={ page } children={ page } />
)

function fillGap(start: number, end: number, result: JSX.Element[], props: MergedProps, isLastGap?: boolean) {
function fillGap(start: number, end: number, result: React.JSX.Element[], props: MergedProps, isLastGap?: boolean) {
const { theme, separator } = props

const elementToPush = (start - end) == 1
Expand All @@ -69,7 +69,7 @@ function fillGap(start: number, end: number, result: JSX.Element[], props: Merge
result.push(elementToPush)
}

function getElementsRange(from: number, to: number, result: JSX.Element[], props: MergedProps) {
function getElementsRange(from: number, to: number, result: React.JSX.Element[], props: MergedProps) {
for (let i = from; i <= to; i++) {
result.push(getPageElement(i, props))
}
Expand All @@ -82,7 +82,7 @@ function getPaginationVisuals(mergedProps: MergedProps, numberOfPages: number) {

const middlePluseSide = elementsByMiddle + elementsBySide
const maxLength = middlePluseSide * 2 + 3
const result: JSX.Element[] = []
const result: React.JSX.Element[] = []


if (maxLength > numberOfPages) getElementsRange(1, numberOfPages, result, mergedProps)
Expand Down
2 changes: 1 addition & 1 deletion client_core/ui/Pagination/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
} from '../_internals/types'


type GetPageElement = (page: number, props: MergedProps) => JSX.Element
type GetPageElement = (page: number, props: MergedProps) => React.JSX.Element


type Theme = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ type GetRangeElement = (
className: string | undefined,
width: number,
isVertical: MergedProps['isVertical']
) => JSX.Element
) => React.JSX.Element

type GetRangePickerElement = (
key: string,
props: MergedProps,
width: number
) => JSX.Element
) => React.JSX.Element


export type { GetRangeElement, GetRangePickerElement }
2 changes: 1 addition & 1 deletion client_core/ui/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const Select = component<Props, DefaultProps>(
}


let optionsElement: JSX.Element
let optionsElement: React.JSX.Element
let selectedOption: Props['options'][number] | undefined
let selectedOptionIndex: number | undefined

Expand Down
4 changes: 2 additions & 2 deletions client_core/ui/_internals/label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react'


type WithLabel = (
input: JSX.Element,
input: React.JSX.Element,
labelProps: ReactTagAttributes<HTMLLabelElement>,
labelTextProps: ReactTagAttributes<HTMLDivElement>
) => JSX.Element
) => React.JSX.Element


const withLabel: WithLabel = (input, labelProps, labelTextProps) => (
Expand Down
2 changes: 1 addition & 1 deletion client_core/ui/_internals/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type CoreUIComponent<
> = {
defaults: _Defaults
ID: string
} & React.MemoExoticComponent<(props: _Props) => JSX.Element>
} & React.MemoExoticComponent<(props: _Props) => React.JSX.Element>

type CoreUIComponentWithDefaults<_Component extends CoreUIComponent<any, any>> = {
(...args: Parameters<_Component>): ReturnType<_Component>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ function getHeadLabelMenuTableCell<T extends Parameters<NonNullable<DemoDataTabl

function getSearch() {
const searchByField = dataGridHookState.searchByField
let searchElement: JSX.Element | JSX.Element[]
let searchElement: React.JSX.Element | React.JSX.Element[]

if (type == 'set') {
const resultCheckbox: JSX.Element[] = []
const resultCheckbox: React.JSX.Element[] = []
const searchSet = searchByField[ID] || new Set()
const uniqValues = new Set()
const { byID, sorted } = entities
Expand Down
2 changes: 1 addition & 1 deletion demo_app/client/main/pages/DemoComponents/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type SidebarItemProps = {


const _demoComponents: Obj<{
(): JSX.Element
(): React.JSX.Element
coreSrcDirName: string
}> = demoComponents

Expand Down
3 changes: 1 addition & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ const config = typeScriptEslintCreateConfig(
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-base-to-string': 0,
'@typescript-eslint/only-throw-error': 0,
'@typescript-eslint/await-thenable': 0,
"@typescript-eslint/no-redundant-type-constituents": 0
'@typescript-eslint/await-thenable': 0
}
}
)
Expand Down

0 comments on commit 71456a1

Please sign in to comment.