Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
new JSX transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Stover committed Dec 17, 2020
1 parent 6482f8e commit 6a0ce2f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

"rules": {
"prettier/prettier": "error",
"react/jsx-uses-react": "off",
"react/prop-types": ["error", { "skipUndeclared": true }],
"react/react-in-jsx-scope": "off",
"react-hooks/exhaustive-deps": "error",
"react-hooks/rules-of-hooks": "error",
"sort-imports": ["error", { "ignoreDeclarationSort": true }]
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"scripts": {
"build": "rollup --config",
"clean": "rm -rf dist jest node_modules package-lock.json yarn.lock",
"eslint": "eslint",
"jest": "jest",
"start": "rollup --config --watch",
Expand Down Expand Up @@ -66,7 +65,7 @@
"rollup-plugin-typescript2": "^0.29.0",
"ts-jest": "^26.0.0",
"tslib": "^2.0.0",
"typescript": "^4.0.0"
"typescript": "^4.1.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0",
Expand Down
14 changes: 7 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ import postcss from 'rollup-plugin-postcss';
import typescript2 from 'rollup-plugin-typescript2';
import packageJson from './package.json';

const EXTERNAL = new Set([
...Object.keys(packageJson.dependencies),
...Object.keys(packageJson.peerDependencies),
]);

const IS_DEV = process.env.NODE_ENV === 'development';

const MAIN_DIR = path.parse(packageJson.main).dir;

const MODULE_DIR = path.parse(packageJson.module).dir;
const TSCONFIG = IS_DEV ? './tsconfig.development.json' : './tsconfig.json';

const EXTERNAL = new Set([
...Object.keys(packageJson.dependencies || Object.create(null)),
...Object.keys(packageJson.peerDependencies || Object.create(null)),
]);

export default [
{
Expand Down Expand Up @@ -83,6 +82,7 @@ export default [
}),
typescript2({
check: !IS_DEV,
tsconfig: TSCONFIG,
useTsconfigDeclarationDir: true,
}),
],
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"jsx": "react-jsxdev"
},
"extends": "./tsconfig.json"
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"incremental": false,
"inlineSourceMap": false,
"isolatedModules": false,
"jsx": "react",
"jsx": "react-jsx",
"lib": ["DOM", "ESNext"],
"module": "ESNext",
"moduleResolution": "node",
Expand Down

0 comments on commit 6a0ce2f

Please sign in to comment.