-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with ESM #61
Comments
Thank you, I'll take a look soon. So |
@wooorm Hi, I need help here. Is that possible to use |
@ybiquitous Please try the following version for testing: yarn add https://pkg.csb.dev/JounQin/remark-preset-prettier/commit/45ec5d24/remark-preset-prettier
npm i https://pkg.csb.dev/JounQin/remark-preset-prettier/commit/45ec5d24/remark-preset-prettier Although I don't think this is the perfect solution because it may install unexpected |
No, the configuration stage is sync. This is a similar issue to: remarkjs/remark-retext#14.
Yes. But: you could use But I think importing the plugins you want to turn off might be best |
@JounQin Thanks. The version works expectedly! 👍🏼 |
I'm using But
As I say:
For end users not using latest |
Yes. Updating dependencies and publishing a major version would solve that though? |
Well, if there is no better way to fix this, I have to do like that. 😂 Although I still hope there will be better solution like remarkjs/remark-retext#14 or supporting |
Well, top-level await is supported in Node 14 and 16? |
@ybiquitous I've just released |
@JounQin Thank you so much for the quick fix! I can confirm the new version |
@wooorm As https://github.com/stylelint/remark-preset/pull/6/files#diff-4cfcf9277f6a14080f988dbe6158fedb46b1049c56bc815e42a2736e0b215c70R6, I found export default {
plugins: [['non-existed-dep', false]],
} Is this valid? If so, I can still remove all |
Strings are supported in configuration files of the unified engine (so in |
Do you mean @ybiquitous's changes https://github.com/stylelint/remark-preset/pull/6/files#diff-4cfcf9277f6a14080f988dbe6158fedb46b1049c56bc815e42a2736e0b215c70R6 is incorrect actually? But I tried like following and it does work: export default {
plugins: [
'preset-lint-consistent',
'preset-lint-markdown-style-guide',
'preset-lint-recommended',
'./lib/index.js',
],
} Is there anything I missed? |
No, that change is good. Because it’s in a Your change is not good, as it is not in a |
|
Then that change is incorrect: it does not work |
cc @ybiquitous I have an idea to create a package named Maybe Will string config contains string plugins in {
"plugins": ["@stylelint/remark-preset"]
} |
Only one rc file is allowed. They can be shared (put in However, I strongly recommend against that. Presets work on the API. Can be bundled in a browser. Config files and strings don’t
That works in an rc file. It does not work in a preset |
I'm still not sure to understand, I mean if // .remarkrc
{
"plugins": ["@stylelint/remark-preset"]
}
I understand that, I'm talking another package which maybe only aim to |
No, I don’t think it will work. That PR is I believe broken.
I’m not sure how it could be used. It could not be combined with other presets. It just turns stuff off. So why not use no rc file at all? |
OK, if it does not work, I was thinking the usage: {
"plugins": [
// ... othere presets
"config-prettier" // It just turns stuff off for prettier.
]
} |
@JounQin @wooorm Thanks again! We were able to release |
Hi! Thank you for providing this nice preset!
I found a behavior that this preset is not work with ESM. It occurs with the latest version
remark-preset-prettier@0.5.1
.Let me show for the details.
Reproduction
Prepare the following files.
package.json
:.remarkrc.js
:test.md
:Run:
I expect no warnings, but 2 warnings are detected.
When I inspected
node_modules/remark-preset-prettier/lib/index.js
, I found an ignored exception (_a
) at line 43:This ignored exception's message is something like:
Maybe, this exception is related to this behavior. 🤔
Environment
If the reproduction above or my understandings are incorrect, please feel free to tell me or close this issue.
Thank you.
The text was updated successfully, but these errors were encountered: