chore(lint): apply recommended lint rules

This commit is contained in:
Eric Liu 2019-12-29 15:37:56 -08:00
commit 866cc962cd
23 changed files with 35 additions and 54 deletions

View file

@ -22,7 +22,6 @@
let inputs = writable([]);
let inputIds = derived(inputs, _ => _.map(({ id }) => id));
let inputsById = derived(inputs, _ => _.reduce((a, c) => ({ ...a, [c.id]: c }), {}));
let labelTextEmpty = derived(inputs, _ => _.filter(({ labelText }) => !!labelText).length === 0);
let inputValue = writable(value);
let mode = writable(datePickerType);
@ -48,7 +47,7 @@
inputRefTo = ref;
}
},
updateValue: ({ id, type, value }) => {
updateValue: ({ type, value }) => {
if ((!calendar && type === 'input') || type === 'change') {
inputValue.set(value);
}

View file

@ -30,7 +30,6 @@
} = getContext('DatePicker');
let inputRef = undefined;
let iconRef = undefined;
add({ id, labelText });
@ -56,10 +55,10 @@
class={cx('--date-picker__input')}
on:input
on:input={({ target }) => {
updateValue({ id, type: 'input', value: target.value });
updateValue({ type: 'input', value: target.value });
}}
on:change={({ target }) => {
updateValue({ id, type: 'change', value: target.value });
updateValue({ type: 'change', value: target.value });
}}
on:keydown
on:keydown={({ key }) => {

View file

@ -65,10 +65,10 @@ function createCalendar({ options, base, input, dispatch }) {
onClose: () => {
dispatch('close');
},
onMonthChange: ({}, {}, instance) => {
onMonthChange: (s, d, instance) => {
updateMonthNode(instance);
},
onOpen: ({}, {}, instance) => {
onOpen: (s, d, instance) => {
dispatch('open');
updateClasses(instance);
updateMonthNode(instance);