You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only problem is that MJS file are not loaded by cosmic config.
It's blocking because all the unified eco-system is going 100% ESM, so we cannot convert our remark.mjs to a older remark.js or CJS:
// NOTE: ESLint loads remarkrc via cosmic config which doesn't support `.mjs`module.exports={plugins: [require('remark-frontmatter'),[require('remark-lint-frontmatter-schema'),{schemas: {'content/articles/schemas/main.mdx.schema.yaml': ['content/articles/**/main.mdx',],},},],],};
Expected behavior
Load MJS (optional: or even ts/mts?), like the remark lint cli / VS Code extension does.
Actual behavior
Mismatch between remark lint config when using MD versus MDX.
Side note:
Frontmatter schema plugin is incidentally working via remark cli but not the extension (this is normal, it doesn't parse the MD itself, just the frontmatter). But unfortunately I can't use this "bug" as a feature ;)
Maybe I'm missing something?
I could go with YAML / JSON configs maybe to circumvent those issues ? I admit it is not really an option as I need JS flexibility (like importing dynamically generated indexes…).
Cheers.
The text was updated successfully, but these errors were encountered:
Initial checklist
Affected packages and versions
latest
Steps to reproduce
Create a
remarkrc.mjs
config like:When it's an MD file,
pnpm remark .
works, not when it's an MDX (it's normal).So we need to treat MDX with ESLint which will read the remarkrc through the MDX plugin:
Only problem is that MJS file are not loaded by cosmic config.
It's blocking because all the unified eco-system is going 100% ESM, so we cannot convert our
remark.mjs
to a olderremark.js
or CJS:Expected behavior
Load MJS (optional: or even ts/mts?), like the remark lint cli / VS Code extension does.
Actual behavior
Mismatch between remark lint config when using MD versus MDX.
Side note:
Frontmatter schema plugin is incidentally working via remark cli but not the extension (this is normal, it doesn't parse the MD itself, just the frontmatter). But unfortunately I can't use this "bug" as a feature ;)
Maybe I'm missing something?
I could go with YAML / JSON configs maybe to circumvent those issues ? I admit it is not really an option as I need JS flexibility (like importing dynamically generated indexes…).
Cheers.
The text was updated successfully, but these errors were encountered: