From 6970a58d0e2ba911fd7c9a960531ed963c559d28 Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Fri, 6 Nov 2020 10:49:49 +0100 Subject: [PATCH] Remove arrow-parens rule override --- .eslintrc.json | 3 --- sample/parcel/Sample.jsx | 2 +- src/Calendar.jsx | 8 ++++---- src/DecadeView/Years.jsx | 2 +- src/Flex.spec.jsx | 2 +- src/MonthView.jsx | 2 +- src/MonthView/WeekNumber.jsx | 2 +- src/MonthView/WeekNumbers.jsx | 2 +- src/Tile.jsx | 2 +- src/Tile.spec.jsx | 4 ++-- src/YearView/Months.jsx | 2 +- src/shared/dates.js | 2 +- src/shared/propTypes.js | 2 +- test/Test.jsx | 4 ++-- 14 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index e251e0af..a66f5833 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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", diff --git a/sample/parcel/Sample.jsx b/sample/parcel/Sample.jsx index 1d02df36..db189c5e 100644 --- a/sample/parcel/Sample.jsx +++ b/sample/parcel/Sample.jsx @@ -8,7 +8,7 @@ export default class Sample extends Component { value: new Date(), } - onChange = value => this.setState({ value }) + onChange = (value) => this.setState({ value }) render() { const { value } = this.state; diff --git a/src/Calendar.jsx b/src/Calendar.jsx index 2bc4ac3c..0100f4b9 100644 --- a/src/Calendar.jsx +++ b/src/Calendar.jsx @@ -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; @@ -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) { @@ -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 = { diff --git a/src/DecadeView/Years.jsx b/src/DecadeView/Years.jsx index 98d6fc0a..9f12743d 100644 --- a/src/DecadeView/Years.jsx +++ b/src/DecadeView/Years.jsx @@ -15,7 +15,7 @@ export default function Years(props) { new Date(year, 0, 1)} + dateTransform={(year) => new Date(year, 0, 1)} dateType="year" end={end} start={start} diff --git a/src/Flex.spec.jsx b/src/Flex.spec.jsx index 6e76c6ee..91c7aaa9 100644 --- a/src/Flex.spec.jsx +++ b/src/Flex.spec.jsx @@ -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); }); }); diff --git a/src/MonthView.jsx b/src/MonthView.jsx index a65cb2f6..22dff73e 100644 --- a/src/MonthView.jsx +++ b/src/MonthView.jsx @@ -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 ); } diff --git a/src/MonthView/WeekNumber.jsx b/src/MonthView/WeekNumber.jsx index 6f8aa255..ffaecc14 100644 --- a/src/MonthView/WeekNumber.jsx +++ b/src/MonthView/WeekNumber.jsx @@ -22,7 +22,7 @@ export default function WeekNumber({ ? (