chore: upgrade oxlint to v0.13.2 (#8891)

Co-authored-by: LongYinan <lynweklm@gmail.com>
This commit is contained in:
Boshen
2024-11-26 17:56:35 +08:00
committed by GitHub
parent d87a6f7068
commit c349a24e95
35 changed files with 139 additions and 117 deletions

View File

@@ -159,11 +159,11 @@ export const OnboardingPage = ({
<div className={styles.optionsWrapper}>
{question.options &&
question.options.length > 0 &&
question.options.map((option, optionIndex) => {
question.options.map(option => {
if (option.type === 'checkbox') {
return (
<Checkbox
key={optionIndex}
key={option.label}
name={option.value}
className={styles.checkBox}
labelClassName={styles.label}
@@ -184,7 +184,7 @@ export const OnboardingPage = ({
} else if (option.type === 'input') {
return (
<Input
key={optionIndex}
key={option.label}
className={styles.input}
type="text"
size="large"

View File

@@ -187,23 +187,27 @@ export const DayPicker = memo(function DayPicker(
{/* Weeks in month */}
{matrix.map((week, i) => {
return (
// eslint-disable-next-line react/no-array-index-key
<div key={i} className={clsx(styles.monthViewRow)}>
{week.map((cell, j) => (
<div
className={clsx(
styles.monthViewBodyCell,
monthBodyCellClassName
)}
key={j}
onClick={() => onChange?.(cell.date.format(format))}
>
{customDayRenderer ? (
customDayRenderer(cell)
) : (
<DefaultDateCell key={j} {...cell} />
)}
</div>
))}
{week.map(cell => {
const dateValue = cell.date.format(format);
return (
<div
className={clsx(
styles.monthViewBodyCell,
monthBodyCellClassName
)}
key={dateValue}
onClick={() => onChange?.(dateValue)}
>
{customDayRenderer ? (
customDayRenderer(cell)
) : (
<DefaultDateCell key={dateValue} {...cell} />
)}
</div>
);
})}
</div>
);
})}

View File

@@ -45,6 +45,7 @@ const HeaderLayout = memo(function HeaderLayout({
const isRight = index === length - 1;
return (
<div
// eslint-disable-next-line react/no-array-index-key
key={index}
data-length={length}
data-is-left={isLeft}

View File

@@ -126,21 +126,24 @@ export const MonthPicker = memo(function MonthPicker(
const Body = useMemo(() => {
return (
<div className={styles.yearViewBody}>
{/* eslint-disable-next-line react/no-array-index-key */}
{matrix.map((row, i) => {
return (
// eslint-disable-next-line react/no-array-index-key
<div key={i} className={styles.yearViewRow}>
{row.map((month, j) => {
{row.map(month => {
const monthValue = month.format('YYYY-MM');
return (
<div key={j} className={styles.yearViewBodyCell}>
<div key={monthValue} className={styles.yearViewBodyCell}>
<button
data-value={month.format('YYYY-MM')}
data-value={monthValue}
data-is-month-cell
className={styles.yearViewBodyCellInner}
data-selected={value && month.isSame(value, 'month')}
data-current-month={month.isSame(dayjs(), 'month')}
onClick={() => onMonthChange(month)}
tabIndex={month.isSame(monthCursor, 'month') ? 0 : -1}
aria-label={month.format('YYYY-MM')}
aria-label={monthValue}
>
{monthNames.split(',')[month.month()]}
</button>

View File

@@ -136,12 +136,14 @@ export const YearPicker = memo(function YearPicker(
<div className={styles.decadeViewBody}>
{matrix.map((row, i) => {
return (
// eslint-disable-next-line react/no-array-index-key
<div key={i} className={styles.decadeViewRow}>
{row.map((year, j) => {
{row.map(year => {
const isDisabled =
year.isAfter(DATE_MAX) || year.isBefore(DATE_MIN);
const yearValue = year.year();
return (
<div key={j} className={styles.decadeViewBodyCell}>
<div key={yearValue} className={styles.decadeViewBodyCell}>
<button
aria-disabled={isDisabled}
data-value={year.format('YYYY')}
@@ -154,7 +156,7 @@ export const YearPicker = memo(function YearPicker(
isDisabled ? undefined : () => onYearChange(year)
}
>
{year.year()}
{yearValue}
</button>
</div>
);

View File

@@ -107,7 +107,7 @@ export const Slider = ({
{!!nodes &&
nodes.map((nodeValue, index) => (
<div
key={index}
key={nodeValue}
className={styles.nodeStyle}
data-active={value && value[0] >= nodeValue}
data-disabled={disabled}