-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add an option to specify different rules inside a markdown file #170
Comments
Are you able to use |
Sure, but that doesn't address the underlining issue: I'd still want to have the option to specify different set of overrides for a same language. Ignoring those meta strings may be fine for some people, but I think it can be a very useful feature for others. If we want to make a breaking change, I think now (I.E. before v2 is released) would be the right time as folks upgrading to v2 are going too have to rewrite their ESLint configuration anyway. |
While I agree switching functionality based on the meta string is neat, there'd need to be some important use case for which that route is the only option. One downside is that it claims exclusive use of the meta string. What if there are other tools that want to use it as well? Let's step back from the specific implementation idea. What use case are you trying to achieve?
v2 was already a release candidate when you opened this issue, so any breaking change would have to wait for a hypothetical v3. |
I'm not sure that's true, you can easily configure the plugin to ignore it – in the implementation I made in #172 at least: "files": [
"**/*.{md,mkdn,mdown,markdown}/*.{js,javascript,jsx,node}",
"**/*.{md,mkdn,mdown,markdown}/*.{js,javascript,jsx,node}:*"
] It's too bad ESLint doesn't allow users to pass a
I'm working on this PR: #172
Hum OK I didn't realize v2 was already feature frozen. I still think it would still be a neat feature to have, so maybe for later? |
It sounds like the ideal fix is for |
Yep that works indeed.
… Le 1 mai 2021 à 05:28, Brandon Mills ***@***.***> a écrit :
the current rules on that repo forbid to use cjs or mjs as language descriptor (warning Incorrect code language flag fenced-code-flag remark-lint)
It sounds like the ideal fix is for remark-lint to allow cjs and mjs in info strings, and this change would be a workaround for that solution. Are you able to configure remark-lint that way, and if so, does that solve your use case for now?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Great! Closing since this has been solved. |
I'm trying to set up a rule set that is able to discriminate between ESM examples and CJS code snippets inside the markdown documentation:
The issue is that only the
js
is passed throughunfied
lang
data, and the part after the space is pass to themeta
option:I wish there was a way to create separate rules for those blocks, something like:
EDIT: I'm using
remark-parse
9.0.0, themeta
property doesn't seem to be available inremark-parse
5.x this repo is using.The text was updated successfully, but these errors were encountered: