KScript docs
EN

Lint standards

Introduction

A team usually wants every project to follow the same house style: the same lint rules, the same indent, the same line width. A standard is a named set of lint rules and format settings that you write once and share between projects.

KScript's own defaults are a standard too, kscript:recommended, and every project uses it unless its kscript.json names another. You may build your own standard on top of KScript's, and each project can still change single rules.

To use a standard, name it in kscript.json:

JSON
// kscript.json
{
  "standard": "../shared/acme",                  // a folder holding kscript-standard.json, or a file
  "lint": { "rules": { "KS3003": "off" } },     // this project's own changes win over the standard
  "format": { "print_width": 100 }
}

kscript check, kscript fmt and the editor all read standards the same way. The language server notices when you edit a standard file, even before you save it, and checks open files again.

Edit this page on GitHub