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
const parseValues = (values: AreaColumnOption[]) => {
return values.map((value, index) => {
const parseValues = (values: AreaColumnOption[]) =>
values.map((value, index) => {
if (value) {
value = deepClone(value);
@ -232,7 +232,6 @@ export default defineComponent({
return value;
});
};
const getValues = () => {
if (pickerRef.value) {

View File

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

View File

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

View File

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

View File

@ -101,7 +101,7 @@ test('clear multiple toast', async () => {
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.clear(true);
const toast = Toast({ className: 'remove-toast' });

View File

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

View File

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

View File

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

771
yarn.lock

File diff suppressed because it is too large Load Diff