Most TypeScript projects ship with a hidden landmine: strict mode off. Without it, null and undefined sneak into every type. A variable you think is a string? It could be null. That button handler? Maybe undefined. The compiler won't tell you until production breaks. Enabling strict mode is like packing a first-aid kit before a hike. You might not need it, but when you do, you will be grateful you prepared. The two heavy hitters: - noImplicitAny: No more mystery types - strictNullChecks: Null becomes its own problem to solve, not a silent failure New projects should start strict. Existing ones can migrate incrementally. Either way, the quality jump is immediate. Are you building with strict mode on, or are you still finding null bugs in prod? #TypeScript #WebDevelopment #FrontEndDev #CodeQuality #SoftwareEngineering
Enable TypeScript Strict Mode for Safer Code
More Relevant Posts
-
TypeScript 6.0 is officially here! It’s the final bridge before the compiler moves to a Go-based architecture (Project Corsa) in version 7.0. Key Updates at a Glance: • Strict Mode by Default: New projects now have strict: true enabled automatically. Clean, type-safe code is now the standard. • Native Temporal API: Full support for the new ECMAScript date/time API. Goodbye to the frustrations of the legacy Date object (Nice one😂😂). • Modern Baseline: Support for ES5 and legacy modules is deprecated. The default target is now ES2025. • Map "Upsert": New native methods like getOrInsert for Maps, reducing boilerplate when handling missing keys. • Project Corsa Prep: This version focuses on cleaning up technical debt to ensure a seamless transition to the Go compiler coming next. Source: https://lnkd.in/eteJ5SK8 💡Tip for Devs If your codebase runs clean now, your future migration to the ultra-fast v7.0 engine will be effortless. 💪💪 #TypeScript #WebDev #SoftwareEngineering #Frontend #Programming #TechUpdates #Coding #JavaScript
To view or add a comment, sign in
-
-
Rust is faster than TypeScript. Except when it isn't. A team at OpenUI swapped their Rust WASM parser for a TypeScript rewrite — and got 2.2x to 4.6x faster performance. The Rust code stayed the same. It just no longer ran. Here's what actually happened: Rust was never the bottleneck. Every call crossed the WASM-JavaScript boundary, which meant copying strings between memory spaces, serializing to JSON, copying results back, and deserializing in V8. That overhead dwarfed any gains from compiled code. When they moved to TypeScript, V8's JIT compiler handled the computation fast enough that Rust's native speed advantage stopped mattering. Then they fixed the real problem: an O(N²) algorithm hiding in the caching layer. Switching to O(N) caching gave the largest speedup by far — not the language change. This is the pattern I see constantly in engineering decisions. Teams spend months optimizing the wrong layer. They pick the "faster" technology, skip the profiling, and end up slower than a naive implementation in the "slower" one. Measure first. Profile before you choose your stack. The bottleneck is almost never where you think it is. The engineers who compound fastest aren't the ones who know the most languages — they're the ones who know where the actual cost is. What's the most counterintuitive performance lesson you've learned building software? #SoftwareEngineering #Performance #WebDevelopment #Rust #JavaScript #Engineering #TechLeadership Join Agentic Engineering Club → t.me/villson_hub
To view or add a comment, sign in
-
-
TypeScript 6 changes how global types are loaded - and it may break existing projects. Types in compilerOptions now does not auto-include everything from node_modules/@types. This means you need to explicitly list global/ambient type packages in your tsconfig[.]app[.]json. For example: "types": ["node", "jasmine"] But don't just dump every @types/* package in there. Here's the key distinction! Add to the array: Packages that inject globals:(e.g., @types/node for process, Buffer, fs; @types/jasmine for describe, it etc) Skip: Packages you explicitly import -- those still resolve automatically. For example, @types/lodash will import automatically. Why the TS team made this change: The old "include everything" default was slow and pulled in unrelated type packages. The explicit list scopes what the compiler sees in node_modules/@types, reducing noise and improving compiler performance. Quick mental model: if it provides globals, list it. If you import it, skip it. #TypeScript #TypeScript6 #WebDevelopment #FrontendDevelopment #DeveloperExperience
To view or add a comment, sign in
-
𝗠𝗮𝘀𝘁𝗲𝗿𝗶𝗻𝗴 𝗧𝘆𝗽𝗲𝗦𝗰𝗿𝗶𝗽𝘁 𝟱.𝘅: 𝗔𝗱 v𝗮𝗻𝗰𝗲𝗱 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝗳𝗼𝗿 𝗙𝘂𝗹𝗹-𝗦𝘁𝗮𝗰𝗸 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿𝘀 TypeScript is a powerful tool that helps you catch complex bugs before they hit your IDE. You can build resilient codebases that scale. You can use generics to create reusable components that work with many types while maintaining type safety. - Use constraints to ensure type safety - Create new types based on existing ones - Enforce naming conventions or routing patterns You can use mapped types to create API wrappers or state managers. You can use template literal types to enforce naming conventions. You can use conditional types to extract types from complex structures. Advanced TypeScript helps you move the burden of validation from runtime to the compiler. You can reduce unit tests and improve developer experience. What's your favorite TypeScript pattern? Source: https://lnkd.in/g83W8M39
To view or add a comment, sign in
-
TypeScript 7.0 is being rewritten in Go. Here's why that matters to you today. TypeScript 6.0 RC dropped last week. It's the last JavaScript-based release. Ever. Starting with 7.0, the compiler is native Go. The early benchmarks show 10x faster type checking. But 6.0 is the release you should care about right now. It introduces deprecations and behavioral changes designed to prepare your codebase for the Go-based compiler. Think of it as the migration guide disguised as a release. What this means practically: Your tsc today takes 45 seconds on a large project. With tsgo, that becomes 4-5 seconds. Incremental builds, project references, --build mode — all ported and working. But the catch: TypeScript 7.0 already passes 19,926 out of 20,000 compiler test cases. Those 74 edge cases that don't match? If your codebase relies on one of them, 6.0 is your window to find out. What to do now: Install the preview: npm i @typescript/native-preview Run tsgo alongside your current tsc. Compare the output. If something breaks, fix it while 6.0 is still current — not after 7.0 ships and the old compiler is gone. The teams that test now avoid the scramble later. Have you tried tsgo yet? How much faster is it on your codebase? #TypeScript #SoftwareEngineering #WebDev #BackendDevelopment
To view or add a comment, sign in
-
-
🤯 TypeScript 7 will be written in Go. Yes, you read that right. Microsoft announced that TypeScript 6.0 will likely be the last version built on the current JavaScript codebase. The next generation TypeScript 7 compiler is being rewritten in Go to unlock: ⚡ Much faster compilation ⚡ Native multi-threading ⚡ Better scalability for large codebases ⚡ Deterministic type checking This means the future TypeScript compiler will behave more like a native toolchain (similar to Rust / Go tooling) instead of a Node.js tool. Meanwhile TypeScript 6.0 RC acts as the bridge between TS 5 and TS 7. Some notable additions in TS 6: • "RegExp.escape()" support • New "Map.getOrInsert()" methods • ES2025 target support • Temporal API types • "--stableTypeOrdering" flag to prepare for TS7 Install the RC: npm install -D typescript@rc The TypeScript ecosystem is evolving fast. If you're building with React, Next.js, Node, or full-stack TypeScript, this transition will be very interesting to watch. I’m currently experimenting with TypeScript + Next.js + tRPC tooling to understand these changes deeper. What do you think about TypeScript moving toward a native compiler? #typescript #javascript #webdev #nextjs #programming
To view or add a comment, sign in
-
-
If you're still manually writing useMemo and useCallback everywhere, you might be optimizing for a problem that no longer exists. The React Compiler hit v1.0 in late 2025. What that means in practice: memoization is now handled at build time, automatically. The compiler analyzes your component tree and decides what to cache. You don't have to. Which means a lot of the useMemo(...) scattered across codebases today is either redundant — or worse — masking component design issues that should have been fixed instead. I've been thinking about how much time I've spent on manual memoization over the years. Not just writing it, but debugging stale closures, wrong dependency arrays, and explaining to every new dev why wrapping a click handler in useCallback probably isn't helping. If you're starting a new React project right now: test with the compiler first. Optimize manually only where the profiler tells you to. The shift isn't just about tooling — it's about what "thinking in React" actually means now. What's your team's current stance on the React Compiler in production? #React #TypeScript #FrontendDevelopment #WebDev #JavaScript
To view or add a comment, sign in
-
TypeScript with any scattered through it isn't TypeScript. It's JavaScript with slower builds and false confidence. The pattern is everywhere: any to silence an error you don't understand, ! to stop the compiler complaining about a value that might be null, a direct as SomeType cast on data you haven't actually validated. Each one is a small lie you're telling the type system. Enough of them and the type system stops being useful – it's just friction. Strict TypeScript is a different experience. When you can't use any, you have to model the problem properly. When you can't suppress nullability, you have to decide what happens when the value is absent. The discipline the compiler imposes is the same discipline good API design requires, and the class of errors it eliminates – null dereferences, wrong shape assumptions, missed union cases – are disproportionately the ones that reach production undetected. Most teams "use TypeScript" but don't actually use TypeScript. The difference shows up in PRs, in runtime exceptions, and in how confidently new engineers can move through an unfamiliar codebase. What's the tell in a codebase that the team has given up on the type system? #TypeScript #SoftwareEngineering #WebDevelopment
To view or add a comment, sign in
-
TypeScript 6.0 is out, and it’s less about flashy features and more about setting the stage for what’s coming next. This release acts as a bridge to TypeScript 7.0, which will introduce a new native (Go-based) compiler focused on better performance and scalability. In that sense, 6.0 is really about alignment and preparation. A few notable updates: - Improved type inference, especially around functions without this - Better module support, including cleaner subpath imports (#/) and bundler compatibility - New built-in types for modern APIs like Temporal A new flag (--stableTypeOrdering) to make migration to 7.0 smoother There are also some meaningful defaults and breaking changes: - strict mode is now on by default - Modern JavaScript targets (ES2025) are the new baseline - The types field no longer auto-includes everything, improving performance but requiring more explicit setup If you’re on TypeScript 5.x, this is a good moment to start preparing for 7.0 rather than treating this as just another routine upgrade. https://lnkd.in/duni2mgz #TypeScript #JavaScript #WebDevelopment #Frontend #Programming #DevTools
To view or add a comment, sign in
-
Impure Function Vs Pure Function If your code behaves unpredictably and your unit tests feel like a constant battle against global variables, the problem might lie in the "purity" of your functions. 🧠🌐 In the TypeScript and JavaScript ecosystem, the concept of Pure Functions is a cornerstone of sustainable code. But what exactly defines a function as "pure"? Determinism: For the same arguments, it ALWAYS returns the same result. No Side Effects: It does not change anything outside its own scope—no external variables, database writes, or logs. Conclusion: Writing predictable code is a clear sign of technical maturity. Have you been prioritizing pure functions in your projects, or are you still dealing with legacy side effects? #cleancode #typescript #webdev #programming #softwarearchitecture
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Starting a project with 'Strict Mode' on is definitely a game-changer for code quality! 🚀 It might feel annoying to handle all those red squiggly lines at first, but it's much better than debugging a production crash caused by an unexpected null. Great analogy about the first-aid kit, Joel!