Skip to main content

SKY-R105 · Quality, structure and performance

TypeScript type-check policy

Low

Many bundlers, such as Vite and esbuild, strip TypeScript types without checking them. SKY-R105 reports a package.json that sits next to a tsconfig.json but has no npm script that runs the TypeScript compiler's check.

Languages
TypeScript
Quality gate
counted toward the gate limits (full and diff scans). Advice that is measured on every --quality scan but not listed by default. It is listed, and counted toward max_quality, with --all-advice or when the rule is named in [tool.skylos.gate] rules. A diff scan checks it only when the change touches a policy file such as package.json or tsconfig.json.
Finding type
advice
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

The build succeeds even when the code has type errors, so a wrong property name or a missing null check ships to users. The "strict": true in tsconfig.json is then only applied in editors.

What Skylos flags

package.json · JSONReported on line 1
{  "name": "shop-web",  "private": true,  "scripts": {    "dev": "vite",    "build": "vite build"  }}
tsconfig.json · JSON
{  "compilerOptions": { "strict": true, "noEmit": true }}
src/main.ts · TypeScript
export const cartLimit: number = 50;

What Skylos leaves alone

package.json · JSON
{  "name": "shop-web",  "private": true,  "scripts": {    "dev": "vite",    "build": "vue-tsc --noEmit && vite build"  }}

tsconfig.json: same as in the flagged example.

src/main.ts: same as in the flagged example.

Why Skylos leaves it alone

The build script runs vue-tsc --noEmit before bundling. Skylos reads each command in a script, including after &&, and accepts tsc or vue-tsc as the type check.

How Skylos decides

  1. Runs with --quality, once per scanned project. A diff scan runs it only when a policy file is among the changed files.
  2. Visits every package.json in the project (outside excluded folders and virtual environments) that has a tsconfig.json in the same folder.
  3. Splits each npm script into commands (through &&, ;, |, sh -c, npx, pnpm exec and similar) and accepts a command that runs tsc or vue-tsc, unless it only prints help or the version, or passes --noCheck.
  4. Also accepts a Next.js project whose script runs next build, unless its Next config sets ignoreBuildErrors to anything but false.
  5. Otherwise reports LOW on line 1 of that package.json.

How to fix it

Add a script that runs tsc --noEmit and run it in CI, or put the check in front of the build.

package.json · JSON · the fix, against the flagged file
{  "name": "shop-web",  "private": true,  "scripts": {    "dev": "vite",Removed:     "build": "vite build"Added:     "typecheck": "tsc --noEmit",Added:     "build": "tsc --noEmit && vite build"  }}

When it can be wrong

  • A type check that runs only in a CI file, a Makefile or a separate tool is not seen, so the package is reported.
  • Any script that runs tsc counts, even one that neither CI nor the build ever calls.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • ignore = ["SKY-R105"] under [tool.skylos] in a pyproject.toml at the project root turns the check off. JSON has no comments, so there is no inline marker.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.