Skip to content

Latest commit

 

History

History
71 lines (50 loc) · 1.19 KB

ts-package-json-engine-is-present.md

File metadata and controls

71 lines (50 loc) · 1.19 KB

ts-package-json-engine-is-present

Requires support for all Node LTS version.

Currently, this requires engines in package.json to contain an entry for node set to ">=12.0.0" unless a nodeVersionOverride value is present.

This rule is fixable using the --fix option.

Examples

Good

{
  "engines": {
    "node": ">=14.0.0"
  }
}

Bad

{
  "engine": {
    "node": ">=14.0.0"
  }
}
{
  "engine": ">=6.0.0"
}
{
  "engine": ">=10.0.0"
}
{}

When to turn off

Only if the rule breaks.

Options

This rule as an object option:

  • "nodeVersionOverride": allow providing a custom supported node version if an external dependency enforces it

nodeVersionOverride

Example of correct code for this rule with the { "nodeVersionOverride": ">=10.0.0" } option:

{
  "engines": {
    "node": ">=10.0.0"
  }
}

Also encompasses ts-node-support, as the rules are similar enough to not exist separately for linting purposes.