mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
chore: upgrade oxlint to v0.13.2 (#8891)
Co-authored-by: LongYinan <lynweklm@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user