{"id":25625,"library":"gherkin-lint-ts","title":"gherkin-lint-ts","description":"Gherkin feature linter written in TypeScript, based on the original gherkin-lint project. Provides linting for .feature files using configurable rules, with support for custom TypeScript rules and error levels (Error/Warn). Current stable version is 5.0.6. Release cadence is irregular. Key differentiators: TypeScript support for writing custom rules, pretty terminal output, fixed issues from the original library, and output directed to process.stdout.","status":"active","version":"5.0.6","language":"javascript","source_language":"en","source_url":"https://github.com/avysotskaya/gherkin-lint-ts","tags":["javascript","gherkin","cucumber","cucumberjs","validator","feature","features","lint","typescript"],"install":[{"cmd":"npm install gherkin-lint-ts","lang":"bash","label":"npm"},{"cmd":"yarn add gherkin-lint-ts","lang":"bash","label":"yarn"},{"cmd":"pnpm add gherkin-lint-ts","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Parses Gherkin feature files","package":"gherkin","optional":false}],"imports":[{"note":"ESM module; default export is not present.","wrong":"const gherkinLint = require('gherkin-lint-ts').lint","symbol":"lint","correct":"import { lint } from 'gherkin-lint-ts'"},{"note":"TypeScript type, not importable as runtime value.","wrong":"const { LintConfig } = require('gherkin-lint-ts')","symbol":"LintConfig","correct":"import type { LintConfig } from 'gherkin-lint-ts'"},{"note":"Used for writing custom rules; only available in TypeScript.","wrong":null,"symbol":"GherkinLintRule","correct":"import { GherkinLintRule } from 'gherkin-lint-ts'"}],"quickstart":{"code":"import { lint } from 'gherkin-lint-ts';\n\nconst config = {\n  rules: {\n    'no-tags-on-backgrounds': 'error',\n    'name-length': { Feature: { min: 1, max: 100 } }\n  }\n};\n\nconst results = await lint(['path/to/features/**/*.feature'], config);\nconsole.log(JSON.stringify(results, null, 2));","lang":"typescript","description":"Shows how to import and use the linter with a config object, linting .feature files and printing results."},"warnings":[{"fix":"Use await or .then() when calling lint().","message":"The 'lint' function is now asynchronous (returns a Promise) in v5.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Replace check() with lint().","message":"The 'check' function is deprecated; use 'lint' instead.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Ensure the config file is in the root directory of your project.","message":"Configuration file must be named `.gherkin-lintrc` and placed in the project root; the library does not search up the directory tree.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Rewrite custom rules in TypeScript.","message":"Custom rules written in JavaScript are no longer supported; they must be written in TypeScript.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Specify 'indentation': { 'Feature': 'spaces', 'Scenario': 2 } in config.","message":"The 'indentation' rule uses tabs by default instead of spaces.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Replace 'new-line-at-eof' with 'eof-newline' in config.","message":"The 'new-line-at-eof' rule is deprecated; use the 'eof-newline' rule instead.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install gherkin' or 'yarn add gherkin'.","cause":"Missing peer dependency 'gherkin'.","error":"Error: Cannot find module 'gherkin'"},{"fix":"Use import { lint } from 'gherkin-lint-ts'.","cause":"Using incorrect import (e.g., require('gherkin-lint-ts') instead of named import).","error":"TypeError: lint is not a function"},{"fix":"Add a 'rules' object with at least one rule to .gherkin-lintrc.","cause":"Configuration file exists but is missing the 'rules' key or is empty.","error":"ERROR: No rules configured in .gherkin-lintrc"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}