KScript docs
EN

Lint standards

Which setting wins

Settings are applied in layers, and later layers win:

  1. KScript's built-in defaults.
  2. The standards kscript.json names, in order. Each standard applies the standards it extends first, in order, then its own settings.
  3. kscript.json's own lint and format settings.

Settings are replaced one at a time, as is each format rule and each lint code, so a project that changes print_width keeps the rest of its standard. preserve is replaced as a whole list.

kscript check --warnings-as-errors turns warnings_as_errors on, whatever the layers say. In an editor, its tab settings only fill in the indent when no layer sets format.indent.

Codes and prefixes

A lint rule may name a code (KS6001) or a prefix (KS6*). Inside one layer, the longest match wins, so { "KS3*": "warning", "KS3001": "error" } keeps unknown elements as errors.

Across layers, a prefix replaces what earlier layers said about the codes it covers. A project's "KS6*": "off" really turns off every style rule, even one its standard set to "error" by code.

Edit this page on GitHub