Skip to content

Commit d328179

Browse files
committed
style: improve syntax
1 parent eab2f47 commit d328179

File tree

14 files changed

+21
-20
lines changed

14 files changed

+21
-20
lines changed

src/components/Types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const placementPropType = PropTypes.oneOf<Placements>([
6060
'right-end',
6161
'left-start',
6262
'left',
63-
'left-end'
63+
'left-end',
6464
])
6565

6666
export type Shapes =

src/components/alert/CAlert.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ export const CAlert = forwardRef<HTMLDivElement, CAlertProps>(
7777
onExited={onDismissed}
7878
unmountOnExit
7979
>
80-
<div
81-
className={_className}
82-
role="alert"
83-
{...rest}
84-
ref={ref}
85-
>
80+
<div className={_className} role="alert" {...rest} ref={ref}>
8681
{children}
8782
{dismissible && <CButtonClose onClick={() => setVisible(false)} />}
8883
</div>

src/components/card/CCardBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ CCardBody.propTypes = {
2626
className: PropTypes.string,
2727
}
2828

29-
CCardBody.displayName = 'CCardBody'
29+
CCardBody.displayName = 'CCardBody'

src/components/carousel/slides.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export const slidesLight = [
77
'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_1607923e7e2%20text%20%7B%20fill%3A%23AAA%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_1607923e7e2%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23F5F5F5%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22285.9296875%22%20y%3D%22217.75625%22%3EFirst%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
88
'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_15ba800aa20%20text%20%7B%20fill%3A%23BBB%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_15ba800aa20%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23EEE%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22247.3203125%22%20y%3D%22218.3%22%3ESecond%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
99
'data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22800%22%20height%3D%22400%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20400%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%23holder_15ba800aa21%20text%20%7B%20fill%3A%23999%3Bfont-weight%3Anormal%3Bfont-family%3AHelvetica%2C%20monospace%3Bfont-size%3A40pt%20%7D%20%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_15ba800aa21%22%3E%3Crect%20width%3D%22800%22%20height%3D%22400%22%20fill%3D%22%23E5E5E5%22%3E%3C%2Frect%3E%3Cg%3E%3Ctext%20x%3D%22277%22%20y%3D%22218.3%22%3EThird%20slide%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E',
10-
]
10+
]

src/components/dropdown/CDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
6565
/**
6666
* Set the dropdown variant to an btn-group, dropdown, input-group, and nav-item. [docs]
6767
*/
68-
variant?: 'btn-group' | 'dropdown' | 'input-group' |'nav-item'
68+
variant?: 'btn-group' | 'dropdown' | 'input-group' | 'nav-item'
6969
/**
7070
* Toggle the visibility of dropdown menu component. [docs]
7171
*
@@ -160,7 +160,7 @@ export const CDropdown = forwardRef<HTMLDivElement | HTMLLIElement, CDropdownPro
160160
<Manager>
161161
{/* TODO: find solution how to handle click outside */}
162162
{variant === 'input-group' ? (
163-
<>{ children }</>
163+
<>{children}</>
164164
) : (
165165
<Component className={_className} {...rest} ref={forkedRef}>
166166
{children}

src/components/dropdown/CDropdownToggle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export const CDropdownToggle: FC<CDropdownToggleProps> = ({
6767
...triggers,
6868
}
6969

70+
// TODO: find solution
71+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
7072
const Toggler = (ref?: React.Ref<any>) => {
7173
return variant === 'nav-item' ? (
7274
<a href="#" {...togglerProps} ref={ref}>
@@ -88,7 +90,7 @@ CDropdownToggle.propTypes = {
8890
children: PropTypes.node,
8991
className: PropTypes.string,
9092
split: PropTypes.bool,
91-
trigger: triggerPropType
93+
trigger: triggerPropType,
9294
}
9395

9496
CDropdownToggle.displayName = 'CDropdownToggle'

src/components/form/CFormCheck.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface CFormCheckProps extends HTMLAttributes<HTMLInputElement> {
6767
* @type checkbox' | 'radio'
6868
* @default 'checkbox'
6969
*/
70-
type?: 'checkbox' | 'radio'
70+
type?: 'checkbox' | 'radio'
7171
/**
7272
* Set component validation state to valid. [docs]
7373
*/

src/components/modal/CModal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,17 @@ export const CModal: FC<CModalProps> = ({
182182

183183
CModal.propTypes = {
184184
alignment: PropTypes.oneOf(['top', 'center']),
185+
backdrop: PropTypes.bool,
185186
children: PropTypes.node,
186187
className: PropTypes.string,
187188
duration: PropTypes.number,
188189
fullscreen: PropTypes.oneOfType([
189190
PropTypes.bool,
190191
PropTypes.oneOf<'sm' | 'md' | 'lg' | 'xl' | 'xxl'>(['sm', 'md', 'lg', 'xl', 'xxl']),
191192
]),
193+
keyboard: PropTypes.bool,
192194
onDismiss: PropTypes.func,
195+
portal: PropTypes.bool,
193196
scrollable: PropTypes.bool,
194197
size: PropTypes.oneOf(['sm', 'lg', 'xl']),
195198
transition: PropTypes.bool,

src/components/nav/CNavGroupItems.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { forwardRef, HTMLAttributes } from 'react'
2-
import PropTypes from "prop-types";
2+
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

55
export interface CNavGroupItemsProps extends HTMLAttributes<HTMLUListElement> {
@@ -22,7 +22,7 @@ export const CNavGroupItems = forwardRef<HTMLUListElement, CNavGroupItemsProps>(
2222

2323
CNavGroupItems.propTypes = {
2424
children: PropTypes.node,
25-
className: PropTypes.string
25+
className: PropTypes.string,
2626
}
2727

2828
CNavGroupItems.displayName = 'CNavGroupItems'

src/components/offcanvas/COffcanvasBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ COffcanvasBody.propTypes = {
2626
className: PropTypes.string,
2727
}
2828

29-
COffcanvasBody.displayName = 'COffcanvasBody'
29+
COffcanvasBody.displayName = 'COffcanvasBody'

0 commit comments

Comments
 (0)