From 605c6e704132e4ab3bd09ae51ae9a3a8cda49bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Thu, 26 Dec 2024 19:41:22 +0100 Subject: [PATCH] use tsc for types because that works ig --- .eslintrc.js | 7 +++++++ example/tsconfig.json | 10 ++++++++++ package.json | 2 +- tsconfig.json | 4 ++-- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 example/tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index a16fac8..b614cc4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -28,5 +28,12 @@ module.exports = { project: './tsconfig.json', }, }, + { + files: ['example/**/*.ts', 'example/**/*.tsx'], + extends: ['airbnb-typescript'], + parserOptions: { + project: './example/tsconfig.json', + }, + }, ], }; diff --git a/example/tsconfig.json b/example/tsconfig.json new file mode 100644 index 0000000..43d8a90 --- /dev/null +++ b/example/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "lib": ["dom", "es2020"], + "jsx": "react-jsx", + "noEmit": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["*.tsx", "*.ts"] +} diff --git a/package.json b/package.json index 3bd5c4a..a548157 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "url": "git+https://github.com/u-wave/react-youtube.git" }, "scripts": { - "build": "tsup src/index.tsx --format esm,cjs --experimental-dts", + "build": "tsup src/index.tsx --format esm,cjs && tsc --declaration --emitDeclarationOnly -p .", "docs": "prop-types-table src/index.js | md-insert README.md --header Props -i", "example": "npm run --prefix example start", "browserslist": "npx browserslist --mobile-to-desktop '> 0.5%, last 2 versions, Firefox ESR, not dead, not IE 11' > .browserslistrc", diff --git a/tsconfig.json b/tsconfig.json index 56997d7..b8bfeb6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "lib": ["dom", "es2020"], - "noEmit": true, "jsx": "react-jsx", + "outDir": "dist", "esModuleInterop": true, "skipLibCheck": true }, - "include": ["src/*.tsx", "src/*.ts", "example/*.tsx"] + "include": ["src/*.tsx", "src/*.ts"] }