-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Implement overrides similar to ESLint #56
Comments
|
I don’t know. Perhaps we should have a look at how ESLint handles it.
I think const retextPlugins = [
[someRetextPlugin]
]
export default {
plugins: [
['remark-retext', unified().use(retextPlugins)]
],
overrides: [
files: ['*.mdx'],
plugins: [
['remark-retext', unified().use([...retextPlugins, anotherRetextPlugin])]
],
]
} |
I think this point won’t need any special handling. It’ll just work.
I’m not so sure. One even bigger problem I didn’t think of: config files are also presets. 😬 Config files and presets can be loaded from say |
I no longer think this can go somewhere. Configs are presets. Except that strings are allowed instead of functions. Presets (and config) are applied to It would mean things are loaded, such as That may not be so bad for a CLI. But is more bad in things like One way to sidestep that is to diverge further, between config files and presets. To allow Practical suggestions for the examples in the OP:
Markdown vs MDX is one axis, but there are many more. Think files that are “partials”—to be imported into others. I think different config files can work here.
Then use a config file that extends.
Same, either put the email templates in a folder. Or: use a comment in particular files. |
Initial checklist
Problem
Sometimes certain checks depend on context, not just language.
For example, typically markdown documents need to contain complete and valid markdown documents. Some specific documents may need some specific checks to be included or excluded though. For example:
Solution
ESLint has pretty much the exact problem. They solved it using
overrides
The same could be done for
unified-engine
. For example:ESLint also uses the globs to determine additional file extensions to check.
Alternatives
I can’t really think of anything else
The text was updated successfully, but these errors were encountered: