sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
600 stars 56 forks source link

`Missing or invalid Table of Contents remark-lint:awesome-toc` for unknown reason #151

Closed mcanouil closed 2 years ago

mcanouil commented 2 years ago

Hi,

I just created a list and I have a weird issue with the linter which does not detect the table of contents for some reasons, I tried several things without success. Any help would be appreciated, especially if I missed something.

Source: https://github.com/mcanouil/awesome-quarto

The TOC is created with the recommended VSCode extension and looks like the following:

## Contents <!-- omit in toc -->

- [Featured (new releases)](#featured-new-releases)
- [Official documentation & quickstarts](#official-documentation--quickstarts)
- [Turorials & workshops](#turorials--workshops)
- [Supported editors/software](#supported-editorssoftware)
- [Extensions](#extensions)
- [Templates](#templates)
  - [Journals](#journals)
  - [Presentations](#presentations)
- [Blog posts](#blog-posts)
- [Talks and videos](#talks-and-videos)
- [Real life examples](#real-life-examples)
  - [Presentations formats](#presentations-formats)
  - [Websites formats](#websites-formats)
  - [Book formats](#book-formats)
- [Follow](#follow)
  - [Official](#official)
  - [Community](#community)

Currently the linter produces:

  README.md:1:1
  ✖   1:1  Invalid URL                                  remark-lint:double-link
  ✖   1:1  Git repository must be at least 30 days old  remark-lint:awesome-git-repo-age
  ✖   1:1  Missing or invalid Table of Contents         remark-lint:awesome-toc
  ✖  26:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  27:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  28:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  29:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  30:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  31:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  32:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  33:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  34:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  35:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  36:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  37:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  38:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  39:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  40:3  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  41:5  Invalid list item link URL                   remark-lint:awesome-list-item
  ✖  42:5  Invalid list item link URL                   remark-lint:awesome-list-item
mcanouil commented 2 years ago

Apparently the linter does not like <!-- omit in toc --> next to # Contents. When using the VSCode extension, the following settings need to be set instead of using <!-- omit in toc -->:

{
    "markdown.extension.toc.levels": "2..6",
    "markdown.extension.toc.omittedFromToc": {
        "README.md": ["## Contents", "## Contributing"]
    }
}