Skip to content

Generated contributors list always adds markdownlint-disable/restore comments, with no opt-out #540

Description

@JoshuaKGoldberg
  • all-contributors-cli version: 6.26.1 (also 6.27.0-rc.1)
  • node version: 24.15.0
  • npm (or yarn) version: pnpm 11.24.0

Relevant code or config

previousContent.slice(0, endOfOpeningTagIndex + closingTag.length),
'\n<!-- prettier-ignore-start -->',
'\n<!-- markdownlint-disable -->',
newContent.replace('\n', `\n${' '.repeat(nbSpaces)}`),
'<!-- markdownlint-restore -->',
'\n<!-- prettier-ignore-end -->',

What you did:

Added a contributor with all-contributors-cli add (and via the bot) in a repo that doesn't use markdownlint.

What happened:

The contributors list gets wrapped in markdownlint comments, even though the repo never had them:

 <!-- prettier-ignore-start -->
+<!-- markdownlint-disable -->
 <table>
   ...
 </table>

+<!-- markdownlint-restore -->
 <!-- prettier-ignore-end -->

Reproduction repository:

JoshuaKGoldberg/create-typescript-app#2327 (the bot adds these lines, and they're removed by hand in a follow-up commit each time; see JoshuaKGoldberg/create-typescript-app#2188)

Problem description:

injectListBetweenTags always inserts <!-- markdownlint-disable --> / <!-- markdownlint-restore -->, with no way to opt out. For repos that don't use markdownlint these are just noise, and they get re-added on every run even after being removed. Repos that generate or check their README content, such as templates, can't keep the table in sync without also emitting markdownlint comments.

Suggested solution:

Either or both of:

  1. A config option to skip them, e.g. "markdownlint": false in .all-contributorsrc
  2. Preserve whatever is already between the list tags: only emit the markdownlint comments if the existing list already has them (or when creating a new list via init)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions