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"] }