Skip to content

Support Frontmatter #147

Closed
Closed
@muuvmuuv

Description

@muuvmuuv

Subject of the feature

I'm currently creating a new eslint setup in my project and everything seems fine but when I lint .mdx files I'm getting the below warning. I couldn't find anything in the docs or if it is even already supported but frontmatter support is necessary.

.../src/pages/about.mdx
  1:3  error  Parsing error: Invalid left-hand side in prefix operation

> 1 | ---
    |   ^
  2 | title: 'About Me'
  3 | ---
  4 |

Problem

No frontmatter support

Expected behavior

Should ignore the frontmatter section or lint it if it is possible (indention etc.)

Alternatives

What are the alternative solutions? Please describe what else you have considered?

Additional information

My eslint config:

{
  "parser": "babel-eslint",
  "plugins": [
    "import"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:react/recommended",
    "plugin:mdx/recommended",
    "plugin:jsx-a11y/strict",
    "plugin:prettier/recommended"
  ],
  "env": {
    "es6": true,
    "browser": true,
    "commonjs": true,
    "serviceworker": true
  },
  "parserOptions": {
    "sourceType": "module",
    "ecmaVersion": 2020
  },
  "settings": {
    "react": {
      "version": "detect"
    },
    "import/resolver": {
      "node": {
        "extensions": [
          ".js",
          ".jsx"
        ]
      }
    }
  },
  "rules": {
    "react/display-name": "off",
    "react/prop-types": "off",
    "import/order": [
      "error",
      {
        "groups": [
          [
            "builtin",
            "external",
            "internal"
          ]
        ]
      }
    ],
    "default-case": "off"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    👀 no/externalThis makes more sense somewhere else

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions