From f2e541ade5ad62e74842202c3473165363a24e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=97=E4=BD=A0=E6=98=AF=E5=B0=8F=E7=8C=AB=E5=92=AA?= Date: Thu, 17 Oct 2019 10:24:34 +0800 Subject: [PATCH] refactor: improve typescript module declare (#19254) * refactor: improve typescript declare * remove rc-progress declare * remove rc-drawer declare * improve site antd module resolve path --- package.json | 1 + tsconfig.json | 5 +++++ tslint.json | 3 --- typings/custom-typings.d.ts | 8 -------- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 tslint.json diff --git a/package.json b/package.json index ae234a6823a9..3120e4607e01 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "@types/raf": "^3.4.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.8.4", + "@types/react-lifecycles-compat": "^3.0.1", "@types/shallowequal": "^1.1.1", "@types/warning": "^3.0.0", "@typescript-eslint/eslint-plugin": "^2.0.0", diff --git a/tsconfig.json b/tsconfig.json index 40f34f5992fa..850ce0de1772 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,10 @@ { "compilerOptions": { + "baseUrl": "./", + "paths": { + "antd": ["components/index.tsx"], + "antd/es/*": ["components/*"] + }, "strictNullChecks": true, "moduleResolution": "node", "esModuleInterop": true, diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 1b61109a6932..000000000000 --- a/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["./node_modules/@ant-design/tools/lib/tslint.json"] -} diff --git a/typings/custom-typings.d.ts b/typings/custom-typings.d.ts index fc2e3f0ee1ec..8dc168a5fb0f 100644 --- a/typings/custom-typings.d.ts +++ b/typings/custom-typings.d.ts @@ -20,16 +20,10 @@ declare module 'rc-cascader'; declare module 'rc-checkbox'; -declare module 'rc-radio'; - declare module 'rc-dropdown'; declare module 'rc-editor-mention'; -declare module 'rc-progress'; - -declare module 'rc-drawer'; - declare module 'rc-tabs*'; declare module 'rc-tree'; @@ -81,6 +75,4 @@ declare module '*.json' { export default value; } -declare module 'react-lifecycles-compat'; - declare module 'react-copy-to-clipboard';