Registry / testing / remark-lint-gherkin-allowed-tags

remark-lint-gherkin-allowed-tags

JSON →
library0.1.1jsnpmunverified

remark-lint plugin (v0.1.1) that restricts Gherkin (Cucumber .feature file) tags to a user-specified allowlist. Enforces tag discipline in BDD scenarios by flagging any tag not in the configured array. Ships TypeScript types. Part of the unifiedjs-gherkin ecosystem. Similar to remark-lint-gherkin-forbidden-tags but uses a positive allowlist model. MIT license. Low release cadence.

npm install remark-lint-gherkin-allowed-tags
INSTALL
IMPORT
SIG · REMARK-LINT-GHERKI
R
remark-lint-gherkin-allowed-tags
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 remarkLintGherkinAllowedTags from 'remark-lint-gherkin-allowed-tags'
const remarkLintGherkinAllowedTags = require('remark-lint-gherkin-allowed-tags')
ESM-only; CommonJS require may fail unless using dynamic import.
remarkLintGherkinAllowedTags
import remarkLintGherkinAllowedTags from 'remark-lint-gherkin-allowed-tags'
import { remarkLintGherkinAllowedTags } from 'remark-lint-gherkin-allowed-tags'
Default export only; named import does not exist.
type Rule
import type { Rule } from 'remark-lint'
Type import from remark-lint, not from this package; this package does not re-export types.

Sets up remark-lint with the plugin allowing only @smoke and @regression tags, then processes a Gherkin snippet with an unexpected tag to trigger a warning.

import { remark } from 'remark' import remarkLint from 'remark-lint' import remarkLintGherkinAllowedTags from 'remark-lint-gherkin-allowed-tags' const file = await remark() .use(remarkLint) .use(remarkLintGherkinAllowedTags, { allowed: ['@smoke', '@regression'] }) .process(`Feature: Test\n @unexpected_tag\n Scenario: Demo\n Given a step`) console.log(String(file).includes('warning') ? 'Has warnings' : 'No warnings')
Debug
Known issues
gotchaPlugin checks tags on Scenario, Scenario Outline, Examples, and Feature — but NOT on tags attached to Steps.
fix
Ensure tags are only placed on recognized AST nodes; step tags are ignored.
affects: <=0.1.1
gotchaThe `allowed` option must be an array of strings, each starting with `@` — tags without `@` will never match and will always be flagged.
fix
Provide tags exactly as they appear in the feature file, including the leading `@`.
affects: >=0.0.0
gotchaPlugin requires peer dependency `remark-lint` v9+; older versions may silently fail to apply the rule.
fix
Install remark-lint@^9.0.0.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-gherkin-allowed-tags'
Package not installed or not resolved correctly in ESM context.
fix
Install with npm install remark-lint-gherkin-allowed-tags --save-dev and ensure package.json has type: module or use .mjs extension.
TypeError: remark().use is not a function
Using old remark v12 API incorrectly, or missing await when processing.
fix
Use import { remark } from 'remark'; and call .process() with await.
clean is not a function (undefined)
Plugin not properly loaded: missing or misconfigured peer dependency remark-lint.
fix
Ensure remark-lint is installed and applied before this plugin: .use(remarkLint).use(remarkLintGherkinAllowedTags).
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
remark-lintrequiredpeer dependency for lint rule infrastructure
unist-util-visitrequiredused to walk Gherkin AST nodes
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-gherkin-allowed-tags — npm install remark-lint-gherkin-allowed-tags · libregistry