remark-preset-lint-starstuff
raw JSON → 2.0.7 verified Fri May 01 auth: no javascript
Opinionated remark-lint preset that provides a simple, shareable configuration for linting Markdown and MDX files. Current stable version is 2.0.7 (released April 2025), with a maintenance-focused release cadence. It integrates with Prettier to avoid formatting conflicts and includes rules from remark-preset-lint-consistent and remark-preset-lint-markdown-style-guide. Ideal for developers wanting a zero-fuss linting setup that respects Prettier formatting.
Common errors
error Error: Cannot find module 'remark-preset-lint-starstuff' ↓
cause Module not installed or wrong package name.
fix
Run: npm install --save-dev remark-preset-lint-starstuff
error ReferenceError: require is not defined in ES module scope ↓
cause Using require() instead of import in an ESM context.
fix
Change to import statement: import preset from 'remark-preset-lint-starstuff'
error TypeError: preset is not a function ↓
cause Incorrectly importing the preset object instead of the default export.
fix
Use default import: import preset from 'remark-preset-lint-starstuff'
Warnings
breaking v2.0.0 dropped CommonJS support. All imports must be ESM. ↓
fix Use import instead of require. If using Node <12, upgrade or stick to v1.x.
deprecated v1.x is no longer maintained. Upgrade to v2.x for continued updates and fixes. ↓
fix Update to v2.x: npm install remark-preset-lint-starstuff@latest
gotcha The preset is sensitive to remark-cli version. Using mismatched versions may cause runtime errors. ↓
fix Ensure remark and remark-cli are compatible with the preset. Check peer dependency versions in package.json.
gotcha The preset assumes Prettier is installed. Without Prettier, some rules may behave unexpectedly or cause conflicts. ↓
fix Install Prettier: npm install --save-dev prettier
Install
npm install remark-preset-lint-starstuff yarn add remark-preset-lint-starstuff pnpm add remark-preset-lint-starstuff Imports
- preset-lint-starstuff wrong
const remarkPresetLintStarstuff = require('remark-preset-lint-starstuff')correctimport remarkPresetLintStarstuff from 'remark-preset-lint-starstuff' - Config in package.json wrong
"remarkConfig": { "plugins": ["remark-preset-lint-starstuff"] }correct"remarkConfig": { "plugins": ["preset-lint-starstuff"] } - Programmatic usage wrong
const remark = require('remark'); const preset = require('remark-preset-lint-starstuff'); remark().use(preset).processSync('...');correctimport { remark } from 'remark'; import preset from 'remark-preset-lint-starstuff'; remark().use(preset).processSync('...');
Quickstart
// Install: npm install --save-dev remark-preset-lint-starstuff
// package.json
{
"remarkConfig": {
"plugins": ["preset-lint-starstuff"]
}
}
// Then run: npx remark README.md
// Or programmatically:
import { remark } from 'remark';
import preset from 'remark-preset-lint-starstuff';
const file = await remark()
.use(preset)
.process('# Hello\n\nThis is a test file.');
console.log(String(file)); // outputs lint messages