Browse Source

chore: update lit & format

pull/6917/head
tangjinzhou 1 year ago
parent
commit
31d00bf7d1
  1. 3
      .eslintignore
  2. 2
      antd-tools/getWebpackConfig.js
  3. 4
      antd-tools/gulpfile.js
  4. 2
      components/_util/supportsPassive.js
  5. 2
      components/_util/type.ts
  6. 6
      components/breadcrumb/BreadcrumbItem.tsx
  7. 2
      components/locale-provider/__tests__/index.test.js
  8. 2
      components/message/__tests__/index.test.js
  9. 6
      components/modal/useModal/index.tsx
  10. 2
      components/progress/Circle.tsx
  11. 2
      components/progress/Line.tsx
  12. 8
      components/statistic/Statistic.tsx
  13. 2
      components/typography/Base.tsx
  14. 2
      components/typography/__tests__/index.test.js
  15. 2
      components/vc-dialog/Content.tsx
  16. 2
      components/vc-dialog/Dialog.tsx
  17. 2
      components/vc-dialog/Mask.tsx
  18. 2
      components/vc-image/src/Image.tsx
  19. 2
      components/vc-picker/PickerPanel.tsx
  20. 2
      components/vc-progress/src/Line.tsx
  21. 8
      components/vc-select/BaseSelect.tsx
  22. 2
      components/vc-select/Select.tsx
  23. 2
      components/vc-select/Selector/Input.tsx
  24. 2
      components/vc-slick/track.jsx
  25. 2
      components/vc-slick/utils/innerSliderUtils.js
  26. 2
      components/vc-table/Body/index.tsx
  27. 2
      components/vc-table/Footer/Summary.tsx
  28. 2
      components/vc-table/Footer/index.tsx
  29. 2
      components/vc-table/Header/Header.tsx
  30. 2
      components/vc-table/Table.tsx
  31. 2
      components/vc-tooltip/src/Content.tsx
  32. 2
      components/vc-tour/Mask.tsx
  33. 2
      package.json
  34. 2
      site/src/components/DemoBox.vue
  35. 1
      site/src/components/antdv-token-previewer/component-demos/menu/menu.tsx
  36. 1
      site/src/components/antdv-token-previewer/component-demos/menu/menuDanger.tsx
  37. 1
      site/src/components/antdv-token-previewer/component-demos/modal/info.tsx
  38. 1
      site/src/components/antdv-token-previewer/component-demos/select/danger.tsx
  39. 1
      site/src/components/antdv-token-previewer/component-demos/select/icon.tsx
  40. 1
      site/src/components/antdv-token-previewer/component-demos/select/selectTag.tsx
  41. 1
      site/src/components/antdv-token-previewer/component-demos/select/warning.tsx
  42. 1
      site/src/components/antdv-token-previewer/component-demos/table/filterTable.tsx
  43. 2
      site/src/components/rice/CarbonAds.vue
  44. 2
      site/src/directives/clipboard/clipboard-action.js
  45. 4
      site/src/directives/clipboard/closest.js
  46. 4
      site/src/directives/clipboard/delegate.js
  47. 4
      site/src/directives/clipboard/is.js
  48. 6
      site/src/directives/clipboard/select.js
  49. 18
      site/src/directives/clipboard/tiny-emitter.js
  50. 2
      site/src/layouts/Demo.vue
  51. 2
      site/src/theme/template/IconDisplay/index.jsx
  52. 2
      site/typings.d.ts
  53. 1
      tsconfig.json

3
.eslintignore

@ -8,5 +8,6 @@ lib/
_site/
dist/
site/dist/
components/version/version.tsx
components/version/version.ts
site/src/router/demoRoutes.js
locale/

2
antd-tools/getWebpackConfig.js

@ -185,7 +185,7 @@ All rights reserved.
};
if (process.env.RUN_ENV === 'PRODUCTION') {
let entry = ['./index'];
const entry = ['./index'];
config.externals = [
{
vue: {

4
antd-tools/gulpfile.js

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

2
components/_util/supportsPassive.js

@ -1,7 +1,7 @@
// Test via a getter in the options object to see if the passive property is accessed
let supportsPassive = false;
try {
let opts = Object.defineProperty({}, 'passive', {
const opts = Object.defineProperty({}, 'passive', {
get() {
supportsPassive = true;
},

2
components/_util/type.ts

@ -31,6 +31,8 @@ export interface PropOptions<T = any, D = T> {
}
declare type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
// eslint-disable-next-line no-undef
export type VueNode = VNodeChildAtom | VNodeChildAtom[] | JSX.Element;
export const withInstall = <T>(comp: T) => {

6
components/breadcrumb/BreadcrumbItem.tsx

@ -8,7 +8,7 @@ import DownOutlined from '@ant-design/icons-vue/DownOutlined';
import useConfigInject from '../config-provider/hooks/useConfigInject';
import type { MouseEventHandler } from '../_util/EventInterface';
import { eventType, objectType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
import type { CustomSlotsType, VueNode } from '../_util/type';
export const breadcrumbItemProps = () => ({
prefixCls: String,
@ -38,7 +38,7 @@ export default defineComponent({
* if overlay is have
* Wrap a Dropdown
*/
const renderBreadcrumbNode = (breadcrumbItem: JSX.Element, prefixCls: string) => {
const renderBreadcrumbNode = (breadcrumbItem: VueNode, prefixCls: string) => {
const overlay = getPropsSlot(slots, props, 'overlay');
if (overlay) {
return (
@ -59,7 +59,7 @@ export default defineComponent({
const separator = getPropsSlot(slots, props, 'separator') ?? '/';
const children = getPropsSlot(slots, props);
const { class: cls, style, ...restAttrs } = attrs;
let link: JSX.Element;
let link: VueNode;
if (props.href !== undefined) {
link = (
<a class={`${prefixCls.value}-link`} onClick={handleClick} {...restAttrs}>

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

@ -206,7 +206,7 @@ describe('Locale Provider', () => {
return null;
},
};
for (let locale of locales) {
for (const locale of locales) {
document.body.innerHTML = '';
mount(
{

2
components/message/__tests__/index.test.js

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

6
components/modal/useModal/index.tsx

@ -12,15 +12,15 @@ import destroyFns from '../destroyFns';
let uuid = 0;
interface ElementsHolderRef {
addModal: (modal: () => JSX.Element) => () => void;
addModal: (modal: () => VueNode) => () => void;
}
const ElementsHolder = defineComponent({
name: 'ElementsHolder',
inheritAttrs: false,
setup(_, { expose }) {
const modals = shallowRef<(() => JSX.Element)[]>([]);
const addModal = (modal: () => JSX.Element) => {
const modals = shallowRef<(() => VueNode)[]>([]);
const addModal = (modal: () => VueNode) => {
modals.value.push(modal);
modals.value = modals.value.slice();
return () => {

2
components/progress/Circle.tsx

@ -23,7 +23,7 @@ const getMinPercent = (width: number): number => (CIRCLE_MIN_STROKE_WIDTH / widt
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Circle',
name: 'ProgressCircle',
inheritAttrs: false,
props: initDefaultProps(circleProps(), {
trailColor: null as unknown as string,

2
components/progress/Line.tsx

@ -72,7 +72,7 @@ export const handleGradient = (
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Line',
name: 'ProgressLine',
inheritAttrs: false,
props: lineProps(),
setup(props, { slots, attrs }) {

8
components/statistic/Statistic.tsx

@ -1,4 +1,4 @@
import type { CSSProperties, ExtractPropTypes, PropType, VNode } from 'vue';
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
import { defineComponent } from 'vue';
import initDefaultProps from '../_util/props-util/initDefaultProps';
import StatisticNumber from './Number';
@ -9,7 +9,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
// CSSINJS
import useStyle from './style';
import { anyType, booleanType, functionType, someType, vNodeType } from '../_util/type';
import type { CustomSlotsType } from '../_util/type';
import type { CustomSlotsType, VueNode } from '../_util/type';
export const statisticProps = () => ({
prefixCls: String,
@ -18,7 +18,7 @@ export const statisticProps = () => ({
format: String,
value: someType<valueType>([Number, String, Object]),
valueStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
valueRender: functionType<(node: VNode | JSX.Element) => VNode | JSX.Element>(),
valueRender: functionType<(node: VueNode) => VueNode>(),
formatter: anyType<Formatter>(),
precision: Number,
prefix: vNodeType(),
@ -60,7 +60,7 @@ export default defineComponent({
const formatter = props.formatter ?? (slots.formatter as unknown as Formatter);
// data-for-update just for update component
// https://github.com/vueComponent/ant-design-vue/pull/3170
let valueNode = (
let valueNode: VueNode = (
<StatisticNumber
data-for-update={Date.now()}
{...{ ...props, prefixCls: pre, value, formatter }}

2
components/typography/Base.tsx

@ -125,7 +125,7 @@ export const baseProps = () => ({
const Base = defineComponent({
compatConfig: { MODE: 3 },
name: 'Base',
name: 'TypographyBase',
inheritAttrs: false,
props: baseProps(),
// emits: ['update:content'],

2
components/typography/__tests__/index.test.js

@ -214,7 +214,7 @@ describe('Typography', () => {
});
describe('copyable', () => {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
function copyTest(name, text, target, icon) {
it(name, async () => {
jest.useFakeTimers();

2
components/vc-dialog/Content.tsx

@ -12,7 +12,7 @@ export type ContentRef = {
};
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Content',
name: 'DialogContent',
inheritAttrs: false,
props: {
...dialogPropTypes(),

2
components/vc-dialog/Dialog.tsx

@ -16,7 +16,7 @@ import { getMotionName, getUUID } from './util';
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Dialog',
name: 'VcDialog',
inheritAttrs: false,
props: initDefaultProps(
{

2
components/vc-dialog/Mask.tsx

@ -3,7 +3,7 @@ import Transition, { getTransitionProps } from '../_util/transition';
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Mask',
name: 'DialogMask',
props: {
prefixCls: String,
visible: Boolean,

2
components/vc-image/src/Image.tsx

@ -64,7 +64,7 @@ export const mergeDefaultValue = <T extends object>(obj: T, defaultValues: objec
let uuid = 0;
const ImageInternal = defineComponent({
compatConfig: { MODE: 3 },
name: 'Image',
name: 'VcImage',
inheritAttrs: false,
props: imageProps(),
emits: ['click', 'error'],

2
components/vc-picker/PickerPanel.tsx

@ -616,5 +616,5 @@ function PickerPanel<DateType>() {
});
}
const InterPickerPanel = PickerPanel<any>();
export default <DateType,>(props: MergedPickerPanelProps<DateType>): JSX.Element =>
export default <DateType,>(props: MergedPickerPanelProps<DateType>) =>
createVNode(InterPickerPanel, props);

2
components/vc-progress/src/Line.tsx

@ -6,7 +6,7 @@ import { propTypes } from './types';
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Line',
name: 'ProgressLine',
props: initDefaultProps(propTypes, defaultProps),
setup(props) {
const percentList = computed(() => {

8
components/vc-select/BaseSelect.tsx

@ -28,7 +28,7 @@ import {
watch,
watchEffect,
} from 'vue';
import type { CSSProperties, ExtractPropTypes, PropType, VNode } from 'vue';
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue';
import PropTypes from '../_util/vue-types';
import { initDefaultProps, isValidElement } from '../_util/props-util';
import isMobile from '../vc-util/isMobile';
@ -721,7 +721,7 @@ export default defineComponent({
// ============================= Arrow ==============================
const mergedShowArrow =
showArrow !== undefined ? showArrow : loading || (!multiple.value && mode !== 'combobox');
let arrowNode: VNode | JSX.Element;
let arrowNode: VueNode;
if (mergedShowArrow) {
arrowNode = (
@ -742,7 +742,7 @@ export default defineComponent({
}
// ============================= Clear ==============================
let clearNode: VNode | JSX.Element;
let clearNode: VueNode;
const onClearMouseDown: MouseEventHandler = () => {
onClear?.();
@ -851,7 +851,7 @@ export default defineComponent({
></SelectTrigger>
);
// >>> Render
let renderNode: VNode | JSX.Element;
let renderNode: VueNode;
// Render raw
if (customizeRawInputElement) {

2
components/vc-select/Select.tsx

@ -164,7 +164,7 @@ function isRawValue(value: DraftValueType): value is RawValueType {
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Select',
name: 'VcSelect',
inheritAttrs: false,
props: initDefaultProps(selectProps(), {
prefixCls: 'vc-select',

2
components/vc-select/Selector/Input.tsx

@ -42,7 +42,7 @@ export type InputProps = Partial<ExtractPropTypes<typeof inputProps>>;
const Input = defineComponent({
compatConfig: { MODE: 3 },
name: 'Input',
name: 'SelectInput',
inheritAttrs: false,
props: inputProps,
setup(props) {

2
components/vc-slick/track.jsx

@ -32,7 +32,7 @@ const getSlideClasses = spec => {
} else {
focusedSlide = spec.targetSlide;
}
let slickCurrent = index === focusedSlide;
const slickCurrent = index === focusedSlide;
return {
'slick-slide': true,
'slick-active': slickActive,

2
components/vc-slick/utils/innerSliderUtils.js

@ -461,7 +461,7 @@ export const swipeEnd = (e, spec) => {
onSwipe(swipeDirection);
}
let slideCount, newSlide;
let activeSlide = infinite ? currentSlide : targetSlide;
const activeSlide = infinite ? currentSlide : targetSlide;
switch (swipeDirection) {
case 'left':
case 'up':

2
components/vc-table/Body/index.tsx

@ -22,7 +22,7 @@ export interface BodyProps<RecordType> {
}
export default defineComponent<BodyProps<any>>({
name: 'Body',
name: 'TableBody',
props: [
'data',
'getRowKey',

2
components/vc-table/Footer/Summary.tsx

@ -7,7 +7,7 @@ export interface SummaryProps {
let indexGuid = 0;
const Summary = defineComponent<SummaryProps>({
name: 'Summary',
name: 'TableSummary',
props: ['fixed'] as any,
setup(props, { slots }) {
const tableContext = useInjectTable();

2
components/vc-table/Footer/index.tsx

@ -13,7 +13,7 @@ export interface FooterProps<RecordType = DefaultRecordType> {
}
export default defineComponent<FooterProps>({
name: 'Footer',
name: 'TableFooter',
inheritAttrs: false,
props: ['stickyOffsets', 'flattenColumns'] as any,
setup(props, { slots }) {

2
components/vc-table/Header/Header.tsx

@ -91,7 +91,7 @@ export interface HeaderProps<RecordType = DefaultRecordType> {
}
export default defineComponent<HeaderProps>({
name: 'Header',
name: 'TableHeader',
inheritAttrs: false,
props: ['columns', 'flattenColumns', 'stickyOffsets', 'customHeaderRow'] as any,
setup(props) {

2
components/vc-table/Table.tsx

@ -150,7 +150,7 @@ export interface TableProps<RecordType = DefaultRecordType> {
}
export default defineComponent<TableProps<DefaultRecordType>>({
name: 'Table',
name: 'VcTable',
inheritAttrs: false,
props: [
'prefixCls',

2
components/vc-tooltip/src/Content.tsx

@ -12,7 +12,7 @@ export type TooltipContentProps = Partial<ExtractPropTypes<typeof tooltipContent
export default defineComponent({
compatConfig: { MODE: 3 },
name: 'Content',
name: 'TooltipContent',
props: tooltipContentProps,
setup(props: TooltipContentProps, { slots }) {
return () => (

2
components/vc-tour/Mask.tsx

@ -23,7 +23,7 @@ export interface MaskProps {
zIndex?: number;
}
const Mask = defineComponent({
name: 'Mask',
name: 'TourMask',
props: {
prefixCls: { type: String },
pos: objectType<PosInfo>(), //

2
package.json

@ -54,7 +54,7 @@
"lint:demo": "eslint --fix components/*/demo/*.vue",
"lint:md": "eslint --fix *.md",
"lint:script": "eslint . --ext '.js,.jsx,.ts,.tsx'",
"lint:site": "eslint -c ./.eslintrc.js --fix --ext .jsx,.js,.ts,.tsx,vue ./site",
"lint:site": "eslint --fix -c ./.eslintrc.js --ext .jsx,.js,.ts,.tsx,vue ./site",
"lint:style": "stylelint \"{site,components}/**/*.less\" --syntax less",
"codecov": "codecov",
"routes": "node site/scripts/genrateRoutes.js",

2
site/src/components/DemoBox.vue

@ -182,7 +182,7 @@ export default defineComponent({
type.value = type.value === 'TS' ? 'JS' : 'TS';
};
const handleCodeSandbox = () => {
const code = codeRef.value!.innerText;
const code = codeRef.value.innerText;
const params = getCodeSandboxParams(code, {
title: `${title.value} - ant-design-vue@${packageInfo.version}`,
});

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

@ -10,6 +10,7 @@ const Demo = defineComponent({
setup() {
return () => {
const onClick: MenuProps['onClick'] = e => {
// eslint-disable-next-line no-console
console.log('click ', e);
};

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

@ -24,6 +24,7 @@ const items: MenuProps['items'] = [
const Demo = () => {
const onClick: MenuProps['onClick'] = e => {
// eslint-disable-next-line no-console
console.log('click ', e);
};

1
site/src/components/antdv-token-previewer/component-demos/modal/info.tsx

@ -15,6 +15,7 @@ const Demo = defineComponent({
</div>
),
onOk() {
// eslint-disable-next-line no-console
console.log('i am ok');
},
});

1
site/src/components/antdv-token-previewer/component-demos/select/danger.tsx

@ -6,6 +6,7 @@ import type { ComponentDemo } from '../../interface';
import options from './data';
const handleChange = (value: any) => {
// eslint-disable-next-line no-console
console.log(`selected ${value}`);
};

1
site/src/components/antdv-token-previewer/component-demos/select/icon.tsx

@ -6,6 +6,7 @@ import type { ComponentDemo } from '../../interface';
import options from './data';
const handleChange = (value: any) => {
// eslint-disable-next-line no-console
console.log(`selected ${value}`);
};

1
site/src/components/antdv-token-previewer/component-demos/select/selectTag.tsx

@ -6,6 +6,7 @@ import type { ComponentDemo } from '../../interface';
import options from './data';
const handleChange = (value: any) => {
// eslint-disable-next-line no-console
console.log(`selected ${value}`);
};

1
site/src/components/antdv-token-previewer/component-demos/select/warning.tsx

@ -6,6 +6,7 @@ import type { ComponentDemo } from '../../interface';
import options from './data';
const handleChange = (value: any) => {
// eslint-disable-next-line no-console
console.log(`selected ${value}`);
};

1
site/src/components/antdv-token-previewer/component-demos/table/filterTable.tsx

@ -90,6 +90,7 @@ const data = [
];
const onChange: TableProps<TableData>['onChange'] = (pagination, filters, sorter, extra) => {
// eslint-disable-next-line no-console
console.log('params', pagination, filters, sorter, extra);
};

2
site/src/components/rice/CarbonAds.vue

@ -19,7 +19,7 @@ export default {
},
watch: {
$route(e, t) {
let adId = '#carbonads';
const adId = '#carbonads';
// if(isGitee) {
// adId = '#cf';
// }

2
site/src/directives/clipboard/clipboard-action.js

@ -63,7 +63,7 @@ class ClipboardAction {
this.fakeElem.style.position = 'absolute';
this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
// Move element to the same position vertically
let yPosition = window.pageYOffset || document.documentElement.scrollTop;
const yPosition = window.pageYOffset || document.documentElement.scrollTop;
this.fakeElem.style.top = `${yPosition}px`;
this.fakeElem.setAttribute('readonly', '');

4
site/src/directives/clipboard/closest.js

@ -1,10 +1,10 @@
let DOCUMENT_NODE_TYPE = 9;
const DOCUMENT_NODE_TYPE = 9;
/**
* A polyfill for Element.matches()
*/
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
let proto = Element.prototype;
const proto = Element.prototype;
proto.matches =
proto.matchesSelector ||

4
site/src/directives/clipboard/delegate.js

@ -1,3 +1,5 @@
/* eslint-disable prefer-spread */
/* eslint-disable prefer-rest-params */
import closest from './closest';
/**
@ -11,7 +13,7 @@ import closest from './closest';
* @return {Object}
*/
function _delegate(element, selector, type, callback, useCapture) {
let listenerFn = listener.apply(this, arguments);
const listenerFn = listener.apply(this, arguments);
element.addEventListener(type, listenerFn, useCapture);

4
site/src/directives/clipboard/is.js

@ -15,7 +15,7 @@ export const node = function (value) {
* @return {Boolean}
*/
export const nodeList = function (value) {
let type = Object.prototype.toString.call(value);
const type = Object.prototype.toString.call(value);
return (
value !== undefined &&
@ -42,7 +42,7 @@ export const string = function (value) {
* @return {Boolean}
*/
export const fn = function (value) {
let type = Object.prototype.toString.call(value);
const type = Object.prototype.toString.call(value);
return type === '[object Function]';
};

6
site/src/directives/clipboard/select.js

@ -6,7 +6,7 @@ function select(element) {
selectedText = element.value;
} else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
let isReadOnly = element.hasAttribute('readonly');
const isReadOnly = element.hasAttribute('readonly');
if (!isReadOnly) {
element.setAttribute('readonly', '');
@ -25,8 +25,8 @@ function select(element) {
element.focus();
}
let selection = window.getSelection();
let range = document.createRange();
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();

18
site/src/directives/clipboard/tiny-emitter.js

@ -1,3 +1,4 @@
/* eslint-disable prefer-rest-params */
function E() {
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
@ -5,7 +6,7 @@ function E() {
E.prototype = {
on(name, callback, ctx) {
let e = this.e || (this.e = {});
const e = this.e || (this.e = {});
(e[name] || (e[name] = [])).push({
fn: callback,
@ -16,7 +17,8 @@ E.prototype = {
},
once(name, callback, ctx) {
let self = this;
// eslint-disable-next-line @typescript-eslint/no-this-alias
const self = this;
function listener() {
self.off(name, listener);
callback.apply(ctx, arguments);
@ -27,10 +29,10 @@ E.prototype = {
},
emit(name) {
let data = [].slice.call(arguments, 1);
let evtArr = ((this.e || (this.e = {}))[name] || []).slice();
const data = [].slice.call(arguments, 1);
const evtArr = ((this.e || (this.e = {}))[name] || []).slice();
let i = 0;
let len = evtArr.length;
const len = evtArr.length;
for (i; i < len; i++) {
evtArr[i].fn.apply(evtArr[i].ctx, data);
@ -40,9 +42,9 @@ E.prototype = {
},
off(name, callback) {
let e = this.e || (this.e = {});
let evts = e[name];
let liveEvents = [];
const e = this.e || (this.e = {});
const evts = e[name];
const liveEvents = [];
if (evts && callback) {
for (let i = 0, len = evts.length; i < len; i++) {

2
site/src/layouts/Demo.vue

@ -13,7 +13,7 @@
<slot />
<!-- <GoogleAds v-if="showAd" :key="`goo-${route.path}`" /> -->
<section class="markdown api-container" v-html="api"></section>
<Contributor :isZn="isZhCN" />
<Contributor :is-zn="isZhCN" />
</article>
</template>
<script lang="ts">

2
site/src/theme/template/IconDisplay/index.jsx

@ -40,7 +40,7 @@ const IconDisplay = defineComponent({
return Object.keys(categories)
.map(key => {
let iconList = categories[key];
const iconList = categories[key];
return {
category: key,

2
site/typings.d.ts vendored

@ -1,7 +1,7 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue';
// eslint-disable-next-line @typescript-eslint/ban-types
const component: DefineComponent<any, any, any> & { readonly pageDate?: PageData };
const component: DefineComponent<any, any, any>;
export default component;
}

1
tsconfig.json

@ -13,6 +13,7 @@
"esModuleInterop": true,
"experimentalDecorators": true,
"jsx": "preserve",
"jsxImportSource": "vue",
"noUnusedParameters": true,
"noUnusedLocals": true,
"noImplicitAny": false,

Loading…
Cancel
Save