Registry / devops / remark-lint-prohibited-strings

remark-lint-prohibited-strings

JSON →
library4.0.0jsnpmunverified

A remark-lint plugin to prohibit specified strings in markdown files (excluding code blocks). Version 4.0.0 is current and stable, with infrequent releases. It supports case-sensitive and case-insensitive matching, regular expressions, capture group replacement, and optional exclusion of matches adjacent to specified characters. Compared to alternatives, it is lightweight and simple, focused solely on string prohibition without additional linting rules.

npm install remark-lint-prohibited-strings
INSTALL
IMPORT
SIG · REMARK-LINT-PROHIB
R
remark-lint-prohibited-strings
devopsjavascriptv4.0.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.

remarkLintProhibitedStrings
import remarkLintProhibitedStrings from 'remark-lint-prohibited-strings'
import { remarkLintProhibitedStrings } from 'remark-lint-prohibited-strings'
Default import only; named export does not exist.

Shows setup of remark-lint with prohibited-strings plugin and linting a simple markdown file.

import { remark } from 'remark'; import remarkLint from 'remark-lint'; import remarkLintProhibitedStrings from 'remark-lint-prohibited-strings'; const file = await remark() .use(remarkLint) .use(remarkLintProhibitedStrings, [ { no: 'Javascript', yes: 'JavaScript' }, { no: 'Github', yes: 'GitHub' } ]) .process('# Hello Javascript world'); console.log(file.messages); // Output: [1:10-1:19: Replace "Javascript" with "JavaScript" (prohibited-strings)]
Debug
Known issues
gotchaThe plugin does not check inside fenced code blocks or inline code spans, which may cause missed violations if prohibited strings appear in code examples.
fix
Use additional linting rules or preprocess the file if code block linting is required.
affects: >=1.0.0
gotchaRegular expressions in the `no` field are provided as strings; they must be escaped properly (e.g., double backslashes for digit groups).
fix
Ensure regex strings are escaped for JavaScript string literal, e.g., '[Rr][Ff][Cc](\\d+)'.
affects: >=1.0.0
gotchaIf `no` is omitted, the prohibited string is derived from `yes` but with case-insensitive matching; any case variation of `yes` will be flagged.
fix
Explicitly include `no` with the exact case you want to match if case-insensitive behavior is not desired.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-prohibited-strings'
The package is installed but not registered in the dependencies, or the import path is incorrect.
fix
Run `npm install remark-lint-prohibited-strings` and use the correct import as shown in the quickstart.
TypeError: Cannot read properties of undefined (reading 'some')
Configuration passed to the plugin is not an array or is malformed.
fix
Ensure the second argument to .use() is an array of rule objects, e.g., [ { no: 'foo', yes: 'bar' } ].
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
remark-lintrequiredThis package is a plugin for remark-lint; the linting infrastructure is required.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-prohibited-strings — npm install remark-lint-prohibited-strings · libregistry