From 2fd04595bfff128c79169e16add17f499b6b4dfa Mon Sep 17 00:00:00 2001 From: Amour1688 Date: Thu, 1 Oct 2020 20:57:03 +0800 Subject: [PATCH] fix: ts error --- components/_util/classNames.ts | 2 +- components/_util/vue-types/index.ts | 12 +++++++----- .../modal/{ActionButton.tsx => ActionButton.jsx} | 0 .../modal/{ConfirmDialog.tsx => ConfirmDialog.jsx} | 0 components/modal/{Modal.tsx => Modal.jsx} | 0 components/modal/{confirm.tsx => confirm.jsx} | 0 components/modal/{index.tsx => index.jsx} | 0 examples/App.tsx | 9 +++++++++ tsconfig.json | 2 +- 9 files changed, 18 insertions(+), 7 deletions(-) rename components/modal/{ActionButton.tsx => ActionButton.jsx} (100%) rename components/modal/{ConfirmDialog.tsx => ConfirmDialog.jsx} (100%) rename components/modal/{Modal.tsx => Modal.jsx} (100%) rename components/modal/{confirm.tsx => confirm.jsx} (100%) rename components/modal/{index.tsx => index.jsx} (100%) create mode 100644 examples/App.tsx diff --git a/components/_util/classNames.ts b/components/_util/classNames.ts index 310700c9d..d20fa9cc2 100644 --- a/components/_util/classNames.ts +++ b/components/_util/classNames.ts @@ -16,7 +16,7 @@ export type ClassValue = | boolean; function classNames(...args: ClassValue[]): string { - const classes = []; + const classes: string[] = []; for (let i = 0; i < args.length; i++) { const value = args[i]; if (!value) { diff --git a/components/_util/vue-types/index.ts b/components/_util/vue-types/index.ts index 04533b9cd..5248734a2 100644 --- a/components/_util/vue-types/index.ts +++ b/components/_util/vue-types/index.ts @@ -1,11 +1,13 @@ import { PropType } from 'vue'; import isPlainObject from 'lodash-es/isPlainObject'; import { toType, getType, isFunction, validateType, isInteger, isArray, warn } from './utils'; -interface BaseTypes { - type: any; - def: Function; - validator: Function; -} + +// interface BaseTypes { +// type: any; +// def: Function; +// validator: Function; +// } + const PropTypes = { get any() { return toType('any', { diff --git a/components/modal/ActionButton.tsx b/components/modal/ActionButton.jsx similarity index 100% rename from components/modal/ActionButton.tsx rename to components/modal/ActionButton.jsx diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.jsx similarity index 100% rename from components/modal/ConfirmDialog.tsx rename to components/modal/ConfirmDialog.jsx diff --git a/components/modal/Modal.tsx b/components/modal/Modal.jsx similarity index 100% rename from components/modal/Modal.tsx rename to components/modal/Modal.jsx diff --git a/components/modal/confirm.tsx b/components/modal/confirm.jsx similarity index 100% rename from components/modal/confirm.tsx rename to components/modal/confirm.jsx diff --git a/components/modal/index.tsx b/components/modal/index.jsx similarity index 100% rename from components/modal/index.tsx rename to components/modal/index.jsx diff --git a/examples/App.tsx b/examples/App.tsx new file mode 100644 index 000000000..a9f17de90 --- /dev/null +++ b/examples/App.tsx @@ -0,0 +1,9 @@ +import { defaultTo } from 'lodash-es'; +import Empty from '../components/empty'; +import '../components/empty/style'; + +export default { + render() { + return ; + }, +}; diff --git a/tsconfig.json b/tsconfig.json index a3eed429e..bc32c5bde 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "jsx": "preserve", "noUnusedParameters": true, "noUnusedLocals": true, - "noImplicitAny": true, + "noImplicitAny": false, "target": "es6", "lib": ["dom", "es2017"], "skipLibCheck": true