Skip to content
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

feat: add meta property #233

Merged
merged 1 commit into from
Feb 15, 2024
Merged

feat: add meta property #233

merged 1 commit into from
Feb 15, 2024

Conversation

mdjermanovic
Copy link
Member

Adds meta property to the plugin object and the processor object, for serialization purposes.

With this config:

// eslint.config.js
import markdown from "eslint-plugin-markdown";

export default [
    {
        files: ["**/*.md"],
        plugins: { markdown },
        processor: "markdown/markdown"
    }
];

eslint --print-config foo.md will print:

{
  "languageOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module",
    "parser": "[email protected]",
    "parserOptions": {},
    "globals": {}
  },
  "processor": "markdown/markdown",
  "plugins": [
    "@",
    "markdown:[email protected]"
  ],
  "rules": {}
}

With this config (processor is used directly):

// eslint.config.js
import markdown from "eslint-plugin-markdown";

export default [
    {
        files: ["**/*.md"],
        processor: markdown.processors.markdown
    }
];

eslint --print-config foo.md will print:

{
  "languageOptions": {
    "ecmaVersion": "latest",
    "sourceType": "module",
    "parser": "[email protected]",
    "parserOptions": {},
    "globals": {}
  },
  "processor": "eslint-plugin-markdown/[email protected]",
  "plugins": [
    "@"
  ],
  "rules": {}
}

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@nzakas nzakas merged commit eedda96 into main Feb 15, 2024
12 checks passed
@nzakas nzakas deleted the export-meta branch February 15, 2024 18:03
@github-actions github-actions bot mentioned this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants