[GH-ISSUE #33] Shareable configs #26

Closed
opened 2026-03-03 01:23:07 +03:00 by kerem · 5 comments
Owner

Originally created by @pascalberger on GitHub (Nov 16, 2016).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/33

It would be nice if markdownlint could support shareable configs like eg. ESLint does.

Originally created by @pascalberger on GitHub (Nov 16, 2016). Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/33 It would be nice if markdownlint could support shareable configs like eg. [ESLint](http://eslint.org/docs/developer-guide/shareable-configs) does.
kerem 2026-03-03 01:23:07 +03:00
Author
Owner

@DavidAnson commented on GitHub (Nov 17, 2016):

Interesting! What is it about shareable configuration that interests you most? The ability to upload to npm, the ability to extend other configuration, or something else?

For the first two benefits, they can be done today using styles as described in the README: https://github.com/DavidAnson/markdownlint#optionsconfig It's not quite as elegant as what ESLint has, but it captures many of the important aspects. (Note that styles could come from an npm package as loose files in the archive.)

Is this sufficient for your purposes, or do you have something else in mind?

<!-- gh-comment-id:261160099 --> @DavidAnson commented on GitHub (Nov 17, 2016): Interesting! What is it about shareable configuration that interests you most? The ability to upload to npm, the ability to extend other configuration, or something else? For the first two benefits, they can be done today using styles as described in the README: https://github.com/DavidAnson/markdownlint#optionsconfig It's not quite as elegant as what ESLint has, but it captures many of the important aspects. (Note that styles could come from an npm package as loose files in the archive.) Is this sufficient for your purposes, or do you have something else in mind?
Author
Owner

@pascalberger commented on GitHub (Nov 17, 2016):

My use case:

  • I want to edit Markdown files using Visual Studio Code with the MarkdownLint Extension.
  • I have a gulp script doing the linting of the files and generates a website from them
  • I have several repositories, run by different teams

Therefore I'm looking for a way to share Markdown linting settings across repositories and implement them so that they are used by the Markdownlint Extension in Visual Studio Code, but also in the gulp script.

My current approach to share settings between Visual Studio Code and gulp is to have a .markdownlint.json file in the root of the project:

{
    "default": true,
    "MD003": { "style": "atx" },
}

In the gulp script I include the .markdownlint.json from the root as style:

markdownlint(
  {
    files: ...,
    config: require('./.markdownlint.json')
    },
    ...

While styles can be a solution for sharing settings between repositories, I unfortunately cannot use them since I use the feature already to share the settings beteween Visual Studio Code and the gulp script.

IMHO best solution for my use case would be to allow to reference a base settings file from a .markdownlint.json file. In this case I can publish common setting through as npm package, use them in all projects, add a .markdownlint.json file to the root of each repo, which extends the common settings and adds repos specific settings, and use the .markdownlint.json from the root as style in the gulp script.

<!-- gh-comment-id:261178349 --> @pascalberger commented on GitHub (Nov 17, 2016): My use case: - I want to edit Markdown files using Visual Studio Code with the [MarkdownLint Extension](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint). - I have a gulp script doing the linting of the files and generates a website from them - I have several repositories, run by different teams Therefore I'm looking for a way to share Markdown linting settings across repositories and implement them so that they are used by the Markdownlint Extension in Visual Studio Code, but also in the gulp script. My current approach to share settings between Visual Studio Code and gulp is to have a `.markdownlint.json` file in the root of the project: ``` { "default": true, "MD003": { "style": "atx" }, } ``` In the gulp script I include the `.markdownlint.json` from the root as style: ``` markdownlint( { files: ..., config: require('./.markdownlint.json') }, ... ``` While styles can be a solution for sharing settings between repositories, I unfortunately cannot use them since I use the feature already to share the settings beteween Visual Studio Code and the gulp script. IMHO best solution for my use case would be to allow to reference a base settings file from a `.markdownlint.json` file. In this case I can publish common setting through as npm package, use them in all projects, add a `.markdownlint.json` file to the root of each repo, which extends the common settings and adds repos specific settings, and use the `.markdownlint.json` from the root as style in the gulp script.
Author
Owner

@DavidAnson commented on GitHub (Nov 18, 2016):

Makes sense, thanks! The idea of chaining config seems useful.

<!-- gh-comment-id:261453071 --> @DavidAnson commented on GitHub (Nov 18, 2016): Makes sense, thanks! The idea of chaining config seems useful.
Author
Owner

@tomByrer commented on GitHub (Nov 18, 2016):

@pascalberger Why not a .markdownlint.JSON file (or ini like [.editorconfig](http://editorconfig.org/)?

Though IMHO I prefer something inside package.json; I have too many files in the root folder.

<!-- gh-comment-id:261638966 --> @tomByrer commented on GitHub (Nov 18, 2016): @pascalberger Why not a `.markdownlint.JSON` file (or ini like `[.editorconfig](http://editorconfig.org/)`? Though IMHO I prefer something inside `package.json`; I have too many files in the root folder.
Author
Owner

@pascalberger commented on GitHub (Nov 18, 2016):

@tomByrer Sorry, that was a typo. Should have been markdownlint.json of course

<!-- gh-comment-id:261657441 --> @pascalberger commented on GitHub (Nov 18, 2016): @tomByrer Sorry, that was a typo. Should have been `markdownlint.json` of course
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/markdownlint#26
No description provided.