Error codes › param-order

Error codes

param-order

error Programs: modules, their types and functions, written as TypeScript (the `program` extension, ADR 010)

What it means#

A fn of a module with a parameter that is always given after one that may be left out (root: optional string = nil, root?: string): TypeScript takes no required parameter after an optional one. Move it before, or give it a default.

How to fix it#

The message says what is wrong and where, and often what was meant (Did you mean …?). Change the model so that what this page describes no longer holds, then check again: archec check main.arche.

An error: archec builds nothing until it is fixed.

archec check --beginner says the most common messages in plain words, with the names that exist.

The automatic fix#

archec has no fix of its own for this code. When the message says Did you mean …?, VS Code offers that change (Quick Fix).

In the terminal#

archec explain param-order prints this explanation; archec explain program lists the codes of its area.