-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: formatting YAML properties and exporting a cjs build #12
base: main
Are you sure you want to change the base?
Conversation
This PR depends on nuxtlabs/monarch-mdc#12 to export a cjs build in order to consume the formatter from a single source of truth.
Fix formatting YAML props in nested block components. Output a CommonJS module in addition to ESM, primarily for utilizing the formatter function in @nuxtlabs/vscode-mdc.
b0e4c0b
to
4e2b080
Compare
@farnabaz anything else I can do for this PR? I’d like to pick up the formatting fix in my downstream repo |
Thanks @adamdehaven and sorry for keeping you waiting I checked the changes and it LGTM. My main concern however is to define a standard spec for formatting. Soon we will have a linter (it is WIP) and we should use the same spec for both. Besides these two we should respect the standard markdown spec which is supported by lots of libraries, linters, and formatters. This way we provide consistency between tools. Before merging: I'll add some tests to check the formatted markdown with markdownlint and ideally some tests with Prettier for basic markdown usage. |
My only concern here is that Prettier itself is opinionated and oftentimes conflicts with other lint rules, e.g. ESLint |
@adamdehaven With my latest commit, are you happy with removing |
@farnabaz yep works for me! |
Fixes
Refactor
getDocumentFoldingRanges
functionChore
unbuild
config to a file (for readability).I'm utilizing the exported
formatter
andgetDocumentFoldingRanges
functions in nuxtlabs/vscode-mdc#41 in order to source the MDC formatting and folding logic from a single source of truth rather than replicating the code there.The
formatter
function should remain "unbound" to the monarch (or textmate) language, as it can be used standalone as a utility for properly formatting MDC strings in any downstream project.