Skip to content

Commit

Permalink
Remove arrow-parens rule override
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Nov 6, 2020
1 parent 503c334 commit bf3510c
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
},
"parser": "babel-eslint",
"rules": {
"arrow-parens": ["error", "as-needed", {
"requireForBlockBody": true
}],
"jsx-a11y/label-has-associated-control": ["error", { "required": { "some": ["id", "nesting"] }}],
"no-restricted-globals": "off",
"react/jsx-props-no-spreading": "off",
Expand Down
8 changes: 4 additions & 4 deletions src/Calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ function getDetailValue({
return between(detailValueFrom, minDate, maxDate);
}

const getDetailValueFrom = args => getDetailValue(args, 0);
const getDetailValueFrom = (args) => getDetailValue(args, 0);

const getDetailValueTo = args => getDetailValue(args, 1);
const getDetailValueTo = (args) => getDetailValue(args, 1);

const getDetailValueArray = (args) => {
const { value } = args;
Expand All @@ -101,7 +101,7 @@ const getDetailValueArray = (args) => {
return value;
}

return [getDetailValueFrom, getDetailValueTo].map(fn => fn(args));
return [getDetailValueFrom, getDetailValueTo].map((fn) => fn(args));
};

function getActiveStartDate(props) {
Expand Down Expand Up @@ -154,7 +154,7 @@ function getInitialActiveStartDate(props) {
});
}

const getIsSingleValue = value => value && [].concat(value).length === 1;
const getIsSingleValue = (value) => value && [].concat(value).length === 1;

export default class Calendar extends Component {
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/DecadeView/Years.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Years(props) {
<TileGroup
{...props}
className="react-calendar__decade-view__years"
dateTransform={year => new Date(year, 0, 1)}
dateTransform={(year) => new Date(year, 0, 1)}
dateType="year"
end={end}
start={start}
Expand Down
2 changes: 1 addition & 1 deletion src/Flex.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('Flex', () => {

const children = component.children();

children.forEach(child => expect(parseFloat(child.prop('style').flexBasis)).toBeCloseTo(33.33));
children.forEach((child) => expect(parseFloat(child.prop('style').flexBasis)).toBeCloseTo(33.33));
expect(parseFloat(children.first().prop('style').marginLeft)).toBeCloseTo(33.33);
});
});
2 changes: 1 addition & 1 deletion src/MonthView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { isCalendarType } from './shared/propTypes';
function getCalendarTypeFromLocale(locale) {
return (
Object.keys(CALENDAR_TYPE_LOCALES)
.find(calendarType => CALENDAR_TYPE_LOCALES[calendarType].includes(locale))
.find((calendarType) => CALENDAR_TYPE_LOCALES[calendarType].includes(locale))
|| CALENDAR_TYPES.ISO_8601
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/MonthView/WeekNumber.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function WeekNumber({
? (
<button
{...props}
onClick={event => onClickWeekNumber(weekNumber, date, event)}
onClick={(event) => onClickWeekNumber(weekNumber, date, event)}
type="button"
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/MonthView/WeekNumbers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function WeekNumbers(props) {
return result;
})();

const weekNumbers = dates.map(date => getWeekNumber(date, calendarType));
const weekNumbers = dates.map((date) => getWeekNumber(date, calendarType));

return (
<Flex
Expand Down
2 changes: 1 addition & 1 deletion src/Tile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default class Tile extends Component {
|| (maxDate && maxDateTransform(maxDate) < date)
|| (tileDisabled && tileDisabled({ activeStartDate, date, view }))
}
onClick={onClick && (event => onClick(date, event))}
onClick={onClick && ((event) => onClick(date, event))}
onFocus={onMouseOver && (() => onMouseOver(date))}
onMouseOver={onMouseOver && (() => onMouseOver(date))}
style={style}
Expand Down
4 changes: 2 additions & 2 deletions src/Tile.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ describe('<Tile /> component', () => {
children: '',
classes: [],
date: new Date(2019, 0, 1),
maxDateTransform: date => date,
minDateTransform: date => date,
maxDateTransform: (date) => date,
minDateTransform: (date) => date,
};

it('renders button properly', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/YearView/Months.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function Months(props) {
<TileGroup
{...props}
className="react-calendar__year-view__months"
dateTransform={monthIndex => new Date(year, monthIndex, 1)}
dateTransform={(monthIndex) => new Date(year, monthIndex, 1)}
dateType="month"
end={end}
start={start}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/dates.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export function getValueRange(rangeType, date1, date2) {

function toYearLabel(locale, formatYear = defaultFormatYear, dates) {
return dates
.map(date => formatYear(locale, date))
.map((date) => formatYear(locale, date))
.join(' – ');
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/propTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const isView = (props, propName, componentName) => {
const allowedViews = views || allViews;

if (view !== undefined && allowedViews.indexOf(view) === -1) {
return new Error(`Invalid prop \`${propName}\` of value \`${view}\` supplied to \`${componentName}\`, expected one of [${allowedViews.map(a => `"${a}"`).join(', ')}].`);
return new Error(`Invalid prop \`${propName}\` of value \`${view}\` supplied to \`${componentName}\`, expected one of [${allowedViews.map((a) => `"${a}"`).join(', ')}].`);
}

// Everything is fine
Expand Down
4 changes: 2 additions & 2 deletions test/Test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class Test extends PureComponent {
view: 'month',
}

onChange = value => this.setState({ value });
onChange = (value) => this.setState({ value });

onViewOrDateChange = ({ activeStartDate, view }) => {
console.log('Changed view to', view, activeStartDate);
Expand Down Expand Up @@ -151,7 +151,7 @@ export default class Test extends PureComponent {
view,
} = this.state;

const setState = state => this.setState(state);
const setState = (state) => this.setState(state);

const commonProps = {
className: 'myCustomCalendarClassName',
Expand Down

0 comments on commit bf3510c

Please sign in to comment.