diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index f18e35d818..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,98 +0,0 @@ -//@ts-check -/** - * ESlint Configuration - * @type {import('eslint').ESLint.ConfigData} - */ -const config = { - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react/recommended", - "plugin:react-hooks/recommended", - "prettier", - ], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint", "import", "unused-imports"], - parserOptions: { - project: ["./tsconfig.json"], - }, - rules: { - "no-unused-vars": "off", // Duplicate with unused-import/no-unused-vars - "no-param-reassign": "warn", - - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-misused-promises": [ - "error", - { checksVoidReturn: false }, - ], - "@typescript-eslint/no-floating-promises": [ - "warn", - { - ignoreIIFE: true, - }, - ], - - // Import Rules - "unused-imports/no-unused-imports": "error", - "unused-imports/no-unused-vars": [ - "error", - { - vars: "all", - varsIgnorePattern: "^_", - args: "after-used", - argsIgnorePattern: "^_", - }, - ], - "import/order": [ - "error", - { - groups: [ - "builtin", - "external", - "internal", - "parent", - "sibling", - "index", - "object", - "type", - ], - "newlines-between": "always", - pathGroups: [ - { - pattern: "~/**", - group: "parent", - position: "before", - }, - ], - alphabetize: { order: "asc", caseInsensitive: true }, - }, - ], - "@typescript-eslint/consistent-type-imports": [ - "error", - { prefer: "type-imports" }, - ], - "import/no-duplicates": ["error", { considerQueryString: true }], - - // React - "react/jsx-uses-react": "off", - "react/react-in-jsx-scope": "off", - }, - settings: { - react: { - version: "detect", - }, - }, - overrides: [ - { - files: ["**/*.test.tsx", "**/*.test.ts"], - plugins: ["jest"], - env: { - "jest/globals": true, - }, - extends: ["plugin:jest/recommended"], - }, - ], - ignorePatterns: ["*.js", "*.jsx"], -}; - -module.exports = config; diff --git a/README.md b/README.md index 3cccbfc024..cf26cf0dcf 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,7 @@ import "react-datepicker/dist/react-datepicker.css"; const Example = () => { const [startDate, setStartDate] = useState(new Date()); - return ( - setStartDate(date)} /> - ); + return setStartDate(date)} />; }; ``` @@ -69,12 +67,7 @@ See [here](https://github.com/Hacker0x01/react-datepicker/blob/main/docs/datepic You can also include a time picker by adding the showTimeSelect prop ```js - + ``` Times will be displayed at 30-minute intervals by default (default configurable via timeIntervals prop) diff --git a/docs/calendar_container.md b/docs/calendar_container.md index fc339f9538..cca1da5c09 100644 --- a/docs/calendar_container.md +++ b/docs/calendar_container.md @@ -1,8 +1,6 @@ -`calendar_container` (component) -================================ +# `calendar_container` (component) - -| name | type | default value | description | -|---|---|---|---| -|`showTime`||`false`|| -|`showTimeSelectOnly`||`false`|| \ No newline at end of file +| name | type | default value | description | +| -------------------- | ---- | ------------- | ----------- | +| `showTime` | | `false` | | +| `showTimeSelectOnly` | | `false` | | diff --git a/docs/calendar_icon.md b/docs/calendar_icon.md index d5e964cbf9..f01046d723 100644 --- a/docs/calendar_icon.md +++ b/docs/calendar_icon.md @@ -1,13 +1,12 @@ -`calendar_icon` (component) -=========================== +# `calendar_icon` (component) `CalendarIcon` is a React component that renders an icon for a calendar. The icon can be a string representing a CSS class, a React node, or a default SVG icon. @component -@prop icon - The icon to be displayed. This can be a string representing a CSS class or a React node. -@prop className - An optional string representing additional CSS classes to be applied to the icon. -@prop onClick - An optional function to be called when the icon is clicked. +@prop icon - The icon to be displayed. This can be a string representing a CSS class or a React node. +@prop className - An optional string representing additional CSS classes to be applied to the icon. +@prop onClick - An optional function to be called when the icon is clicked. @example // To use a CSS class as the icon @@ -17,10 +16,10 @@ The icon can be a string representing a CSS class, a React node, or a default SV // To use a React node as the icon } onClick={myClickHandler} /> -@returns The `CalendarIcon` component. +@returns The `CalendarIcon` component. -| name | type | default value | description | -|---|---|---|---| -|`className`||`""`|| -|`icon`|||| -|`onClick`|||| \ No newline at end of file +| name | type | default value | description | +| ----------- | ---- | ------------- | ----------- | +| `className` | | `""` | | +| `icon` | | | | +| `onClick` | | | | diff --git a/docs/click_outside_wrapper.md b/docs/click_outside_wrapper.md index cd34f6d781..ccf323813e 100644 --- a/docs/click_outside_wrapper.md +++ b/docs/click_outside_wrapper.md @@ -1,12 +1,10 @@ -`click_outside_wrapper` (component) -=================================== +# `click_outside_wrapper` (component) - -| name | type | default value | description | -|---|---|---|---| -|`children` (required)|||| -|`className`|||| -|`containerRef`|||| -|`ignoreClass`|||| -|`onClickOutside` (required)|||| -|`style`|||| \ No newline at end of file +| name | type | default value | description | +| --------------------------- | ---- | ------------- | ----------- | +| `children` (required) | | | | +| `className` | | | | +| `containerRef` | | | | +| `ignoreClass` | | | | +| `onClickOutside` (required) | | | | +| `style` | | | | diff --git a/docs/datepicker.md b/docs/datepicker.md index c894ae9ad2..d3d31597da 100644 --- a/docs/datepicker.md +++ b/docs/datepicker.md @@ -73,7 +73,7 @@ General datepicker component. | | | `popperModifiers` | `object` | | | | `popperPlacement` | `enumpopperPlacementPositions` | | | -| `preventOpenOnFocus` | `bool` | false | When this is true, the datepicker will not automatically open when the date field is focused | +| `preventOpenOnFocus` | `bool` | false | When this is true, the datepicker will not automatically open when the date field is focused | | `readOnly` | `bool` | | | | `required` | `bool` | | | | `scrollableYearDropdown` | `bool` | | | diff --git a/docs/index.md b/docs/index.md index 8e714df577..098133f913 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,96 +1,94 @@ -`index` (component) -=================== +# `index` (component) - -| name | type | default value | description | -|---|---|---|---| -|`allowSameDay`||`false`|| -|`ariaDescribedBy`|||| -|`ariaInvalid`|||| -|`ariaLabelClose`|||| -|`ariaLabelledBy`|||| -|`ariaRequired`|||| -|`autoComplete`|||| -|`autoFocus`|||| -|`calendarClassName`|||| -|`calendarContainer`|||| -|`calendarIconClassName`|||| -|`calendarIconClassname`|||| -|`calendarStartDay`||`undefined`|| -|`className`|||| -|`clearButtonClassName`|||| -|`clearButtonTitle`|||| -|`closeOnScroll`|||| -|`customInput`|||| -|`customInputRef`|||| -|`customTimeInput`||`null`|| -|`dateFormat`||`"MM/dd/yyyy"`|| -|`dateFormatCalendar`||`"LLLL yyyy"`|| -|`disabled`||`false`|| -|`disabledKeyboardNavigation`||`false`|| -|`dropdownMode`||`"scroll"`|| -|`enableTabLoop`||`true`|| -|`endDate`|||| -|`excludeScrollbar`||`true`|| -|`focusSelectedMonth`||`false`|| -|`form`|||| -|`highlightDates`|||| -|`holidays`|||| -|`id`|||| -|`isClearable`|||| -|`monthsShown`||`1`|| -|`name`|||| -|`nextMonthAriaLabel`||`"Next Month"`|| -|`nextMonthButtonLabel`||`"Next Month"`|| -|`nextYearAriaLabel`||`"Next Year"`|| -|`nextYearButtonLabel`||`"Next Year"`|| -|`onBlur`|||| -|`onCalendarClose`|||| -|`onCalendarOpen`|||| -|`onChangeRaw`|||| -|`onClickOutside`|||| -|`onFocus`|||| -|`onInputClick`|||| -|`onInputError`|||| -|`onKeyDown`|||| -|`onSelect`|||| -|`open`|||| -|`placeholderText`|||| -|`popperClassName`|||| -|`preventOpenOnFocus`||`false`|| -|`previousMonthAriaLabel`||`"Previous Month"`|| -|`previousMonthButtonLabel`||`"Previous Month"`|| -|`previousYearAriaLabel`||`"Previous Year"`|| -|`previousYearButtonLabel`||`"Previous Year"`|| -|`readOnly`||`false`|| -|`required`|||| -|`selected`|||| -|`selectsDisabledDaysInRange`||`false`|| -|`shouldCloseOnSelect`||`true`|| -|`showDateSelect`|||| -|`showFourColumnMonthYearPicker`||`false`|| -|`showFullMonthYearPicker`||`false`|| -|`showIcon`|||| -|`showMonthYearPicker`||`false`|| -|`showPopperArrow`||`true`|| -|`showPreviousMonths`||`false`|| -|`showQuarterYearPicker`||`false`|| -|`showTimeInput`||`false`|| -|`showTimeSelect`||`false`|| -|`showTwoColumnMonthYearPicker`||`false`|| -|`showWeekPicker`||`false`|| -|`showYearPicker`||`false`|| -|`startDate`|||| -|`startOpen`|||| -|`strictParsing`||`false`|| -|`swapRange`||`false`|| -|`tabIndex`|||| -|`timeCaption`||`"Time"`|| -|`timeInputLabel`||`"Time"`|| -|`timeIntervals`||`30`|| -|`title`|||| -|`toggleCalendarOnIconClick`||`false`|| -|`usePointerEvent`||`false`|| -|`value`|||| -|`withPortal`||`false`|| -|`yearItemNumber`||`12`|| \ No newline at end of file +| name | type | default value | description | +| ------------------------------- | ---- | ------------------ | ----------- | +| `allowSameDay` | | `false` | | +| `ariaDescribedBy` | | | | +| `ariaInvalid` | | | | +| `ariaLabelClose` | | | | +| `ariaLabelledBy` | | | | +| `ariaRequired` | | | | +| `autoComplete` | | | | +| `autoFocus` | | | | +| `calendarClassName` | | | | +| `calendarContainer` | | | | +| `calendarIconClassName` | | | | +| `calendarIconClassname` | | | | +| `calendarStartDay` | | `undefined` | | +| `className` | | | | +| `clearButtonClassName` | | | | +| `clearButtonTitle` | | | | +| `closeOnScroll` | | | | +| `customInput` | | | | +| `customInputRef` | | | | +| `customTimeInput` | | `null` | | +| `dateFormat` | | `"MM/dd/yyyy"` | | +| `dateFormatCalendar` | | `"LLLL yyyy"` | | +| `disabled` | | `false` | | +| `disabledKeyboardNavigation` | | `false` | | +| `dropdownMode` | | `"scroll"` | | +| `enableTabLoop` | | `true` | | +| `endDate` | | | | +| `excludeScrollbar` | | `true` | | +| `focusSelectedMonth` | | `false` | | +| `form` | | | | +| `highlightDates` | | | | +| `holidays` | | | | +| `id` | | | | +| `isClearable` | | | | +| `monthsShown` | | `1` | | +| `name` | | | | +| `nextMonthAriaLabel` | | `"Next Month"` | | +| `nextMonthButtonLabel` | | `"Next Month"` | | +| `nextYearAriaLabel` | | `"Next Year"` | | +| `nextYearButtonLabel` | | `"Next Year"` | | +| `onBlur` | | | | +| `onCalendarClose` | | | | +| `onCalendarOpen` | | | | +| `onChangeRaw` | | | | +| `onClickOutside` | | | | +| `onFocus` | | | | +| `onInputClick` | | | | +| `onInputError` | | | | +| `onKeyDown` | | | | +| `onSelect` | | | | +| `open` | | | | +| `placeholderText` | | | | +| `popperClassName` | | | | +| `preventOpenOnFocus` | | `false` | | +| `previousMonthAriaLabel` | | `"Previous Month"` | | +| `previousMonthButtonLabel` | | `"Previous Month"` | | +| `previousYearAriaLabel` | | `"Previous Year"` | | +| `previousYearButtonLabel` | | `"Previous Year"` | | +| `readOnly` | | `false` | | +| `required` | | | | +| `selected` | | | | +| `selectsDisabledDaysInRange` | | `false` | | +| `shouldCloseOnSelect` | | `true` | | +| `showDateSelect` | | | | +| `showFourColumnMonthYearPicker` | | `false` | | +| `showFullMonthYearPicker` | | `false` | | +| `showIcon` | | | | +| `showMonthYearPicker` | | `false` | | +| `showPopperArrow` | | `true` | | +| `showPreviousMonths` | | `false` | | +| `showQuarterYearPicker` | | `false` | | +| `showTimeInput` | | `false` | | +| `showTimeSelect` | | `false` | | +| `showTwoColumnMonthYearPicker` | | `false` | | +| `showWeekPicker` | | `false` | | +| `showYearPicker` | | `false` | | +| `startDate` | | | | +| `startOpen` | | | | +| `strictParsing` | | `false` | | +| `swapRange` | | `false` | | +| `tabIndex` | | | | +| `timeCaption` | | `"Time"` | | +| `timeInputLabel` | | `"Time"` | | +| `timeIntervals` | | `30` | | +| `title` | | | | +| `toggleCalendarOnIconClick` | | `false` | | +| `usePointerEvent` | | `false` | | +| `value` | | | | +| `withPortal` | | `false` | | +| `yearItemNumber` | | `12` | | diff --git a/docs/input_time.md b/docs/input_time.md index 775fde09d0..c306859056 100644 --- a/docs/input_time.md +++ b/docs/input_time.md @@ -1,5 +1,4 @@ -`input_time` (component) -======================== +# `input_time` (component) `InputTime` is a React component that manages time input. @@ -16,10 +15,10 @@ @returns The `InputTime` component. -| name | type | default value | description | -|---|---|---|---| -|`customTimeInput`|||| -|`date`|||| -|`onChange`|||| -|`timeInputLabel`|||| -|`timeString`|||| \ No newline at end of file +| name | type | default value | description | +| ----------------- | ---- | ------------- | ----------- | +| `customTimeInput` | | | | +| `date` | | | | +| `onChange` | | | | +| `timeInputLabel` | | | | +| `timeString` | | | | diff --git a/docs/month_dropdown.md b/docs/month_dropdown.md index 38863e7a46..949116c24d 100644 --- a/docs/month_dropdown.md +++ b/docs/month_dropdown.md @@ -1,10 +1,8 @@ -`month_dropdown` (component) -============================ +# `month_dropdown` (component) - -| name | type | default value | description | -|---|---|---|---| -|`dropdownMode` (required)|||| -|`locale`|||| -|`onChange` (required)|||| -|`useShortMonthInDropdown`|||| \ No newline at end of file +| name | type | default value | description | +| ------------------------- | ---- | ------------- | ----------- | +| `dropdownMode` (required) | | | | +| `locale` | | | | +| `onChange` (required) | | | | +| `useShortMonthInDropdown` | | | | diff --git a/docs/month_dropdown_options.md b/docs/month_dropdown_options.md index 78ea7c96cb..29437b4ce4 100644 --- a/docs/month_dropdown_options.md +++ b/docs/month_dropdown_options.md @@ -1,10 +1,8 @@ -`month_dropdown_options` (component) -==================================== +# `month_dropdown_options` (component) - -| name | type | default value | description | -|---|---|---|---| -|`month` (required)|||| -|`monthNames` (required)|||| -|`onCancel` (required)|||| -|`onChange` (required)|||| \ No newline at end of file +| name | type | default value | description | +| ----------------------- | ---- | ------------- | ----------- | +| `month` (required) | | | | +| `monthNames` (required) | | | | +| `onCancel` (required) | | | | +| `onChange` (required) | | | | diff --git a/docs/month_year_dropdown.md b/docs/month_year_dropdown.md index 452969ef52..b2074e2a74 100644 --- a/docs/month_year_dropdown.md +++ b/docs/month_year_dropdown.md @@ -1,9 +1,7 @@ -`month_year_dropdown` (component) -================================= +# `month_year_dropdown` (component) - -| name | type | default value | description | -|---|---|---|---| -|`dropdownMode` (required)|||| -|`locale`|||| -|`onChange` (required)|||| \ No newline at end of file +| name | type | default value | description | +| ------------------------- | ---- | ------------- | ----------- | +| `dropdownMode` (required) | | | | +| `locale` | | | | +| `onChange` (required) | | | | diff --git a/docs/month_year_dropdown_options.md b/docs/month_year_dropdown_options.md index c8fa1e5ca9..a14c320913 100644 --- a/docs/month_year_dropdown_options.md +++ b/docs/month_year_dropdown_options.md @@ -1,14 +1,12 @@ -`month_year_dropdown_options` (component) -========================================= +# `month_year_dropdown_options` (component) - -| name | type | default value | description | -|---|---|---|---| -|`date` (required)|||| -|`dateFormat` (required)|||| -|`locale`|||| -|`maxDate` (required)|||| -|`minDate` (required)|||| -|`onCancel` (required)|||| -|`onChange` (required)|||| -|`scrollableMonthYearDropdown`|||| \ No newline at end of file +| name | type | default value | description | +| ----------------------------- | ---- | ------------- | ----------- | +| `date` (required) | | | | +| `dateFormat` (required) | | | | +| `locale` | | | | +| `maxDate` (required) | | | | +| `minDate` (required) | | | | +| `onCancel` (required) | | | | +| `onChange` (required) | | | | +| `scrollableMonthYearDropdown` | | | | diff --git a/docs/portal.md b/docs/portal.md index 8b344e37c4..b1fd3fd659 100644 --- a/docs/portal.md +++ b/docs/portal.md @@ -1,5 +1,4 @@ -`portal` (component) -==================== +# `portal` (component) `Portal` is a React component that allows you to render children into a DOM node that exists outside the DOM hierarchy of the parent component. @@ -10,8 +9,8 @@ that exists outside the DOM hierarchy of the parent component. @property {string} props.portalId - The id of the DOM node into which the `Portal` will render. @property {ShadowRoot} [props.portalHost] - The DOM node to host the `Portal`. -| name | type | default value | description | -|---|---|---|---| -|`children` (required)|||| -|`portalHost`|||| -|`portalId` (required)|||| \ No newline at end of file +| name | type | default value | description | +| --------------------- | ---- | ------------- | ----------- | +| `children` (required) | | | | +| `portalHost` | | | | +| `portalId` (required) | | | | diff --git a/docs/tab_loop.md b/docs/tab_loop.md index ea89b3a94c..349b326c6a 100644 --- a/docs/tab_loop.md +++ b/docs/tab_loop.md @@ -1,5 +1,4 @@ -`tab_loop` (component) -====================== +# `tab_loop` (component) `TabLoop` is a React component that manages tabbing behavior for its children. @@ -10,7 +9,7 @@ and "Shift Tab" on the first element will focus the last element @component @example - + @param props - The properties that define the `TabLoop` component. @@ -19,7 +18,7 @@ and "Shift Tab" on the first element will focus the last element @returns The `TabLoop` component. -| name | type | default value | description | -|---|---|---|---| -|`children`|||| -|`enableTabLoop`||`true`|| \ No newline at end of file +| name | type | default value | description | +| --------------- | ---- | ------------- | ----------- | +| `children` | | | | +| `enableTabLoop` | | `true` | | diff --git a/docs/time.md b/docs/time.md index f1a2dfa18f..ace375cc6e 100644 --- a/docs/time.md +++ b/docs/time.md @@ -1,20 +1,18 @@ -`time` (component) -================== +# `time` (component) - -| name | type | default value | description | -|---|---|---|---| -|`format`|||| -|`handleOnKeyDown`|||| -|`injectTimes`|||| -|`intervals`||`30`|| -|`locale`|||| -|`monthRef`|||| -|`onChange`|||| -|`openToDate`|||| -|`selected`|||| -|`showTimeCaption`||`true`|| -|`showTimeSelectOnly`|||| -|`timeCaption`||`"Time"`|| -|`timeClassName`|||| -|`todayButton`||`null`|| \ No newline at end of file +| name | type | default value | description | +| -------------------- | ---- | ------------- | ----------- | +| `format` | | | | +| `handleOnKeyDown` | | | | +| `injectTimes` | | | | +| `intervals` | | `30` | | +| `locale` | | | | +| `monthRef` | | | | +| `onChange` | | | | +| `openToDate` | | | | +| `selected` | | | | +| `showTimeCaption` | | `true` | | +| `showTimeSelectOnly` | | | | +| `timeCaption` | | `"Time"` | | +| `timeClassName` | | | | +| `todayButton` | | `null` | | diff --git a/docs/week_number.md b/docs/week_number.md index 832eb3088c..1fcaaac385 100644 --- a/docs/week_number.md +++ b/docs/week_number.md @@ -1,21 +1,19 @@ -`week_number` (component) -========================= +# `week_number` (component) - -| name | type | default value | description | -|---|---|---|---| -|`ariaLabelPrefix`||`"week "`|| -|`containerRef`|||| -|`date` (required)|||| -|`disabledKeyboardNavigation`|||| -|`handleOnKeyDown`|||| -|`inline`|||| -|`isInputFocused`|||| -|`isWeekDisabled`|||| -|`onClick`|||| -|`preSelection`|||| -|`selected`|||| -|`shouldFocusDayInline`|||| -|`showWeekNumber`|||| -|`showWeekPicker`|||| -|`weekNumber` (required)|||| \ No newline at end of file +| name | type | default value | description | +| ---------------------------- | ---- | ------------- | ----------- | +| `ariaLabelPrefix` | | `"week "` | | +| `containerRef` | | | | +| `date` (required) | | | | +| `disabledKeyboardNavigation` | | | | +| `handleOnKeyDown` | | | | +| `inline` | | | | +| `isInputFocused` | | | | +| `isWeekDisabled` | | | | +| `onClick` | | | | +| `preSelection` | | | | +| `selected` | | | | +| `shouldFocusDayInline` | | | | +| `showWeekNumber` | | | | +| `showWeekPicker` | | | | +| `weekNumber` (required) | | | | diff --git a/docs/year.md b/docs/year.md index 2f3eac94e6..9bf269e828 100644 --- a/docs/year.md +++ b/docs/year.md @@ -1,5 +1,4 @@ -`year` (component) -================== +# `year` (component) `Year` is a component that represents a year in a date picker. @@ -20,26 +19,26 @@ @property {(date: Date) => void} props.onYearMouseEnter - Function to handle mouse enter events on a year. @property {(date: Date) => void} props.onYearMouseLeave - Function to handle mouse leave events on a year. -| name | type | default value | description | -|---|---|---|---| -|`clearSelectingDate`|||| -|`date`|||| -|`disabledKeyboardNavigation`|||| -|`endDate`|||| -|`handleOnKeyDown`|||| -|`inline`|||| -|`onDayClick`|||| -|`onYearMouseEnter` (required)|||| -|`onYearMouseLeave` (required)|||| -|`preSelection`|||| -|`renderYearContent`|||| -|`selected`|||| -|`selectingDate`|||| -|`selectsEnd`|||| -|`selectsRange`|||| -|`selectsStart`|||| -|`setPreSelection`|||| -|`startDate`|||| -|`usePointerEvent`|||| -|`yearClassName`|||| -|`yearItemNumber`|||| \ No newline at end of file +| name | type | default value | description | +| ----------------------------- | ---- | ------------- | ----------- | +| `clearSelectingDate` | | | | +| `date` | | | | +| `disabledKeyboardNavigation` | | | | +| `endDate` | | | | +| `handleOnKeyDown` | | | | +| `inline` | | | | +| `onDayClick` | | | | +| `onYearMouseEnter` (required) | | | | +| `onYearMouseLeave` (required) | | | | +| `preSelection` | | | | +| `renderYearContent` | | | | +| `selected` | | | | +| `selectingDate` | | | | +| `selectsEnd` | | | | +| `selectsRange` | | | | +| `selectsStart` | | | | +| `setPreSelection` | | | | +| `startDate` | | | | +| `usePointerEvent` | | | | +| `yearClassName` | | | | +| `yearItemNumber` | | | | diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000..2c282c0658 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,98 @@ +//@ts-check +/** + * ESlint Configuration + * @type {import('eslint').Linter.Config} + */ +const eslint = require("@eslint/js"); +const tseslint = require("typescript-eslint"); +const react = require("eslint-plugin-react"); +const reactHooks = require("eslint-plugin-react-hooks"); +const jestPlugin = require("eslint-plugin-jest"); + +module.exports = [ + eslint.configs.recommended, + ...tseslint.configs.recommended, + { + files: ["src/**/*.{js,jsx,ts,tsx}"], + ignores: ["src/examples/**"], + plugins: { + "@typescript-eslint": tseslint.plugin, + react, + "react-hooks": reactHooks, + }, + languageOptions: { + parser: tseslint.parser, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + project: ["./tsconfig.json"], + }, + }, + settings: { + react: { + version: "detect", + }, + }, + rules: { + ...react.configs.recommended.rules, + ...reactHooks.configs.recommended.rules, + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-unused-expressions": "off", + "@typescript-eslint/no-unused-vars": "off", + }, + }, + { + files: ["src/examples/*.js"], + plugins: { + react, + }, + rules: { + "no-unused-expressions": "off", + "react/react-in-jsx-scope": "off", + "react/jsx-no-undef": [ + "error", + { + allowGlobals: true, + }, + ], + }, + languageOptions: { + globals: { + useState: "readonly", + render: "readonly", + DatePicker: "readonly", + getHours: "readonly", + setHours: "readonly", + setSeconds: "readonly", + setMinutes: "readonly", + getDate: "readonly", + addDays: "readonly", + subDays: "readonly", + addMonths: "readonly", + fi: "readonly", + getDay: "readonly", + isValid: "readonly", + format: "readonly", + range: "readonly", + getYear: "readonly", + getMonth: "readonly", + PropTypes: "readonly", + CalendarContainer: "readonly", + subMonths: "readonly", + forwardRef: "readonly", + }, + }, + }, + // New configuration for test files + { + files: ["src/**/*.test.{js,jsx,ts,tsx}", "src/**/*.spec.{js,jsx,ts,tsx}"], + plugins: { + jest: jestPlugin, + }, + rules: { + ...jestPlugin.configs.recommended.rules, + "jest/expect-expect": "off", + }, + }, +]; diff --git a/package.json b/package.json index 6d716726bb..731b0155c6 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@babel/preset-env": "^7.25.4", "@babel/preset-react": "^7.24.7", "@babel/preset-typescript": "^7.24.7", + "@eslint/js": "^9.12.0", "@react-docgen/cli": "^2.0.3", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-commonjs": "^28.0.0", @@ -51,7 +52,7 @@ "@testing-library/dom": "^10.4.0", "@testing-library/react": "^16.0.0", "@testing-library/user-event": "14.5.2", - "@types/eslint": "^8.56.10", + "@types/eslint": "^9.6.1", "@types/jest": "^29.5.12", "@types/node": "22", "@types/react": "^19.0.2", @@ -62,11 +63,11 @@ "babel-jest": "^29.7.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "core-js": "^3.38.1", - "eslint": "^8.57.0", + "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^28.8.0", - "eslint-plugin-react": "^7.35.0", + "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-unused-imports": "^4.1.3", "husky": "9", @@ -88,7 +89,8 @@ "stylelint-scss": "^6.5.1", "ts-jest": "^29.2.5", "tslib": "^2.7.0", - "typescript": "^5.5.4" + "typescript": "^5.5.4", + "typescript-eslint": "^8.9.0" }, "peerDependencies": { "react": "^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc", @@ -100,7 +102,7 @@ "date-fns": "^4.1.0" }, "scripts": { - "eslint": "eslint --ext .js,.jsx,.ts,.tsx ./src", + "eslint": "eslint ./src", "precommit": "lint-staged --allow-empty", "sass-lint": "stylelint 'src/stylesheets/*.scss'", "lint": "yarn run eslint && yarn run sass-lint", diff --git a/src/month.tsx b/src/month.tsx index 5140d9a15b..17cce7d034 100644 --- a/src/month.tsx +++ b/src/month.tsx @@ -451,7 +451,6 @@ export default class Month extends Component { ? isPreSelected(this.props.preSelection) : undefined; - // eslint-disable-next-line no-constant-condition while (true) { weeks.push( { expect(firstHeader?.textContent).toBe(firstWeekDayMin); } - // eslint-disable-next-line jest/expect-expect it("should use the 'en' locale by default", () => { const selected = newDate(); const { calendar } = getCalendar({ selected }); testLocale(calendar, selected); }); - // eslint-disable-next-line jest/expect-expect it("should use the default locale when set", () => { const selected = newDate(); setDefaultLocale("fi"); @@ -1560,7 +1558,6 @@ describe("Calendar", () => { setDefaultLocale(""); }); - // eslint-disable-next-line jest/expect-expect it("should use the locale specified as a prop", () => { registerLocale("fi", fi); const locale = "fi"; @@ -1569,7 +1566,6 @@ describe("Calendar", () => { testLocale(calendar, selected, locale); }); - // eslint-disable-next-line jest/expect-expect it("should override the default locale with the locale prop", () => { const locale = "en"; const selected = newDate(); diff --git a/src/test/datepicker_test.test.tsx b/src/test/datepicker_test.test.tsx index c8208647f7..7b8e54a0b1 100644 --- a/src/test/datepicker_test.test.tsx +++ b/src/test/datepicker_test.test.tsx @@ -1005,7 +1005,6 @@ describe("DatePicker", () => { expect(getSeconds(date!)).toBe(12); }); - // eslint-disable-next-line jest/expect-expect it("should mount and unmount properly", () => { type State = { mounted: boolean; diff --git a/yarn.lock b/yarn.lock index 498480e979..e77b773a7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1468,34 +1468,71 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.6.1": +"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.12.1": version: 4.12.1 resolution: "@eslint-community/regexpp@npm:4.12.1" checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.1.4": - version: 2.1.4 - resolution: "@eslint/eslintrc@npm:2.1.4" +"@eslint/config-array@npm:^0.19.0": + version: 0.19.1 + resolution: "@eslint/config-array@npm:0.19.1" + dependencies: + "@eslint/object-schema": "npm:^2.1.5" + debug: "npm:^4.3.1" + minimatch: "npm:^3.1.2" + checksum: 10c0/43b01f596ddad404473beae5cf95c013d29301c72778d0f5bf8a6699939c8a9a5663dbd723b53c5f476b88b0c694f76ea145d1aa9652230d140fe1161e4a4b49 + languageName: node + linkType: hard + +"@eslint/core@npm:^0.10.0": + version: 0.10.0 + resolution: "@eslint/core@npm:0.10.0" + dependencies: + "@types/json-schema": "npm:^7.0.15" + checksum: 10c0/074018075079b3ed1f14fab9d116f11a8824cdfae3e822badf7ad546962fafe717a31e61459bad8cc59cf7070dc413ea9064ddb75c114f05b05921029cde0a64 + languageName: node + linkType: hard + +"@eslint/eslintrc@npm:^3.2.0": + version: 3.2.0 + resolution: "@eslint/eslintrc@npm:3.2.0" dependencies: ajv: "npm:^6.12.4" debug: "npm:^4.3.2" - espree: "npm:^9.6.0" - globals: "npm:^13.19.0" + espree: "npm:^10.0.1" + globals: "npm:^14.0.0" ignore: "npm:^5.2.0" import-fresh: "npm:^3.2.1" js-yaml: "npm:^4.1.0" minimatch: "npm:^3.1.2" strip-json-comments: "npm:^3.1.1" - checksum: 10c0/32f67052b81768ae876c84569ffd562491ec5a5091b0c1e1ca1e0f3c24fb42f804952fdd0a137873bc64303ba368a71ba079a6f691cee25beee9722d94cc8573 + checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b + languageName: node + linkType: hard + +"@eslint/js@npm:9.18.0, @eslint/js@npm:^9.12.0": + version: 9.18.0 + resolution: "@eslint/js@npm:9.18.0" + checksum: 10c0/3938344c5ac7feef4b73fcb30f3c3e753570cea74c24904bb5d07e9c42fcd34fcbc40f545b081356a299e11f360c9c274b348c05fb0113fc3d492e5175eee140 languageName: node linkType: hard -"@eslint/js@npm:8.57.1": - version: 8.57.1 - resolution: "@eslint/js@npm:8.57.1" - checksum: 10c0/b489c474a3b5b54381c62e82b3f7f65f4b8a5eaaed126546520bf2fede5532a8ed53212919fed1e9048dcf7f37167c8561d58d0ba4492a4244004e7793805223 +"@eslint/object-schema@npm:^2.1.5": + version: 2.1.5 + resolution: "@eslint/object-schema@npm:2.1.5" + checksum: 10c0/5320691ed41ecd09a55aff40ce8e56596b4eb81f3d4d6fe530c50fdd6552d88102d1c1a29d970ae798ce30849752a708772de38ded07a6f25b3da32ebea081d8 + languageName: node + linkType: hard + +"@eslint/plugin-kit@npm:^0.2.5": + version: 0.2.5 + resolution: "@eslint/plugin-kit@npm:0.2.5" + dependencies: + "@eslint/core": "npm:^0.10.0" + levn: "npm:^0.4.1" + checksum: 10c0/ba9832b8409af618cf61791805fe201dd62f3c82c783adfcec0f5cd391e68b40beaecb47b9a3209e926dbcab65135f410cae405b69a559197795793399f61176 languageName: node linkType: hard @@ -1558,14 +1595,20 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.13.0": - version: 0.13.0 - resolution: "@humanwhocodes/config-array@npm:0.13.0" +"@humanfs/core@npm:^0.19.1": + version: 0.19.1 + resolution: "@humanfs/core@npm:0.19.1" + checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 + languageName: node + linkType: hard + +"@humanfs/node@npm:^0.16.6": + version: 0.16.6 + resolution: "@humanfs/node@npm:0.16.6" dependencies: - "@humanwhocodes/object-schema": "npm:^2.0.3" - debug: "npm:^4.3.1" - minimatch: "npm:^3.0.5" - checksum: 10c0/205c99e756b759f92e1f44a3dc6292b37db199beacba8f26c2165d4051fe73a4ae52fdcfd08ffa93e7e5cb63da7c88648f0e84e197d154bbbbe137b2e0dd332e + "@humanfs/core": "npm:^0.19.1" + "@humanwhocodes/retry": "npm:^0.3.0" + checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 languageName: node linkType: hard @@ -1576,10 +1619,17 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^2.0.3": - version: 2.0.3 - resolution: "@humanwhocodes/object-schema@npm:2.0.3" - checksum: 10c0/80520eabbfc2d32fe195a93557cef50dfe8c8905de447f022675aaf66abc33ae54098f5ea78548d925aa671cd4ab7c7daa5ad704fe42358c9b5e7db60f80696c +"@humanwhocodes/retry@npm:^0.3.0": + version: 0.3.1 + resolution: "@humanwhocodes/retry@npm:0.3.1" + checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b + languageName: node + linkType: hard + +"@humanwhocodes/retry@npm:^0.4.1": + version: 0.4.1 + resolution: "@humanwhocodes/retry@npm:0.4.1" + checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b languageName: node linkType: hard @@ -1943,7 +1993,7 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.walk@npm:^1.2.3, @nodelib/fs.walk@npm:^1.2.8": +"@nodelib/fs.walk@npm:^1.2.3": version: 1.2.8 resolution: "@nodelib/fs.walk@npm:1.2.8" dependencies: @@ -2662,17 +2712,17 @@ __metadata: languageName: node linkType: hard -"@types/eslint@npm:^8.56.10": - version: 8.56.12 - resolution: "@types/eslint@npm:8.56.12" +"@types/eslint@npm:^9.6.1": + version: 9.6.1 + resolution: "@types/eslint@npm:9.6.1" dependencies: "@types/estree": "npm:*" "@types/json-schema": "npm:*" - checksum: 10c0/e4ca426abe9d55f82b69a3250bec78b6d340ad1e567f91c97ecc59d3b2d6a1d8494955ac62ad0ea14b97519db580611c02be8277cbea370bdfb0f96aa2910504 + checksum: 10c0/69ba24fee600d1e4c5abe0df086c1a4d798abf13792d8cfab912d76817fe1a894359a1518557d21237fbaf6eda93c5ab9309143dee4c59ef54336d1b3570420e languageName: node linkType: hard -"@types/estree@npm:*, @types/estree@npm:1.0.6, @types/estree@npm:^1.0.0": +"@types/estree@npm:*, @types/estree@npm:1.0.6, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.6": version: 1.0.6 resolution: "@types/estree@npm:1.0.6" checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a @@ -2734,7 +2784,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.15": version: 7.0.15 resolution: "@types/json-schema@npm:7.0.15" checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db @@ -2819,6 +2869,27 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/eslint-plugin@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.21.0" + dependencies: + "@eslint-community/regexpp": "npm:^4.10.0" + "@typescript-eslint/scope-manager": "npm:8.21.0" + "@typescript-eslint/type-utils": "npm:8.21.0" + "@typescript-eslint/utils": "npm:8.21.0" + "@typescript-eslint/visitor-keys": "npm:8.21.0" + graphemer: "npm:^1.4.0" + ignore: "npm:^5.3.1" + natural-compare: "npm:^1.4.0" + ts-api-utils: "npm:^2.0.0" + peerDependencies: + "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/4601d21ec35b9fa5cfc1ad0330733ab40d6c6822c7fc15c3584a16f678c9a72e077a1725a950823fe0f499a15f3981795b1ea5d1e7a1be5c7b8296ea9ae6327c + languageName: node + linkType: hard + "@typescript-eslint/eslint-plugin@npm:^7.18.0": version: 7.18.0 resolution: "@typescript-eslint/eslint-plugin@npm:7.18.0" @@ -2842,6 +2913,22 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/parser@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/parser@npm:8.21.0" + dependencies: + "@typescript-eslint/scope-manager": "npm:8.21.0" + "@typescript-eslint/types": "npm:8.21.0" + "@typescript-eslint/typescript-estree": "npm:8.21.0" + "@typescript-eslint/visitor-keys": "npm:8.21.0" + debug: "npm:^4.3.4" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/aadebd50ca7aa2d61ad85d890c0d7010f2c293ec4d50a7833ef9674f232f0bc7118faa93a898771fbea50f02d542d687cf3569421b23f72fe6fed6895d5506fc + languageName: node + linkType: hard + "@typescript-eslint/parser@npm:^8.6.0": version: 8.20.0 resolution: "@typescript-eslint/parser@npm:8.20.0" @@ -2888,6 +2975,16 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/scope-manager@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/scope-manager@npm:8.21.0" + dependencies: + "@typescript-eslint/types": "npm:8.21.0" + "@typescript-eslint/visitor-keys": "npm:8.21.0" + checksum: 10c0/ea405e79dc884ea1c76465604db52f9b0941d6cbb0bde6bce1af689ef212f782e214de69d46503c7c47bfc180d763369b7433f1965e3be3c442b417e8c9f8f75 + languageName: node + linkType: hard + "@typescript-eslint/type-utils@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/type-utils@npm:7.18.0" @@ -2905,6 +3002,21 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/type-utils@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/type-utils@npm:8.21.0" + dependencies: + "@typescript-eslint/typescript-estree": "npm:8.21.0" + "@typescript-eslint/utils": "npm:8.21.0" + debug: "npm:^4.3.4" + ts-api-utils: "npm:^2.0.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/617f5dfe83fd9a7c722b27fa4e7f0c84f29baa94f75a4e8e5ccfd5b0a373437f65724e21b9642870fb0960f204b1a7f516a038200a12f8118f21b1bf86315bf3 + languageName: node + linkType: hard + "@typescript-eslint/types@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/types@npm:7.18.0" @@ -2926,6 +3038,13 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/types@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/types@npm:8.21.0" + checksum: 10c0/67dfd300cc614d7b02e94d0dacfb228a7f4c3fd4eede29c43adb9e9fcc16365ae3df8d6165018da3c123dce65545bef03e3e8183f35e9b3a911ffc727e3274c2 + languageName: node + linkType: hard + "@typescript-eslint/typescript-estree@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/typescript-estree@npm:7.18.0" @@ -2981,6 +3100,24 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/typescript-estree@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.21.0" + dependencies: + "@typescript-eslint/types": "npm:8.21.0" + "@typescript-eslint/visitor-keys": "npm:8.21.0" + debug: "npm:^4.3.4" + fast-glob: "npm:^3.3.2" + is-glob: "npm:^4.0.3" + minimatch: "npm:^9.0.4" + semver: "npm:^7.6.0" + ts-api-utils: "npm:^2.0.0" + peerDependencies: + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/0cf5b0382524f4af54fb5ec71ca7e939ec922711f2d77b383740b28dd4b21407b0ab5dded62df6819d01c12c0b354e95667e3c7025a5d27d05b805161ab94855 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/utils@npm:7.18.0" @@ -2995,6 +3132,21 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/utils@npm:8.21.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:8.21.0" + "@typescript-eslint/types": "npm:8.21.0" + "@typescript-eslint/typescript-estree": "npm:8.21.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/d8347dbe9176417220aa62902cfc1b2007a9246bb7a8cccdf8590120903eb50ca14cb668efaab4646d086277f2367559985b62230e43ebd8b0723d237eeaa2f2 + languageName: node + linkType: hard + "@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0": version: 8.19.1 resolution: "@typescript-eslint/utils@npm:8.19.1" @@ -3040,10 +3192,13 @@ __metadata: languageName: node linkType: hard -"@ungap/structured-clone@npm:^1.2.0": - version: 1.2.1 - resolution: "@ungap/structured-clone@npm:1.2.1" - checksum: 10c0/127afbcc75ff1532f7b1eb85ee992f9faa70e8d5bb2558da05355d423b966fc279d0a485bf19da2883280e7c299ae4170809a72e78eab086da71c6bcdda5d1e2 +"@typescript-eslint/visitor-keys@npm:8.21.0": + version: 8.21.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.21.0" + dependencies: + "@typescript-eslint/types": "npm:8.21.0" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/b3f1412f550e35c0d7ae0410db616951116b365167539f9b85710d8bc2b36b322c5e637caee84cc1ae5df8f1d961880250d52ffdef352b31e5bdbef74ba6fea9 languageName: node linkType: hard @@ -3096,7 +3251,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2, acorn@npm:^8.9.0": +"acorn@npm:^8.1.0, acorn@npm:^8.11.0, acorn@npm:^8.12.0, acorn@npm:^8.14.0, acorn@npm:^8.8.1, acorn@npm:^8.8.2": version: 8.14.0 resolution: "acorn@npm:8.14.0" bin: @@ -4096,7 +4251,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -4787,7 +4942,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-react@npm:^7.35.0": +"eslint-plugin-react@npm:^7.37.1": version: 7.37.4 resolution: "eslint-plugin-react@npm:7.37.4" dependencies: @@ -4838,13 +4993,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.2.2": - version: 7.2.2 - resolution: "eslint-scope@npm:7.2.2" +"eslint-scope@npm:^8.2.0": + version: 8.2.0 + resolution: "eslint-scope@npm:8.2.0" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10c0/613c267aea34b5a6d6c00514e8545ef1f1433108097e857225fed40d397dd6b1809dffd11c2fde23b37ca53d7bf935fe04d2a18e6fc932b31837b6ad67e1c116 + checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 languageName: node linkType: hard @@ -4855,76 +5010,88 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 languageName: node linkType: hard -"eslint-visitor-keys@npm:^4.2.0": +"eslint-visitor-keys@npm:^4.1.0, eslint-visitor-keys@npm:^4.2.0": version: 4.2.0 resolution: "eslint-visitor-keys@npm:4.2.0" checksum: 10c0/2ed81c663b147ca6f578312919483eb040295bbab759e5a371953456c636c5b49a559883e2677112453728d66293c0a4c90ab11cab3428cf02a0236d2e738269 languageName: node linkType: hard -"eslint@npm:^8.57.0": - version: 8.57.1 - resolution: "eslint@npm:8.57.1" +"eslint@npm:^9.12.0": + version: 9.18.0 + resolution: "eslint@npm:9.18.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.6.1" - "@eslint/eslintrc": "npm:^2.1.4" - "@eslint/js": "npm:8.57.1" - "@humanwhocodes/config-array": "npm:^0.13.0" + "@eslint-community/regexpp": "npm:^4.12.1" + "@eslint/config-array": "npm:^0.19.0" + "@eslint/core": "npm:^0.10.0" + "@eslint/eslintrc": "npm:^3.2.0" + "@eslint/js": "npm:9.18.0" + "@eslint/plugin-kit": "npm:^0.2.5" + "@humanfs/node": "npm:^0.16.6" "@humanwhocodes/module-importer": "npm:^1.0.1" - "@nodelib/fs.walk": "npm:^1.2.8" - "@ungap/structured-clone": "npm:^1.2.0" + "@humanwhocodes/retry": "npm:^0.4.1" + "@types/estree": "npm:^1.0.6" + "@types/json-schema": "npm:^7.0.15" ajv: "npm:^6.12.4" chalk: "npm:^4.0.0" - cross-spawn: "npm:^7.0.2" + cross-spawn: "npm:^7.0.6" debug: "npm:^4.3.2" - doctrine: "npm:^3.0.0" escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^7.2.2" - eslint-visitor-keys: "npm:^3.4.3" - espree: "npm:^9.6.1" - esquery: "npm:^1.4.2" + eslint-scope: "npm:^8.2.0" + eslint-visitor-keys: "npm:^4.2.0" + espree: "npm:^10.3.0" + esquery: "npm:^1.5.0" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^6.0.1" + file-entry-cache: "npm:^8.0.0" find-up: "npm:^5.0.0" glob-parent: "npm:^6.0.2" - globals: "npm:^13.19.0" - graphemer: "npm:^1.4.0" ignore: "npm:^5.2.0" imurmurhash: "npm:^0.1.4" is-glob: "npm:^4.0.0" - is-path-inside: "npm:^3.0.3" - js-yaml: "npm:^4.1.0" json-stable-stringify-without-jsonify: "npm:^1.0.1" - levn: "npm:^0.4.1" lodash.merge: "npm:^4.6.2" minimatch: "npm:^3.1.2" natural-compare: "npm:^1.4.0" optionator: "npm:^0.9.3" - strip-ansi: "npm:^6.0.1" - text-table: "npm:^0.2.0" + peerDependencies: + jiti: "*" + peerDependenciesMeta: + jiti: + optional: true bin: eslint: bin/eslint.js - checksum: 10c0/1fd31533086c1b72f86770a4d9d7058ee8b4643fd1cfd10c7aac1ecb8725698e88352a87805cf4b2ce890aa35947df4b4da9655fb7fdfa60dbb448a43f6ebcf1 + checksum: 10c0/7f592ad228b9bd627a24870fdc875bacdab7bf535d4b67316c4cb791e90d0125130a74769f3c407b0c4b7027b3082ef33864a63ee1024552a60a17db60493f15 languageName: node linkType: hard -"espree@npm:^9.6.0, espree@npm:^9.6.1": - version: 9.6.1 - resolution: "espree@npm:9.6.1" +"espree@npm:^10.0.1": + version: 10.2.0 + resolution: "espree@npm:10.2.0" + dependencies: + acorn: "npm:^8.12.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.1.0" + checksum: 10c0/2b6bfb683e7e5ab2e9513949879140898d80a2d9867ea1db6ff5b0256df81722633b60a7523a7c614f05a39aeea159dd09ad2a0e90c0e218732fc016f9086215 + languageName: node + linkType: hard + +"espree@npm:^10.3.0": + version: 10.3.0 + resolution: "espree@npm:10.3.0" dependencies: - acorn: "npm:^8.9.0" + acorn: "npm:^8.14.0" acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^3.4.1" - checksum: 10c0/1a2e9b4699b715347f62330bcc76aee224390c28bb02b31a3752e9d07549c473f5f986720483c6469cf3cfb3c9d05df612ffc69eb1ee94b54b739e67de9bb460 + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 languageName: node linkType: hard @@ -4938,7 +5105,7 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.2": +"esquery@npm:^1.5.0": version: 1.6.0 resolution: "esquery@npm:1.6.0" dependencies: @@ -5152,12 +5319,12 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^6.0.1": - version: 6.0.1 - resolution: "file-entry-cache@npm:6.0.1" +"file-entry-cache@npm:^8.0.0": + version: 8.0.0 + resolution: "file-entry-cache@npm:8.0.0" dependencies: - flat-cache: "npm:^3.0.4" - checksum: 10c0/58473e8a82794d01b38e5e435f6feaf648e3f36fdb3a56e98f417f4efae71ad1c0d4ebd8a9a7c50c3ad085820a93fc7494ad721e0e4ebc1da3573f4e1c3c7cdd + flat-cache: "npm:^4.0.0" + checksum: 10c0/9e2b5938b1cd9b6d7e3612bdc533afd4ac17b2fc646569e9a8abbf2eb48e5eb8e316bc38815a3ef6a1b456f4107f0d0f055a614ca613e75db6bf9ff4d72c1638 languageName: node linkType: hard @@ -5206,14 +5373,13 @@ __metadata: languageName: node linkType: hard -"flat-cache@npm:^3.0.4": - version: 3.2.0 - resolution: "flat-cache@npm:3.2.0" +"flat-cache@npm:^4.0.0": + version: 4.0.1 + resolution: "flat-cache@npm:4.0.1" dependencies: flatted: "npm:^3.2.9" - keyv: "npm:^4.5.3" - rimraf: "npm:^3.0.2" - checksum: 10c0/b76f611bd5f5d68f7ae632e3ae503e678d205cf97a17c6ab5b12f6ca61188b5f1f7464503efae6dc18683ed8f0b41460beb48ac4b9ac63fe6201296a91ba2f75 + keyv: "npm:^4.5.4" + checksum: 10c0/2c59d93e9faa2523e4fda6b4ada749bed432cfa28c8e251f33b25795e426a1c6dbada777afb1f74fcfff33934fdbdea921ee738fcc33e71adc9d6eca984a1cfc languageName: node linkType: hard @@ -5522,12 +5688,10 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.19.0": - version: 13.24.0 - resolution: "globals@npm:13.24.0" - dependencies: - type-fest: "npm:^0.20.2" - checksum: 10c0/d3c11aeea898eb83d5ec7a99508600fbe8f83d2cf00cbb77f873dbf2bcb39428eff1b538e4915c993d8a3b3473fa71eeebfe22c9bb3a3003d1e26b1f2c8a42cd +"globals@npm:^14.0.0": + version: 14.0.0 + resolution: "globals@npm:14.0.0" + checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d languageName: node linkType: hard @@ -6100,13 +6264,6 @@ __metadata: languageName: node linkType: hard -"is-path-inside@npm:^3.0.3": - version: 3.0.3 - resolution: "is-path-inside@npm:3.0.3" - checksum: 10c0/cf7d4ac35fb96bab6a1d2c3598fe5ebb29aafb52c0aaa482b5a3ed9d8ba3edc11631e3ec2637660c44b3ce0e61a08d54946e8af30dec0b60a7c27296c68ffd05 - languageName: node - linkType: hard - "is-plain-object@npm:^5.0.0": version: 5.0.0 resolution: "is-plain-object@npm:5.0.0" @@ -7000,7 +7157,7 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.3": +"keyv@npm:^4.5.4": version: 4.5.4 resolution: "keyv@npm:4.5.4" dependencies: @@ -7416,7 +7573,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.0.4, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -8451,6 +8608,7 @@ __metadata: "@babel/preset-env": "npm:^7.25.4" "@babel/preset-react": "npm:^7.24.7" "@babel/preset-typescript": "npm:^7.24.7" + "@eslint/js": "npm:^9.12.0" "@floating-ui/react": "npm:^0.27.0" "@react-docgen/cli": "npm:^2.0.3" "@rollup/plugin-babel": "npm:^6.0.4" @@ -8461,7 +8619,7 @@ __metadata: "@testing-library/dom": "npm:^10.4.0" "@testing-library/react": "npm:^16.0.0" "@testing-library/user-event": "npm:14.5.2" - "@types/eslint": "npm:^8.56.10" + "@types/eslint": "npm:^9.6.1" "@types/jest": "npm:^29.5.12" "@types/node": "npm:22" "@types/react": "npm:^19.0.2" @@ -8474,11 +8632,11 @@ __metadata: clsx: "npm:^2.1.1" core-js: "npm:^3.38.1" date-fns: "npm:^4.1.0" - eslint: "npm:^8.57.0" + eslint: "npm:^9.12.0" eslint-config-prettier: "npm:^9.1.0" eslint-plugin-import: "npm:^2.29.1" eslint-plugin-jest: "npm:^28.8.0" - eslint-plugin-react: "npm:^7.35.0" + eslint-plugin-react: "npm:^7.37.1" eslint-plugin-react-hooks: "npm:^5.0.0" eslint-plugin-unused-imports: "npm:^4.1.3" husky: "npm:9" @@ -8501,6 +8659,7 @@ __metadata: ts-jest: "npm:^29.2.5" tslib: "npm:^2.7.0" typescript: "npm:^5.5.4" + typescript-eslint: "npm:^8.9.0" peerDependencies: react: ^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc react-dom: ^16.9.0 || ^17 || ^18 || ^19 || ^19.0.0-rc @@ -9850,13 +10009,6 @@ __metadata: languageName: node linkType: hard -"text-table@npm:^0.2.0": - version: 0.2.0 - resolution: "text-table@npm:0.2.0" - checksum: 10c0/02805740c12851ea5982686810702e2f14369a5f4c5c40a836821e3eefc65ffeec3131ba324692a37608294b0fd8c1e55a2dd571ffed4909822787668ddbee5c - languageName: node - linkType: hard - "tmpl@npm:1.0.5": version: 1.0.5 resolution: "tmpl@npm:1.0.5" @@ -10062,6 +10214,20 @@ __metadata: languageName: node linkType: hard +"typescript-eslint@npm:^8.9.0": + version: 8.21.0 + resolution: "typescript-eslint@npm:8.21.0" + dependencies: + "@typescript-eslint/eslint-plugin": "npm:8.21.0" + "@typescript-eslint/parser": "npm:8.21.0" + "@typescript-eslint/utils": "npm:8.21.0" + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: ">=4.8.4 <5.8.0" + checksum: 10c0/44e5c341ad7f0b41dce3b4ca7a4c0a399ebe51a5323d930750db1e308367b4813a620f4c2332a5774a1dccd0047ebbaf993a8b7effd67389e9069b29b5701520 + languageName: node + linkType: hard + "typescript@npm:^5.5.4": version: 5.7.3 resolution: "typescript@npm:5.7.3"