Diagnostics

LUM6001: tsconfig missing options required by Lumiose

The project's tsconfig.json lacks an option that type checking .stsx files depends on.

Severity: warning · Category: tooling and config (6xxx)

Reported by: lumiose check, on the option's key in the tsconfig. A warning: the check still runs, but some files are typed wrongly or not at all.

#What it means

lumiose check type-checks .stsx files through generated shadow TSX files in .lumiose/shadow (spec §4.7). That only works when the tsconfig sets:

  • "jsx": "preserve" and "jsxImportSource": "lumiose", so JSX is typed as Lumiose JSX;
  • rootDirs pairing the sources with their shadows (["src", ".lumiose/shadow/src"]), so import "./Card.stsx" resolves to the shadow. The warning also fires when rootDirs pairs only src but a Lumiose package the project uses (a linked workspace package) has .stsx files: they are outside the pair and are not type-checked;
  • include covering .lumiose/shadow (routes and other files nothing imports) and .lumiose/types (route types);
  • types containing "lumiose/env" (Lumiose's globals).

#Example

json
{
  "compilerOptions": { "strict": true, "jsx": "react-jsx" },
  "include": ["src"]
}

#How to fix it

Extend the tsconfig that lumiose check generates, which holds all of these options and pairs linked packages too (decision-25), and add your own options on top:

json
{
  "extends": "./.lumiose/tsconfig.generated.json",
  "compilerOptions": { "strict": true }
}

Or set the option named in the message, as its help line says.