Registry / testing / remark-lint-gherkin-max-scenarios-per-file

remark-lint-gherkin-max-scenarios-per-file

JSON →
library0.1.1jsnpmunverified

This package is a remark-lint plugin that enforces a maximum number of scenarios per Gherkin (.feature) file. It works in conjunction with the unified ecosystem and the gherkin-utils parser. At version 0.1.1, it is a stable though early-stage utility. Key differentiator: it fills a niche in linting Gherkin files within a remark/unified pipeline, similar to how other remark-lint rules work for Markdown. It depends on `vfile`, `unified-lint-rule`, `unist-util-visit`, and `gherkin-utils`. It ships with TypeScript type definitions. Currently no breaking changes or security issues reported.

npm install remark-lint-gherkin-max-scenarios-per-file
INSTALL
IMPORT
SIG · REMARK-LINT-GHERKI
R
remark-lint-gherkin-max-scenarios-per-file
testingjavascriptv0.1.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.

default
import remarkLintGherkinMaxScenariosPerFile from 'remark-lint-gherkin-max-scenarios-per-file'
const remarkLintGherkinMaxScenariosPerFile = require('remark-lint-gherkin-max-scenarios-per-file')
This package is ESM-only; CommonJS require() will throw an error.
remarkLintGherkinMaxScenariosPerFile
import remarkLintGherkinMaxScenariosPerFile from 'remark-lint-gherkin-max-scenarios-per-file'
import { remarkLintGherkinMaxScenariosPerFile } from 'remark-lint-gherkin-max-scenarios-per-file'
It is a default export, not named export.

Shows how to set up a remark processor with the Gherkin plugin and lint rule, including Gherkin parser and maximum scenarios option.

import { readSync } from 'to-vfile'; import { remark } from 'remark'; import remarkParse from 'remark-parse'; import gherkin from 'remark-gherkin'; import remarkLintGherkinMaxScenariosPerFile from 'remark-lint-gherkin-max-scenarios-per-file'; const processor = remark() .use(remarkParse) .use(gherkin) .use(remarkLintGherkinMaxScenariosPerFile, { max: 5 }); const file = readSync('./example.feature'); const result = await processor.process(file); console.log(result.messages);
Debug
Known issues
gotchaThis plugin is ESM-only and cannot be used with CommonJS require().
fix
Use import syntax or enable ESM in your project.
affects: >=0.0
gotchaThis lint rule requires the remark-gherkin parser plugin to be applied before it.
fix
Ensure you call .use(gherkin) before .use(remarkLintGherkinMaxScenariosPerFile).
affects: >=0.0
deprecatedNo known deprecations at this version.
fix
N/A
affects: 0.1.1
gotchaThe option object is required; omitting it will throw an error.
fix
Pass an object with a 'max' property (e.g., { max: 10 }).
affects: >=0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Attempting to use CommonJS require() on this ESM-only package.
fix
Switch to ESM imports or use dynamic import().
TypeError: Cannot read properties of undefined (reading 'type')
Missing gherkin parser plugin before this lint rule.
fix
Add .use(gherkin) before .use(remarkLintGherkinMaxScenariosPerFile).
Error: Expected options object with 'max' property
Not passing options or missing 'max' property.
fix
Pass an object like { max: 5 } to the plugin.
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
unified-lint-rulerequiredCore dependency for creating a remark-lint rule.
unist-util-visitrequiredUsed to traverse the AST nodes from Gherkin parser.
gherkin-utilsrequiredParses Gherkin feature files into an AST.
vfilerequiredVirtual file format used in unified ecosystem.
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-gherkin-max-scenarios-per-file — npm install remark-lint-gherkin-max-scenarios-per-file · libregistry