tsconfig.json இல் "strict": true ஒரே நேரத்தில் மிகக் கடுமையான சரிபார்ப்புகளின் குடும்பத்தைக் கருவிறிப்பாக்குகிறது. இது அனைத்து புதிய திட்டங்களுக்குப் பலமாக பரிந்துரைக்கப்படுகிறது — TypeScript தடுக்க உள்ள பிழைகளைப் பிடிக்கிறது.
tsconfig.json இல் "strict": true ஒரே நேரத்தில் மிகக் கடுமையான சரிபார்ப்புகளின் குடும்பத்தைக் கருவிறிப்பாக்குகிறது. இது அனைத்து புதிய திட்டங்களுக்குப் பலமாக பரிந்துரைக்கப்படுகிறது — TypeScript தடுக்க உள்ள பிழைகளைப் பிடிக்கிறது.
// strictNullChecks — null/undefined are no longer assignable to everything
let name: string = null; // ❌ Error (without strict this compiles, then crashes)
function f(u?: User) { u.name; } // ❌ u is possibly undefined → forces a check
// noImplicitAny — parameters with no inferable type must be annotated
function g(x) {} // ❌ Error: 'x' implicitly has type 'any'
// strictPropertyInitialization — class fields must be initialized
class C { name: string; } // ❌ must init in constructor or mark optional
strictNullChecks பெரியது: இது null/undefined ஐ மற்ற வகைகளிலிருந்து பிரிக்கிறது, எனவே கம்பைலர் "காணாமல் போகலாம்" என்பதை எல்லா இடங்களிலும் கையாள வাধ்யமாக்குகிறது — ரানடைம் பிழைகளின் #1 வகுப்பை நீக்குகிறது ("cannot read property of undefined").
பொதுவாக கொடி மாறியை மாறும் முறையில் புரட்டவும் (strictNullChecks முதலில்), ஒரு முறை ஒரு பெரிய கட்டமைக்கப்பட்ட திட்டத்தை இயக்குவதற்கு பதிலாக ஒரு ஆவணக் கோப்பைப் பிழை திருத்தவும்.
Strict mode இல்லாமல், TypeScript இன்னும் பல பாதுகாப்பற்ற வடிவங்களை அனுமதிக்கிறது அதை தடுக்க உள்ளது (implicit any, சரிபார்க்கப்படாத nulls).
Strict mode என்பது TypeScript அதன் மূல்யத்தின் பெரும்பாலானவற்றை வழங்கும் இடம் — இதை இயல்பாகவும் மற்றும் நல்ல காரணத்தையே தனிப்பட்ட கொடிகளை தளர்த்தவும்.