chore: bump eslint config and format code (#9223)

This commit is contained in:
neverland 2021-08-10 10:49:32 +08:00 committed by GitHub
parent 9e55e28a43
commit c34c629ba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 364 additions and 458 deletions

View File

@ -219,8 +219,8 @@ export default defineComponent({
}; };
// parse output columns data // parse output columns data
const parseValues = (values: AreaColumnOption[]) => { const parseValues = (values: AreaColumnOption[]) =>
return values.map((value, index) => { values.map((value, index) => {
if (value) { if (value) {
value = deepClone(value); value = deepClone(value);
@ -232,7 +232,6 @@ export default defineComponent({
return value; return value;
}); });
};
const getValues = () => { const getValues = () => {
if (pickerRef.value) { if (pickerRef.value) {

View File

@ -241,14 +241,12 @@ export default defineComponent({
/> />
); );
const renderDays = () => { const renderDays = () => (
return ( <div ref={daysRef} role="grid" class={bem('days')}>
<div ref={daysRef} role="grid" class={bem('days')}> {renderMark()}
{renderMark()} {(shouldRender.value ? days : placeholders).value.map(renderDay)}
{(shouldRender.value ? days : placeholders).value.map(renderDay)} </div>
</div> );
);
};
useExpose({ useExpose({
getTitle, getTitle,

View File

@ -190,8 +190,8 @@ export default defineComponent({
); );
}; };
const renderKeys = () => { const renderKeys = () =>
return keys.value.map((key) => { keys.value.map((key) => {
const keySlots: Record<string, Slot | undefined> = {}; const keySlots: Record<string, Slot | undefined> = {};
if (key.type === 'delete') { if (key.type === 'delete') {
@ -213,7 +213,6 @@ export default defineComponent({
/> />
); );
}); });
};
const renderSidebar = () => { const renderSidebar = () => {
if (props.theme === 'custom') { if (props.theme === 'custom') {

View File

@ -112,8 +112,8 @@ export default defineComponent({
const wrapperRef = ref<HTMLElement>(); const wrapperRef = ref<HTMLElement>();
const popoverRef = ref<ComponentInstance>(); const popoverRef = ref<ComponentInstance>();
const createPopperInstance = () => { const createPopperInstance = () =>
return createPopper(wrapperRef.value!, popoverRef.value!.popupRef.value, { createPopper(wrapperRef.value!, popoverRef.value!.popupRef.value, {
placement: props.placement, placement: props.placement,
modifiers: [ modifiers: [
{ {
@ -130,7 +130,6 @@ export default defineComponent({
}), }),
], ],
}); });
};
const updateLocation = () => { const updateLocation = () => {
nextTick(() => { nextTick(() => {

View File

@ -101,7 +101,7 @@ test('clear multiple toast', async () => {
Toast.allowMultiple(false); Toast.allowMultiple(false);
}); });
test('remove toast DOM when cleared in multiple mode', async function () { test('remove toast DOM when cleared in multiple mode', async () => {
Toast.allowMultiple(); Toast.allowMultiple();
Toast.clear(true); Toast.clear(true);
const toast = Toast({ className: 'remove-toast' }); const toast = Toast({ className: 'remove-toast' });

View File

@ -65,11 +65,10 @@ export default defineComponent({
], ],
setup(props, { emit, slots }) { setup(props, { emit, slots }) {
const isActiveItem = (id: number | string) => { const isActiveItem = (id: number | string) =>
return Array.isArray(props.activeId) Array.isArray(props.activeId)
? props.activeId.includes(id) ? props.activeId.includes(id)
: props.activeId === id; : props.activeId === id;
};
const renderSubItem = (item: TreeSelectChild) => { const renderSubItem = (item: TreeSelectChild) => {
const onClick = () => { const onClick = () => {

View File

@ -221,8 +221,8 @@ export default {
}; };
// 返回 Promise // 返回 Promise
const asyncBeforeRead = (file) => { const asyncBeforeRead = (file) =>
return new Promise((resolve, reject) => { new Promise((resolve, reject) => {
if (file.type !== 'image/jpeg') { if (file.type !== 'image/jpeg') {
Toast('Please upload an image in jpg format'); Toast('Please upload an image in jpg format');
reject(); reject();
@ -233,7 +233,6 @@ export default {
resolve(img); resolve(img);
} }
}); });
};
return { return {
beforeRead, beforeRead,

View File

@ -240,8 +240,8 @@ export default {
}; };
// 返回 Promise // 返回 Promise
const asyncBeforeRead = (file) => { const asyncBeforeRead = (file) =>
return new Promise((resolve, reject) => { new Promise((resolve, reject) => {
if (file.type !== 'image/jpeg') { if (file.type !== 'image/jpeg') {
Toast('请上传 jpg 格式图片'); Toast('请上传 jpg 格式图片');
reject(); reject();
@ -252,7 +252,6 @@ export default {
resolve(img); resolve(img);
} }
}); });
};
return { return {
beforeRead, beforeRead,
@ -449,8 +448,8 @@ import Compressor from 'compressorjs';
export default { export default {
setup() { setup() {
const beforeRead = (file) => { const beforeRead = (file) =>
return new Promise((resolve) => { new Promise((resolve) => {
// compressorjs 默认开启 checkOrientation 选项 // compressorjs 默认开启 checkOrientation 选项
// 会将图片修正为正确方向 // 会将图片修正为正确方向
new Compressor(file, { new Compressor(file, {
@ -460,7 +459,6 @@ export default {
}, },
}); });
}); });
};
return { return {
beforeRead, beforeRead,

771
yarn.lock

File diff suppressed because it is too large Load Diff