Skip to content

Commit e1e71ac

Browse files
committed
add ts as peer dep
1 parent 6bf6320 commit e1e71ac

File tree

3 files changed

+65
-22
lines changed

3 files changed

+65
-22
lines changed

package-lock.json

Lines changed: 56 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"README.md"
1616
],
1717
"peerDependencies": {
18-
"rollup": "^1.20.0 || ^2.0.0"
18+
"rollup": "^1.20.0 || ^2.0.0",
19+
"typescript": "^5.5.4"
1920
},
2021
"devDependencies": {
2122
"rollup": "^2.23.0"
@@ -41,6 +42,7 @@
4142
"magic-string": "^0.25.7"
4243
},
4344
"prettier": {
44-
"useTabs": false
45+
"useTabs": false,
46+
"singleQuote": true
4547
}
4648
}

src/index.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,12 @@ export default function afterEffectsJsx(options = { wrap: false }) {
111111
.prepend('function get() {\n')
112112
.append(`\nreturn {${exports.join(',\n\t')}}\n}`);
113113

114-
// see extra `format` fn below!
115-
116-
// const asString = format(magicString.toString()).replace(
117-
// `function get() {`,
118-
// `get() {`
119-
// );
114+
const asString = format(magicString.toString()).replace(
115+
`function get() {`,
116+
`get() {`
117+
);
120118

121-
// magicString = new MagicString(asString);
119+
magicString = new MagicString(asString);
122120
} else {
123121
// Remove non exported nodes and convert
124122
// to object property style compatible syntax
@@ -195,7 +193,6 @@ export default function afterEffectsJsx(options = { wrap: false }) {
195193
};
196194
}
197195

198-
199196
// extra: use ts to format... though currently not a dep of `rollup-plugin-ae-jsx`
200197

201198
// https://github.com/vvakame/typescript-formatter/tree/master/lib
@@ -263,4 +260,3 @@ function format(text, fileName = 'temp.ts', options = defaultOptions) {
263260

264261
return text;
265262
}
266-

0 commit comments

Comments
 (0)