Skip to content

Commit 31d00bf

Browse files
committed
chore: update lit & format
1 parent deada0a commit 31d00bf

File tree

53 files changed

+81
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+81
-65
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ lib/
88
_site/
99
dist/
1010
site/dist/
11-
components/version/version.tsx
11+
components/version/version.ts
1212
site/src/router/demoRoutes.js
13+
locale/

antd-tools/getWebpackConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ All rights reserved.
185185
};
186186

187187
if (process.env.RUN_ENV === 'PRODUCTION') {
188-
let entry = ['./index'];
188+
const entry = ['./index'];
189189
config.externals = [
190190
{
191191
vue: {

antd-tools/gulpfile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ function pub(done) {
368368
}
369369
}
370370

371-
let startTime = new Date();
371+
const startTime = new Date();
372372
gulp.task('compile-with-es', done => {
373373
console.log('start compile at ', startTime);
374374
console.log('[Parallel] Compile to es...');
@@ -452,7 +452,7 @@ gulp.task(
452452
newVersion.trim() === version
453453
) {
454454
// eslint-disable-next-line no-unused-vars
455-
runCmd('npm', ['run', 'pub'], code => {
455+
runCmd('npm', ['run', 'pub'], _code => {
456456
done();
457457
});
458458
} else {

components/_util/supportsPassive.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test via a getter in the options object to see if the passive property is accessed
22
let supportsPassive = false;
33
try {
4-
let opts = Object.defineProperty({}, 'passive', {
4+
const opts = Object.defineProperty({}, 'passive', {
55
get() {
66
supportsPassive = true;
77
},

components/_util/type.ts

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export interface PropOptions<T = any, D = T> {
3131
}
3232

3333
declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
34+
35+
// eslint-disable-next-line no-undef
3436
export type VueNode = VNodeChildAtom | VNodeChildAtom[] | JSX.Element;
3537

3638
export const withInstall = <T>(comp: T) => {

components/breadcrumb/BreadcrumbItem.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
88
import useConfigInject from '../config-provider/hooks/useConfigInject';
99
import type { MouseEventHandler } from '../_util/EventInterface';
1010
import { eventType, objectType } from '../_util/type';
11-
import type { CustomSlotsType } from '../_util/type';
11+
import type { CustomSlotsType, VueNode } from '../_util/type';
1212

1313
export const breadcrumbItemProps = () => ({
1414
prefixCls: String,
@@ -38,7 +38,7 @@ export default defineComponent({
3838
* if overlay is have
3939
* Wrap a Dropdown
4040
*/
41-
const renderBreadcrumbNode = (breadcrumbItem: JSX.Element, prefixCls: string) => {
41+
const renderBreadcrumbNode = (breadcrumbItem: VueNode, prefixCls: string) => {
4242
const overlay = getPropsSlot(slots, props, 'overlay');
4343
if (overlay) {
4444
return (
@@ -59,7 +59,7 @@ export default defineComponent({
5959
const separator = getPropsSlot(slots, props, 'separator') ?? '/';
6060
const children = getPropsSlot(slots, props);
6161
const { class: cls, style, ...restAttrs } = attrs;
62-
let link: JSX.Element;
62+
let link: VueNode;
6363
if (props.href !== undefined) {
6464
link = (
6565
<a class={`${prefixCls.value}-link`} onClick={handleClick} {...restAttrs}>

components/locale-provider/__tests__/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ describe('Locale Provider', () => {
206206
return null;
207207
},
208208
};
209-
for (let locale of locales) {
209+
for (const locale of locales) {
210210
document.body.innerHTML = '';
211211
mount(
212212
{

components/message/__tests__/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ describe('message', () => {
107107

108108
// https:// github.com/ant-design/ant-design/issues/8201
109109
it('should hide message correctly', async () => {
110-
let hide = message.loading('Action in progress..', 0);
110+
const hide = message.loading('Action in progress..', 0);
111111
await Promise.resolve();
112112
expect(document.querySelectorAll('.ant-message-notice').length).toBe(1);
113113
hide();

components/modal/useModal/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import destroyFns from '../destroyFns';
1212
let uuid = 0;
1313

1414
interface ElementsHolderRef {
15-
addModal: (modal: () => JSX.Element) => () => void;
15+
addModal: (modal: () => VueNode) => () => void;
1616
}
1717

1818
const ElementsHolder = defineComponent({
1919
name: 'ElementsHolder',
2020
inheritAttrs: false,
2121
setup(_, { expose }) {
22-
const modals = shallowRef<(() => JSX.Element)[]>([]);
23-
const addModal = (modal: () => JSX.Element) => {
22+
const modals = shallowRef<(() => VueNode)[]>([]);
23+
const addModal = (modal: () => VueNode) => {
2424
modals.value.push(modal);
2525
modals.value = modals.value.slice();
2626
return () => {

components/progress/Circle.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const getMinPercent = (width: number): number => (CIRCLE_MIN_STROKE_WIDTH / widt
2323

2424
export default defineComponent({
2525
compatConfig: { MODE: 3 },
26-
name: 'Circle',
26+
name: 'ProgressCircle',
2727
inheritAttrs: false,
2828
props: initDefaultProps(circleProps(), {
2929
trailColor: null as unknown as string,

components/progress/Line.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const handleGradient = (
7272

7373
export default defineComponent({
7474
compatConfig: { MODE: 3 },
75-
name: 'Line',
75+
name: 'ProgressLine',
7676
inheritAttrs: false,
7777
props: lineProps(),
7878
setup(props, { slots, attrs }) {

components/statistic/Statistic.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CSSProperties, ExtractPropTypes, PropType, VNode } from 'vue';
1+
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
22
import { defineComponent } from 'vue';
33
import initDefaultProps from '../_util/props-util/initDefaultProps';
44
import StatisticNumber from './Number';
@@ -9,7 +9,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
99
// CSSINJS
1010
import useStyle from './style';
1111
import { anyType, booleanType, functionType, someType, vNodeType } from '../_util/type';
12-
import type { CustomSlotsType } from '../_util/type';
12+
import type { CustomSlotsType, VueNode } from '../_util/type';
1313

1414
export const statisticProps = () => ({
1515
prefixCls: String,
@@ -18,7 +18,7 @@ export const statisticProps = () => ({
1818
format: String,
1919
value: someType<valueType>([Number, String, Object]),
2020
valueStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
21-
valueRender: functionType<(node: VNode | JSX.Element) => VNode | JSX.Element>(),
21+
valueRender: functionType<(node: VueNode) => VueNode>(),
2222
formatter: anyType<Formatter>(),
2323
precision: Number,
2424
prefix: vNodeType(),
@@ -60,7 +60,7 @@ export default defineComponent({
6060
const formatter = props.formatter ?? (slots.formatter as unknown as Formatter);
6161
// data-for-update just for update component
6262
// https://github.com/vueComponent/ant-design-vue/pull/3170
63-
let valueNode = (
63+
let valueNode: VueNode = (
6464
<StatisticNumber
6565
data-for-update={Date.now()}
6666
{...{ ...props, prefixCls: pre, value, formatter }}

components/typography/Base.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const baseProps = () => ({
125125

126126
const Base = defineComponent({
127127
compatConfig: { MODE: 3 },
128-
name: 'Base',
128+
name: 'TypographyBase',
129129
inheritAttrs: false,
130130
props: baseProps(),
131131
// emits: ['update:content'],

components/typography/__tests__/index.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe('Typography', () => {
214214
});
215215

216216
describe('copyable', () => {
217-
// eslint-disable-next-line no-unused-vars
217+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
218218
function copyTest(name, text, target, icon) {
219219
it(name, async () => {
220220
jest.useFakeTimers();

components/vc-dialog/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type ContentRef = {
1212
};
1313
export default defineComponent({
1414
compatConfig: { MODE: 3 },
15-
name: 'Content',
15+
name: 'DialogContent',
1616
inheritAttrs: false,
1717
props: {
1818
...dialogPropTypes(),

components/vc-dialog/Dialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { getMotionName, getUUID } from './util';
1616

1717
export default defineComponent({
1818
compatConfig: { MODE: 3 },
19-
name: 'Dialog',
19+
name: 'VcDialog',
2020
inheritAttrs: false,
2121
props: initDefaultProps(
2222
{

components/vc-dialog/Mask.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Transition, { getTransitionProps } from '../_util/transition';
33

44
export default defineComponent({
55
compatConfig: { MODE: 3 },
6-
name: 'Mask',
6+
name: 'DialogMask',
77
props: {
88
prefixCls: String,
99
visible: Boolean,

components/vc-image/src/Image.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const mergeDefaultValue = <T extends object>(obj: T, defaultValues: objec
6464
let uuid = 0;
6565
const ImageInternal = defineComponent({
6666
compatConfig: { MODE: 3 },
67-
name: 'Image',
67+
name: 'VcImage',
6868
inheritAttrs: false,
6969
props: imageProps(),
7070
emits: ['click', 'error'],

components/vc-picker/PickerPanel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,5 @@ function PickerPanel<DateType>() {
616616
});
617617
}
618618
const InterPickerPanel = PickerPanel<any>();
619-
export default <DateType,>(props: MergedPickerPanelProps<DateType>): JSX.Element =>
619+
export default <DateType,>(props: MergedPickerPanelProps<DateType>) =>
620620
createVNode(InterPickerPanel, props);

components/vc-progress/src/Line.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { propTypes } from './types';
66

77
export default defineComponent({
88
compatConfig: { MODE: 3 },
9-
name: 'Line',
9+
name: 'ProgressLine',
1010
props: initDefaultProps(propTypes, defaultProps),
1111
setup(props) {
1212
const percentList = computed(() => {

components/vc-select/BaseSelect.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
watch,
2929
watchEffect,
3030
} from 'vue';
31-
import type { CSSProperties, ExtractPropTypes, PropType, VNode } from 'vue';
31+
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
3232
import PropTypes from '../_util/vue-types';
3333
import { initDefaultProps, isValidElement } from '../_util/props-util';
3434
import isMobile from '../vc-util/isMobile';
@@ -721,7 +721,7 @@ export default defineComponent({
721721
// ============================= Arrow ==============================
722722
const mergedShowArrow =
723723
showArrow !== undefined ? showArrow : loading || (!multiple.value && mode !== 'combobox');
724-
let arrowNode: VNode | JSX.Element;
724+
let arrowNode: VueNode;
725725

726726
if (mergedShowArrow) {
727727
arrowNode = (
@@ -742,7 +742,7 @@ export default defineComponent({
742742
}
743743

744744
// ============================= Clear ==============================
745-
let clearNode: VNode | JSX.Element;
745+
let clearNode: VueNode;
746746
const onClearMouseDown: MouseEventHandler = () => {
747747
onClear?.();
748748

@@ -851,7 +851,7 @@ export default defineComponent({
851851
></SelectTrigger>
852852
);
853853
// >>> Render
854-
let renderNode: VNode | JSX.Element;
854+
let renderNode: VueNode;
855855

856856
// Render raw
857857
if (customizeRawInputElement) {

components/vc-select/Select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function isRawValue(value: DraftValueType): value is RawValueType {
164164

165165
export default defineComponent({
166166
compatConfig: { MODE: 3 },
167-
name: 'Select',
167+
name: 'VcSelect',
168168
inheritAttrs: false,
169169
props: initDefaultProps(selectProps(), {
170170
prefixCls: 'vc-select',

components/vc-select/Selector/Input.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type InputProps = Partial<ExtractPropTypes<typeof inputProps>>;
4242

4343
const Input = defineComponent({
4444
compatConfig: { MODE: 3 },
45-
name: 'Input',
45+
name: 'SelectInput',
4646
inheritAttrs: false,
4747
props: inputProps,
4848
setup(props) {

components/vc-slick/track.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const getSlideClasses = spec => {
3232
} else {
3333
focusedSlide = spec.targetSlide;
3434
}
35-
let slickCurrent = index === focusedSlide;
35+
const slickCurrent = index === focusedSlide;
3636
return {
3737
'slick-slide': true,
3838
'slick-active': slickActive,

components/vc-slick/utils/innerSliderUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ export const swipeEnd = (e, spec) => {
461461
onSwipe(swipeDirection);
462462
}
463463
let slideCount, newSlide;
464-
let activeSlide = infinite ? currentSlide : targetSlide;
464+
const activeSlide = infinite ? currentSlide : targetSlide;
465465
switch (swipeDirection) {
466466
case 'left':
467467
case 'up':

components/vc-table/Body/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface BodyProps<RecordType> {
2222
}
2323

2424
export default defineComponent<BodyProps<any>>({
25-
name: 'Body',
25+
name: 'TableBody',
2626
props: [
2727
'data',
2828
'getRowKey',

components/vc-table/Footer/Summary.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface SummaryProps {
77

88
let indexGuid = 0;
99
const Summary = defineComponent<SummaryProps>({
10-
name: 'Summary',
10+
name: 'TableSummary',
1111
props: ['fixed'] as any,
1212
setup(props, { slots }) {
1313
const tableContext = useInjectTable();

components/vc-table/Footer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface FooterProps<RecordType = DefaultRecordType> {
1313
}
1414

1515
export default defineComponent<FooterProps>({
16-
name: 'Footer',
16+
name: 'TableFooter',
1717
inheritAttrs: false,
1818
props: ['stickyOffsets', 'flattenColumns'] as any,
1919
setup(props, { slots }) {

components/vc-table/Header/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export interface HeaderProps<RecordType = DefaultRecordType> {
9191
}
9292

9393
export default defineComponent<HeaderProps>({
94-
name: 'Header',
94+
name: 'TableHeader',
9595
inheritAttrs: false,
9696
props: ['columns', 'flattenColumns', 'stickyOffsets', 'customHeaderRow'] as any,
9797
setup(props) {

components/vc-table/Table.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export interface TableProps<RecordType = DefaultRecordType> {
150150
}
151151

152152
export default defineComponent<TableProps<DefaultRecordType>>({
153-
name: 'Table',
153+
name: 'VcTable',
154154
inheritAttrs: false,
155155
props: [
156156
'prefixCls',

components/vc-tooltip/src/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type TooltipContentProps = Partial<ExtractPropTypes<typeof tooltipContent
1212

1313
export default defineComponent({
1414
compatConfig: { MODE: 3 },
15-
name: 'Content',
15+
name: 'TooltipContent',
1616
props: tooltipContentProps,
1717
setup(props: TooltipContentProps, { slots }) {
1818
return () => (

components/vc-tour/Mask.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface MaskProps {
2323
zIndex?: number;
2424
}
2525
const Mask = defineComponent({
26-
name: 'Mask',
26+
name: 'TourMask',
2727
props: {
2828
prefixCls: { type: String },
2929
pos: objectType<PosInfo>(), // 获取引导卡片指向的元素

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"lint:demo": "eslint --fix components/*/demo/*.vue",
5555
"lint:md": "eslint --fix *.md",
5656
"lint:script": "eslint . --ext '.js,.jsx,.ts,.tsx'",
57-
"lint:site": "eslint -c ./.eslintrc.js --fix --ext .jsx,.js,.ts,.tsx,vue ./site",
57+
"lint:site": "eslint --fix -c ./.eslintrc.js --ext .jsx,.js,.ts,.tsx,vue ./site",
5858
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
5959
"codecov": "codecov",
6060
"routes": "node site/scripts/genrateRoutes.js",

site/src/components/DemoBox.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export default defineComponent({
182182
type.value = type.value === 'TS' ? 'JS' : 'TS';
183183
};
184184
const handleCodeSandbox = () => {
185-
const code = codeRef.value!.innerText;
185+
const code = codeRef.value.innerText;
186186
const params = getCodeSandboxParams(code, {
187187
title: `${title.value} - ant-design-vue@${packageInfo.version}`,
188188
});

site/src/components/antdv-token-previewer/component-demos/menu/menu.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Demo = defineComponent({
1010
setup() {
1111
return () => {
1212
const onClick: MenuProps['onClick'] = e => {
13+
// eslint-disable-next-line no-console
1314
console.log('click ', e);
1415
};
1516

0 commit comments

Comments
 (0)