Skip to main content

GPLint v2 released

· 3 min read
Luis Zurro
Creator & Maintainer

We are proud to release the v2 of GPLint today.

This release comes with a lot of effort to improve things and bring all the new features of Gherkin syntax.

New features

Load custom rules with .mjs and .cjs

Now we support loading custom rules with mjs and cjs extensions, and the TypeScript equivalents, mts and cts.

Gherkin's Rule support added to all rules

From this new version, we added support to all rules to use Gherkin's Rule node. The following rules has new configuration options related with Gherkin's Rule node:

Improved rule no-restricted-patterns

The rule no-restricted-patterns has new configuration options:

  • Examples:
  • ExampleHeader:
  • ExampleBody:
  • DocString:
  • DataTable:

Now you are able to set patters to "Examples", "ExampleHeader" and "ExampleBody"

{
"no-restricted-patterns": ["error", {
"Examples": [
"poor examples name",
"really bad examples description"
],
"ExampleHeader": [
"^.*disallowed.*$"
],
"ExampleBody": [
"^.*invalid.*$"
]
}]
}

DocStrings and DataTable

Now you are able to set patters to "Examples", "ExampleHeader" and "ExampleBody"

Rules improvements: Improve no-restricted-patterns: Support Example, ExampleHeader and ExampleBody. Support DocString and DataTable from Steps with it own configuration key (check README.md).

Bug fixes

no-partially-commented-tag-lines

Fix no-partially-commented-tag-lines rule, detecting comments separated from tag (configurable). Refer to its own documentation page to know how to configure it.

Breaking changes

Removed deprecated "on" config

To follow the way other linting tools work, like eslint, we removed the "on" option as a valid config level. It should be replaced with a level string, "error" or "warn".

required-tags, remove deprecated tags option

On rule required-tags the tags config was renamed to scenario, to avoid confusions with the other levels (global, feature, example, etc.).

// v1
{
"required-tags": ["error", {"tags": [["@ready", "@manual", "@wip"]]}]
}

// v2
{
"required-tags": ["error", {"scenario": [["@ready", "@manual", "@wip"]]}]
}
// v1
{
"no-files-without-scenarios": "on",
"file-name": ["on", {"style": "PascalCase"}]
}

// v2
{
"no-files-without-scenarios": "warn",
"file-name": ["error", {"style": "PascalCase"}]
}

Project updates

Dropped Node.js v14 and v16 support

We are discontinuing support for older and unmaintained Node.js versions. GPLint v2 will no longer support Node.js v16 and below. We recommend users upgrade to Node.js v20.

Added Node.js v20 and v22 support

We are adding support latest Node 20 (not limited to 20.4 anymore) and 22.

CommonJS to ESM Transition

We transitioned to the new Node.js module system, with a big rework of our code. It should not affect if using GPLint as a cli tool, if you have problems with integration, please, first read this