ProjectEvergreen / www.greenwoodjs.dev

Documentation website for Greenwood
https://super-tapioca-5987ce.netlify.app
1 stars 0 forks source link

linting and formatting support for code snippets inside markdown #43

Open thescientist13 opened 4 weeks ago

thescientist13 commented 4 weeks ago

Summary

Coming out of our experience in https://github.com/ProjectEvergreen/greenwood/pull/1215, for the time being since ESLint doesn't support Import Attributes, without using a custom parser, e.g.

module.exports = {
  parser: '@babel/eslint-parser',
  parserOptions: {
    ecmaVersion: 2022,
    sourceType: 'module',
    requireConfigFile: false,
    babelOptions: {
      plugins: [
        '@babel/plugin-syntax-import-assertions'
      ],
    }
  }
  // ...
}

However, as has been added to this Discussion, the markdown plugin for ESLint doesn't seem to play well with a custom parser 😢

Details

So the hope here is that either:

  1. ESLint finally gets Import Attributes, and so no custom parser is needed

or

  1. markdown plugin can play nice with custom parsers