Skip to content

Commit d10333f

Browse files
fix: Lint errors
1 parent a3d0dc9 commit d10333f

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export default [
2222
allowSeparatedGroups: false,
2323
},
2424
],
25+
'padding-line-between-statements': [
26+
'error',
27+
{ blankLine: 'always', prev: '*', next: 'return' },
28+
],
2529
'@typescript-eslint/no-explicit-any': 'off',
2630
'@typescript-eslint/no-unused-expressions': 'off',
2731
'prettier/prettier': [

src/components/VueCalendar.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
CalendarStylesProp,
66
CalendarValue,
77
DateString,
8+
DeepRequired,
89
Month,
910
Show,
1011
Year,
@@ -22,7 +23,7 @@ type VueCalendarProps = {
2223
startWeekOnMonday: boolean;
2324
min: DateString | undefined;
2425
max: DateString | undefined;
25-
styles: CalendarStylesProp;
26+
styles: DeepRequired<CalendarStylesProp>;
2627
};
2728
2829
const props = defineProps<VueCalendarProps>();

src/composables/clickOutside.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { onBeforeUnmount, onMounted, Ref } from 'vue';
1+
import { Ref, onBeforeUnmount, onMounted } from 'vue';
22

33
export function useClickOutside<E extends HTMLElement>(
44
element: Ref<E | undefined>,

src/types/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import dayjs from '@/dayjs-with-locales';
22

3+
export type DeepRequired<T> = T extends object
4+
? { [K in keyof T]-?: DeepRequired<T[K]> }
5+
: T;
6+
37
type Unit = '%' | 'px' | 'em' | 'rem';
48

59
export type InputStylesProp = {
@@ -66,7 +70,9 @@ export type InputStylesProp = {
6670
};
6771
};
6872

69-
export type InputStylesGenerator = (dark: boolean) => InputStylesProp;
73+
export type InputStylesGenerator = (
74+
dark: boolean,
75+
) => DeepRequired<InputStylesProp>;
7076

7177
export type CalendarStylesProp = {
7278
container?: {
@@ -147,7 +153,9 @@ export type CalendarStylesProp = {
147153
};
148154
};
149155

150-
export type CalendarStylesGenerator = (dark: boolean) => CalendarStylesProp;
156+
export type CalendarStylesGenerator = (
157+
dark: boolean,
158+
) => DeepRequired<CalendarStylesProp>;
151159

152160
export type DateValue = string | number | Date | null | undefined;
153161

0 commit comments

Comments
 (0)