Registry / testing / remark-lint-gherkin-up-to-one-background-per-file

remark-lint-gherkin-up-to-one-background-per-file

JSON →
library0.1.1jsnpmunverified

A remark-lint plugin that enforces there is at most one Gherkin Background per feature file. Version 0.1.1 is the current release; the package is in early maintenance stage. It is part of the unifiedjs-gherkin ecosystem, intended for linting Gherkin feature files within unified/remark pipelines. Differentiators: specifically targets a common Gherkin style rule (single background) and integrates with remark-lint, allowing composition with other lint rules. No known active development or recent releases.

npm install remark-lint-gherkin-up-to-one-background-per-file
INSTALL
IMPORT
SIG · REMARK-LINT-GHERKI
R
remark-lint-gherkin-up-to-one-background-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 remarkLintGherkinUpToOneBackgroundPerFile from 'remark-lint-gherkin-up-to-one-background-per-file'
const { default } = require('remark-lint-gherkin-up-to-one-background-per-file')
ESM-only; no named export; default import is the plugin function.
remarkLintGherkinUpToOneBackgroundPerFile
import remarkLintGherkinUpToOneBackgroundPerFile from 'remark-lint-gherkin-up-to-one-background-per-file'
const { remarkLintGherkinUpToOneBackgroundPerFile } = require('remark-lint-gherkin-up-to-one-background-per-file')
Do not destructure; the package has only a default export.
type Options
import type { Options } from 'remark-lint-gherkin-up-to-one-background-per-file'
TypeScript users can import the Options type for configuration.

Shows how to configure remark-lint pipeline with the plugin and lint a Gherkin file for multiple backgrounds.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkLint from 'remark-lint'; import gherkinFromMdast from 'gherkin-from-mdast'; import remarkLintGherkinUpToOneBackgroundPerFile from 'remark-lint-gherkin-up-to-one-background-per-file'; import { lint } from 'remark-lint/message'; const processor = unified() .use(remarkParse) .use(remarkLint) .use(gherkinFromMdast) .use(remarkLintGherkinUpToOneBackgroundPerFile); processor.process('Feature: Test\n Background: Setup\n Background: Duplicate').then((file) => { const messages = lint(file); console.log(messages); // Contains error about multiple backgrounds });
Debug
Known issues
gotchaPlugin expects Gherkin AST from gherkin-from-mdast; otherwise it silently does nothing.
fix
Ensure you've added gherkinFromMdast() before this plugin in the pipeline.
affects: >=0.1.0
breakingVersion 0.1.0 initial release; no known breaking changes yet.
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-gherkin-up-to-one-background-per-file'
Package not installed or typo in import path
fix
npm install remark-lint-gherkin-up-to-one-background-per-file
TypeError: remarkLintGherkinUpToOneBackgroundPerFile is not a function
Incorrect import (named instead of default) or using ES import in CJS environment
fix
Use default import: import plugin from 'remark-lint-gherkin-up-to-one-background-per-file' or in CJS: const plugin = require('remark-lint-gherkin-up-to-one-background-per-file').default
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
remark-lintrequiredPeer dependency for lint rule integration
mdast-util-gherkinoptionalUsed for parsing and manipulating Gherkin AST
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-gherkin-up-to-one-background-per-file — npm install remark-lint-gherkin-up-to-one-background-per-file · libregistry