Closed chenxsan closed 4 years ago
@wooorm Indeed, It works fine with npm while Cannot find module 'eslint-plugin-prettier'
with yarn.
I've two problems now:
TypeError: Cannot read property 'keyword' of undefined
:It might be caused by jsdoc.js
using typescript
loaded after it. (Found an issue here https://github.com/wooorm/refractor/issues/7)
I've pushed another commit to fix the first issue according to https://github.com/wooorm/refractor/commit/c7f8b5d6f76e44f571fd498da616bd62517762cc, but I found the code would be overwritten if we run npm test
again which means the CI will always fail.
Code is generated, here is where dependencies are detected with Babel: https://github.com/wooorm/refractor/blob/main/script/languages.js#L123
Fixtures are by hand indeed, see here for a couple of lines you can comment out to regenerate: https://github.com/wooorm/refractor/blob/54d22680ceab1abb5f124c82e92135daf33ff37d/test/index.js#L261
I found the languages.js
file uses regular expressions to get the deps
, I'm wondering whether we can read its value from prismjs/components.json
where they have this require
attribute? I've pushed a new commit here https://github.com/wooorm/refractor/pull/32/commits/89421624632a2ce2cd70df527fda2dbc632adc25. As you can see it changed a lot of code, would love to hear your thought about it.
Oh nice! That as 't there when I originally made refractor. For your commit, you should remove the defaults: https://github.com/wooorm/refractor/blob/main/script/bundled.json
Both script/list.js
and script/support.js
depends on bundled.json
, so I can't remove it naively.
I’m sorry that my comment was unclear! I meant: you can use the bundled file, to remove stuff. For example, JavaScript requires are not needed: https://github.com/wooorm/refractor/pull/32/files#diff-a067b044e29ecf0bf62f582853f9b9d6R2, because they are already registered! I think that’s the main reason for your earlier comment: “As you can see it changed a lot of code, would love to hear your thought about it.”
@wooorm It's me misunderstood your comment. I've pushed a new commit, hope it's right this time :)
Thanks! Released in 3.1.0! ✨
Thanks. Do you need help with this? Btw, the error about eslint-plugin-prettier does not occur when using npm I believe?