-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypescript-strict-mode.yaml
More file actions
19 lines (19 loc) · 1.09 KB
/
typescript-strict-mode.yaml
File metadata and controls
19 lines (19 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
id: typescript-strict-mode
name: TypeScript strict mode enabled
description: >
The project's tsconfig.json has compilerOptions.strict set to true. Strict mode enables
a family of compiler checks — noImplicitAny, strictNullChecks, strictFunctionTypes,
strictBindCallApply, strictPropertyInitialization, noImplicitThis, and alwaysStrict —
that collectively eliminate the most common sources of runtime type errors. A TypeScript
codebase without strict mode enabled is structurally equivalent to a JavaScript codebase
with optional type hints. The Executable property requires that the artifact compiles
under the strongest type constraints the toolchain offers. Turning off strict mode to
silence errors defers type unsafety to runtime.
property: Executable
tags: [typescript]
phase: development
trigger: commit
blocking: true
check:
type: script
command: "node -e \"const c=JSON.parse(require('fs').readFileSync('./tsconfig.json','utf8')); if(!c.compilerOptions || c.compilerOptions.strict !== true){console.error('tsconfig.json must have compilerOptions.strict: true');process.exit(1)}\""