Registry / testing / remark-lint-gherkin-no-tags-on-backgrounds

remark-lint-gherkin-no-tags-on-backgrounds

JSON →
library0.1.1jsnpmunverified

A remark-lint plugin (v0.1.1) that enforces the Gherkin best practice forbidding tags on Background sections in .feature files. Part of the unifiedjs ecosystem for linting Gherkin syntax. Integrates with remark-lint to validate that Backgrounds never have tags, helping teams maintain clean, spec-compliant Gherkin. Targeted at BDD practitioners using Cucumber/Gherkin. Current release is 0.1.1, with no recent updates.

npm install remark-lint-gherkin-no-tags-on-backgrounds
INSTALL
IMPORT
SIG · REMARK-LINT-GHERKI
R
remark-lint-gherkin-no-tags-on-backgrounds
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.

remarkLintGherkinNoTagsOnBackgrounds
import remarkLintGherkinNoTagsOnBackgrounds from 'remark-lint-gherkin-no-tags-on-backgrounds'
const { remarkLintGherkinNoTagsOnBackgrounds } = require('remark-lint-gherkin-no-tags-on-backgrounds')
ESM-only; exports default function. Named export does not exist.

This code shows how to use the plugin to lint a Gherkin file, detecting illegal tags on backgrounds.

import { remark } from 'remark'; import remarkLint from 'remark-lint'; import remarkLintGherkinNoTagsOnBackgrounds from 'remark-lint-gherkin-no-tags-on-backgrounds'; import fs from 'fs'; const file = fs.readFileSync('path/to/feature.feature', 'utf8'); remark() .use(remarkLint) .use(remarkLintGherkinNoTagsOnBackgrounds) .process(file) .then((vfile) => { if (vfile.messages.length) { vfile.messages.forEach(msg => console.log(msg.message)); } else { console.log('No lint errors found.'); } });
Debug
Known issues
gotchaPlugin relies on Gherkin parser from unified ecosystem; ensure correct syntax in .feature files.
fix
Validate that Gherkin files are parseable by remark-gherkin or similar.
affects: >=0.1.0
gotchaRule only applies to 'Background' keyword; does not check tags on other sections.
fix
Use additional lint rules for tags on other sections if needed.
affects: >=0.1.0
gotchaESM-only package; CommonJS require will fail.
fix
Use import syntax; if using Jest, add transformIgnorePatterns or use dynamic import.
affects: >=0.1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Trying to require() an ESM-only package.
fix
Use import instead of require, or set type: 'module' in package.json.
TypeError: remarkLintGherkinNoTagsOnBackgrounds is not a function
Incorrect import style: destructuring named export when only default exists.
fix
Use default import: import remarkLintGherkinNoTagsOnBackgrounds from 'remark-lint-gherkin-no-tags-on-backgrounds'
Cannot find module 'remark-lint-gherkin-no-tags-on-backgrounds'
Package not installed or missing from node_modules.
fix
Run npm install remark-lint-gherkin-no-tags-on-backgrounds
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
remark-lintoptionalPeer dependency; provides the linting framework and rule registration.
unifiedoptionalRequired if using in a remark pipeline, though likely installed as part of remark/mdast ecosystem.
@types/remark-lintoptionalFor TypeScript type definitions if using TS.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-gherkin-no-tags-on-backgrounds — npm install remark-lint-gherkin-no-tags-on-backgrounds · libregistry