awesome-lint

raw JSON →
2.3.0 verified Fri May 01 auth: no javascript

Linter for Awesome lists. Version 2.3.0, requires Node.js >=20. Actively maintained by Sindre Sorhus. Combines general Markdown rules with Awesome-specific rules (badge, ToC, list item format, etc.). Can lint local files or remote URLs via CLI. Integrates with GitHub Actions and pre-commit. Based on remark-lint. Different from generic linters by enforcing the Awesome list conventions, including spell-checking technology terms and community guidelines.

error Error [ERR_REQUIRE_ESM]: require() of ES Module
cause awesome-lint v2+ is ESM-only, but you are using require() instead of import.
fix
Use import awesomeLint from 'awesome-lint' instead of require('awesome-lint').
error TypeError: (0 , awesomeLint.lint) is not a function
cause Importing from 'awesome-lint' yields default export, not an object.
fix
Use import awesomeLint from 'awesome-lint' then call awesomeLint.lint().
error Error: Cannot find module 'remark'
cause Missing peer dependency remark when installing awesome-lint.
fix
Run npm install remark to install the peer dependency.
error Error: Git repository not found or not a git repository
cause Linting a local directory that is not a git repo.
fix
Initialize a git repo (git init) or use a remote URL.
breaking Requires Node.js >=20 since v2.0.0
fix Update Node.js to v20 or later. Use nvm or download from nodejs.org.
breaking ESM-only since v2.0.0: no CommonJS support
fix Use import instead of require(). For scripts, add type: module to package.json or rename file to .mjs.
gotcha Spell-check violations are warnings, not errors (since v2.3.0)
fix No action required, but be aware that they don't fail the lint step by default. Use --error-level to change.
deprecated The CLI option --no-color is removed in v2.0.0
fix Use FORCE_COLOR=0 environment variable or other color control.
gotcha When linting a repository, the local .git folder must be available for git-repo-age rules
fix Clone with full history (git clone --depth=0 or set fetch-depth: 0 in GitHub Actions).
npm install awesome-lint
yarn add awesome-lint
pnpm add awesome-lint

Demonstrates importing awesome-lint, linting a local directory, using the report method, and linting a remote URL.

import awesomeLint from 'awesome-lint';

// Lint the readme of the current directory
const result = await awesomeLint.lint({ cwd: '.' });
console.log(result.messages);

// Or use the report method to get formatted output
await awesomeLint.report();

// Lint a remote repository
await awesomeLint.report({ url: 'https://github.com/sindresorhus/awesome-something' });