Registry / testing / remark-lint-directive-quote-style

remark-lint-directive-quote-style

JSON →
library1.0.1jsnpmunverified

remark-lint rule to enforce consistent quoting style (single or double quotes) for directive attribute values. Current version 1.0.1, part of the remark-lint monorepo with monthly releases. ESM-only, ships TypeScript types. Differentiator: provides both default export and exported helper function `inferAttributes` for use by other lint rules.

npm install remark-lint-directive-quote-style
INSTALL
IMPORT
SIG · REMARK-LINT-DIRECT
R
remark-lint-directive-quote-style
testingjavascriptv1.0.1
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.

remarkLintDirectiveQuoteStyle
import remarkLintDirectiveQuoteStyle from 'remark-lint-directive-quote-style'
const remarkLintDirectiveQuoteStyle = require('remark-lint-directive-quote-style')
ESM-only since v1.0.0. Using require() will throw ERR_REQUIRE_ESM.
inferAttributes
import { inferAttributes } from 'remark-lint-directive-quote-style'
import inferAttributes from 'remark-lint-directive-quote-style'
Named export, not default. Only needed if writing other lint rules that inspect directive attributes.
Attribute
import type { Attribute } from 'remark-lint-directive-quote-style'
import { Attribute } from 'remark-lint-directive-quote-style'
TypeScript type export, import with `import type` to avoid runtime error.

Set up remark-lint with directive-quote-style rule to require double quotes, process a markdown file, and report lint results.

import remarkLint from 'remark-lint' import remarkLintDirectiveQuoteStyle from 'remark-lint-directive-quote-style' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import { read } from 'to-vfile' import { unified } from 'unified' import { reporter } from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintDirectiveQuoteStyle, { style: 'double' }) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingESM-only package — CommonJS require() will cause ERR_REQUIRE_ESM error.
fix
Use import syntax or dynamic import() in Node.js 16+.
affects: >=1.0.0
gotchainferAttributes is a named export, not default export. Confusion may lead to importing it incorrectly.
fix
Use `import { inferAttributes } from 'remark-lint-directive-quote-style'`.
affects: >=1.0.0
deprecatedThe package is very new (v1.0.0). API stability not guaranteed; expect potential breaking changes in minor versions.
fix
Pin to exact version and monitor release notes.
affects: <2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module from project/node_modules/remark-lint-directive-quote-style/index.js not supported.
Package is ESM-only, but code attempts to require() it.
fix
Switch to import syntax: `import remarkLintDirectiveQuoteStyle from 'remark-lint-directive-quote-style'`
TypeError: Cannot read properties of undefined (reading 'type')
Missing or misconfigured remark-lint plugin; directive-quote-style rule requires remark-lint to be used before it.
fix
Ensure `remark-lint` is added to unified chain: `.use(remarkLint).use(remarkLintDirectiveQuoteStyle)`
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
remark-lintoptionalpeer dependency required for plugin to work as a remark-lint rule
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-directive-quote-style — npm install remark-lint-directive-quote-style · libregistry