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

awesome-lint

v1.2.0

Published

Linter for Awesome lists

Downloads

1,909

Readme

Linter for Awesome lists

Intended to make it easier to create and maintain Awesome lists.

Includes a bunch of general Markdown rules and some Awesome specific rules.

CLI

Usage

The CLI requires Node.js and Git.

Type the command npx awesome-lint followed by the URL of the repo you want to check:

❯ npx awesome-lint https://github.com/sindresorhus/awesome-something

  readme.md:1:1
  ✖    1:1  Missing Awesome badge after the main heading      awesome-badge
  ✖   12:1  Marker style should be -                          unordered-list-marker-style
  ✖  199:3  Remove trailing slash (https://sindresorhus.com)  trailing-slash

  3 errors

Special comments

You can enable, disable, and ignore rules using special comments. This is based on remark-message-control.

By default, all rules are turned on. For example, 4 errors (2 of no-dead-urls and 2 of awesome-list-item) will be generated for following code snippets.

- [foo](https://foo.com) - an invalid description.
- [foo](https://foo.com) - invalid description.
disable

The disable keyword turns off all messages of the given rule identifiers. If no identifiers are specified, all messages are turned off.

Don't leave spaces after the last rule identifier.

For example, only the 2 no-dead-urls errors are left:

<!--lint disable awesome-list-item-->
- [foo](https://foo.com) - an invalid description.
- [foo](https://foo.com) - invalid description.
enable

The enable keyword turns on all messages of the given rule identifiers. If no identifiers are specified, all messages are turned on.

For example, only the second line reports a awesome-list-item rule violation:

<!--lint disable awesome-list-item-->
- [foo](https://foo.com) - an invalid description.
<!--lint enable awesome-list-item-->
- [foo](https://foo.com) - invalid description.
ignore

The ignore keyword turns off all messages of the given rule identifiers occurring in the following node. If no identifiers are specified, all messages are turned ignored. After the end of the following node, messages are turned on again. This is the main difference with disable.

For example, to turn off certain messages for the next node:

<!--lint ignore awesome-list-item-->
- [foo](https://foo.com) - an invalid description.

List items share the same parent node. So let's create a new list.

- [foo](https://foo.com) - invalid description.

Continuous Integration

GitHub Actions

You can use GitHub Actions for free to automatically run awesome-lint against all pull requests.

Create /.github/workflows/main.yml with the following contents:

name: CI
on:
  pull_request:
    branches: [main]
jobs:
  Awesome_Lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - run: npx awesome-lint

fetch-depth: 0 is needed so that we can check the repo age.

You may add branch protection rules to prevent merging branches not passing awesome-lint.

Travis

Add it as a test script in package.json and activate Travis CI to lint on new commits and pull requests.

Note: Travis CI only clones repositories to a maximum of 50 commits by default, which may result in a false positive of awesome/git-repo-age, and so you should set depth to false in .travis.yml if needed.

Note: Avoid rate limit problems on Travis CI by defining a GitHub personal access token in an environment variable named github_token. See defining variables in repository settings.

package.json
{
	"scripts": {
		"test": "awesome-lint"
	},
	"devDependencies": {
		"awesome-lint": "*"
	}
}
.travis.yml
language: node_js
node_js:
  - 'node'
# git:
#   depth: false

API

Install

npm install awesome-lint

Usage

import awesomeLint from 'awesome-lint';

awesomeLint.report();

Docs

awesomeLint()

Returns a Promise for a list of VFile objects.

awesomeLint.report()

Show the lint output. This can be custom reported by setting options.reporter=<function> and passing in options as a parameter.