Registry / testing / awesome-lint

awesome-lint

JSON →
library2.3.0jsnpmunverified

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.

npm install awesome-lint
INSTALL
IMPORT
SIG · AWESOME-LINT
A
awesome-lint
testingjavascriptv2.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

awesomeLint
import awesomeLint from 'awesome-lint'
const awesomeLint = require('awesome-lint')
ESM-only since v2.0.0, require() will fail.
report
import { report } from 'awesome-lint'
import report from 'awesome-lint/report'
Named export since v2.0.0.
lint
import { lint } from 'awesome-lint'
import { lint } from 'awesome-lint/lint'
Named export, not default.

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' });
awesome-lint --version
Debug
Known issues
breakingRequires Node.js >=20 since v2.0.0
fix
Update Node.js to v20 or later. Use nvm or download from nodejs.org.
affects: >=2.0.0
breakingESM-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.
affects: >=2.0.0
gotchaSpell-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.
affects: >=2.3.0
deprecatedThe CLI option --no-color is removed in v2.0.0
fix
Use FORCE_COLOR=0 environment variable or other color control.
affects: >=2.0.0
gotchaWhen 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).
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
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').
TypeError: (0 , awesomeLint.lint) is not a function
Importing from 'awesome-lint' yields default export, not an object.
fix
Use import awesomeLint from 'awesome-lint' then call awesomeLint.lint().
Error: Cannot find module 'remark'
Missing peer dependency remark when installing awesome-lint.
fix
Run npm install remark to install the peer dependency.
Error: Git repository not found or not a git repository
Linting a local directory that is not a git repo.
fix
Initialize a git repo (git init) or use a remote URL.
Upgrade
Version history
2.3.0latest on npm
Audit
Dependencies
remark-lintrequiredUnderlying lint engine for Markdown rules
remarkrequiredMarkdown processor used by awesome-lint
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
1
Resources
awesome-lint — npm install awesome-lint · libregistry