npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tjw-markdownlint-rules

v1.1.0

Published

The Jared Wilcurt's Markdown linting rules

Downloads

3

Readme

TJW-MarkdownLint-Rules

Build Status

The Jared Wilcurt's very agressive Markdown Linting rules for obsessives.

How to use this

  1. Create a file called .markdown-lint.yml and set it up like so:

    ---
    extends: ./node_modules/tjw-markdownlint-rules/tjwmarkdownlint.yml
    # Override the proper-names rule to enforce capitalization of your project's name and other proper nouns
    proper-names:
      names:
        - JavaScript
        - Your Project Name
  2. Put the .markdownlint.yml file in your project root (next to package.json)

  3. npm install --save-dev markdownlint-cli tjw-markdownlint-rules

  4. In the "scripts": section of your package.json add in these two lines:

    • "markdownlint": "markdownlint -i \"./node_modules/**/*\" --config ./.markdownlint.yml ./**/*.md"
      • Note: You can change the ./**/*.md to be specific to your project's folder structure. Example: docs/**/*.md
  5. npm run markdownlint - This will list the lines of each file that are in violation of the linting rules for you to manually correct.

Customizing rules

  1. Edit the .markdownlint.yml file
  2. Add in rules you want to override
    • In the example above, we are overriding the proper-names rule
  3. All rules are documented here:

Known issues

Improper indentation not flagged:

May be covered by: #138

1. Text

    ![This should be flagged for starting with 4 spaces instead of 2](file.png)

1. Test

Trailing whitespace not caught in unordered list empty line:

#216

* Example
  * There are two spaces on the next line
  
  * The line above this should be flagged for trailing whitespace

Unfixible issues

Random indentation forced by CommonMark for sublists

The complete morons over at CommonMark, have decided to incorrectly parse list items because "reasons" (read: opinions, of which, that are the type of "bad").

1. Top level ordered list

  * Sublist with 2 space indentation
  * CommonMark only parses this as a sublist if it starts with 3 spaces. You know? 3 spaces? A super normal amount of spaces for indentation that normal people who aren't fucking idiots would totally use. Yup. 3 spaces. That's the hill they are choosing to die on. Totally valid. Not fucking stupid at all.
25. Top level ordered list

  * Sublist with 2 space indentation
  * CommonMark only parses this as a sublist if it starts with 4 spaces. Oh good, it's actually a variable amount of spaces. Even fucking better. I sure do love indentation that varies by single character increments. I'm really happy I use a linter to ENFORCE INCONSISTENCIES.
116. Top level ordered list

  * Sublist with 2 space indentation
  * CommonMark only parses this as a sublist if it starts with 5 spaces. fuck everything

Since MarkdownLint relies on markdown-it, which is built on top of the horrible "CommonMark" version of markdown, you are stuck with this shitty bullshit. I have enabled the MD006 to catch this if your code uses shitty CommonMark to be processed to HTML. However if you use a good markdown interpreter, then you should turn MD006 off, because it will try to make you over-indent to satisfy MarkdownLint's internal interpretter (markdown-it), and likely fuck up something else.

To disable it, add this to your .markdownlint.yml:

# MD006 - Consider starting bulleted lists at the beginning of the line.
# Thankfully, we do not use CommonMark. Unfortunately MarkdownLint does,
# so we have to disable this so it doesn't freak out about bullets inside numbered lists.
ul-start-left: false