From 17fee4b3f927ea0a42bc992706a457b5ac8a198a Mon Sep 17 00:00:00 2001 From: Mitchell Hamilton Date: Tue, 19 Apr 2022 18:47:42 +1000 Subject: [PATCH] Fix some TS things (#2559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Point to package root rather than src so that the declarations are used when published, not the src * Don't use as const for unitless * Make tsc pass * Add tsc to CI * Remove type aware linting * Remove ESLint from DTSLint CI job * Newline * Fix more things Co-authored-by: Mateusz BurzyƄski --- .github/workflows/main.yml | 2 -- package.json | 3 --- packages/css/types/index.d.ts | 2 ++ packages/hash/types/index.d.ts | 2 +- packages/is-prop-valid/types/index.d.ts | 2 +- packages/memoize/types/index.d.ts | 2 +- packages/sheet/types/index.d.ts | 4 +++- packages/unitless/src/index.ts | 4 ++-- packages/utils/types/index.d.ts | 4 +++- packages/weak-memoize/types/index.d.ts | 2 +- tsconfig.json | 11 +++++++++-- 11 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9dde2ec8..f9a297542 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -222,7 +222,5 @@ jobs: - name: Install Dependencies run: yarn - - name: ESLint - run: yarn lint:check - name: TypeScript run: cd packages/${{ matrix.package }} && yarn test:typescript diff --git a/package.json b/package.json index 0450bcecf..341b90025 100644 --- a/package.json +++ b/package.json @@ -97,9 +97,6 @@ "**/packages/**/*.ts", "**/packages/**/*.tsx" ], - "parserOptions": { - "project": "./tsconfig.json" - }, "rules": { "prettier/prettier": [ "error", diff --git a/packages/css/types/index.d.ts b/packages/css/types/index.d.ts index 546becea7..23f9a3c26 100644 --- a/packages/css/types/index.d.ts +++ b/packages/css/types/index.d.ts @@ -1 +1,3 @@ +/// + export * from '..' diff --git a/packages/hash/types/index.d.ts b/packages/hash/types/index.d.ts index f53a5aecd..2c736dff8 100644 --- a/packages/hash/types/index.d.ts +++ b/packages/hash/types/index.d.ts @@ -1 +1 @@ -export { default } from '../src' +export { default } from '..' diff --git a/packages/is-prop-valid/types/index.d.ts b/packages/is-prop-valid/types/index.d.ts index ad44a5b20..5f85d28f6 100644 --- a/packages/is-prop-valid/types/index.d.ts +++ b/packages/is-prop-valid/types/index.d.ts @@ -1,3 +1,3 @@ // TypeScript Version: 2.1 -export { default } from '../src' +export { default } from '..' diff --git a/packages/memoize/types/index.d.ts b/packages/memoize/types/index.d.ts index f53a5aecd..2c736dff8 100644 --- a/packages/memoize/types/index.d.ts +++ b/packages/memoize/types/index.d.ts @@ -1 +1 @@ -export { default } from '../src' +export { default } from '..' diff --git a/packages/sheet/types/index.d.ts b/packages/sheet/types/index.d.ts index f9a531dca..bfaefa68e 100644 --- a/packages/sheet/types/index.d.ts +++ b/packages/sheet/types/index.d.ts @@ -1,3 +1,5 @@ // TypeScript Version: 2.0 -export * from '../src' +/// + +export * from '..' diff --git a/packages/unitless/src/index.ts b/packages/unitless/src/index.ts index 4f1aef669..084ec9289 100644 --- a/packages/unitless/src/index.ts +++ b/packages/unitless/src/index.ts @@ -1,4 +1,4 @@ -let unitlessKeys = { +let unitlessKeys: Record = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, @@ -46,6 +46,6 @@ let unitlessKeys = { strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 -} as const +} export default unitlessKeys diff --git a/packages/utils/types/index.d.ts b/packages/utils/types/index.d.ts index 4a7b205c2..d0d62d34a 100644 --- a/packages/utils/types/index.d.ts +++ b/packages/utils/types/index.d.ts @@ -1,3 +1,5 @@ // TypeScript Version: 2.2 -export * from '../src' +/// + +export * from '..' diff --git a/packages/weak-memoize/types/index.d.ts b/packages/weak-memoize/types/index.d.ts index 12f6194ac..91fafac0b 100644 --- a/packages/weak-memoize/types/index.d.ts +++ b/packages/weak-memoize/types/index.d.ts @@ -1,3 +1,3 @@ // TypeScript Version: 2.2 -export { default } from '../src' +export { default } from '..' diff --git a/tsconfig.json b/tsconfig.json index f084e9804..b955ce77e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,18 @@ "lib": ["es6", "dom"], "module": "commonjs", "noEmit": true, + "skipLibCheck": true, "skipDefaultLibCheck": true, "resolveJsonModule": true, "strict": true, - "target": "es5" + "target": "es5", + "types": [] }, "include": ["packages", "scripts", "site", "test", "playgrounds"], - "exclude": ["node_modules", "packages/*/types/test/*"] + "exclude": [ + "node_modules", + "packages/*/types/test/*", + "packages/*/types/test*", + "packages/native" + ] }