René's URL Explorer Experiment


Title: Enable `--strict` by default · Issue #62333 · microsoft/TypeScript · GitHub

Open Graph Title: Enable `--strict` by default · Issue #62333 · microsoft/TypeScript

X Title: Enable `--strict` by default · Issue #62333 · microsoft/TypeScript

Description: Background Almost a decade ago, we began to add certain options beyond --noImplicitAny and --strictNullChecks. Flags like --strictFunctionTypes, --noImplicitThis, and --strictBindCallApply have been added to ensure most code is hardened ...

Open Graph Description: Background Almost a decade ago, we began to add certain options beyond --noImplicitAny and --strictNullChecks. Flags like --strictFunctionTypes, --noImplicitThis, and --strictBindCallApply have bee...

X Description: Background Almost a decade ago, we began to add certain options beyond --noImplicitAny and --strictNullChecks. Flags like --strictFunctionTypes, --noImplicitThis, and --strictBindCallApply have bee...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/62333

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable `--strict` by default","articleBody":"## Background\n\nAlmost a decade ago, we began to add certain options beyond `--noImplicitAny` and `--strictNullChecks`. Flags like `--strictFunctionTypes`, `--noImplicitThis`, and `--strictBindCallApply` have been added to ensure most code is hardened against certain classes of type safety bugs. To avoid thinking about all the specific type-checking flags we recommended, we added the `--strict` flag as an easy way to enable them all. Each flag in the \"`--strict` family\" was still off by default, and so was `--strict` itself; but all of them would be conveniently enabled when turning on `--strict`. In cases where users found the behaviors of individual flags to be frustrating, or a new setting added under `--strict` broke their code, it has always been possible to toggle those individual settings to their `false` state even while `--strict` is set to `true`.\n\nThese settings were added as opt-ins so that our developers could avoid breaks, and migrations to TypeScript could be as easy as possible. But for years now, we've framed most of `--strict` as a collection of decisions we would have made in TypeScript if we had the chance to start things all over again. We still want to carry our community forward, but we want new TypeScript code to get the best experience out of the box.\n\nWhile lots of code relies on laxer strictness settings, we have recommended that `--strict` be enabled for many years. `tsc --init` has set `\"strict\": true` for the better part of a decade. We are seeing that more and more developers pick TypeScript for JavaScript development, and expect stricter type-checking by default. For most new projects, `--strict` being off feels like it's usually an accident, and a pit-of-failure experience that we want users to avoid.\n\nIn TypeScript 6.0 and 7.0, we want to go a step further than explicitly setting `--strict` in `tsc --init`: by enabling it by default.\n\n## Proposal\n\nTypeScript 6.0 will assume that `--strict` is on, unless explicitly disabled.\nThis means that specific settings like `--strictNullChecks` and `--noImplicitAny` will be enabled automatically *unless* `--strict` is explicitly turned off.\n\nProjects that encounter breaks from this change will be able to do one of the following:\n\n- adjust code to be compatible with all strict behaviors\n- turn specific strictness flags off\n- turn `--strict` off explicitly\n\nDevelopers can consider partial migrations over time through a combination of the above.\n\n## Open Questions\n\n### What should `tsc --init` generate?\n\nIf TypeScript 5.9 and earlier still assume that `--strict` is false, should `tsc --init` should still continue explicitly setting `\"strict\": true` in generated `tsconfig.json` files? Is it worth keeping in there for awareness, or do we want to free users of ever thinking of `--strict` again?\n\nWhile I personally felt that it would be worth keeping `strict` in there for broader compatibility with older TypeScript versions, I wonder how much of a win this really is. Over time, all developers will experience a new built-in TypeScript in their editors, or will be expected to use a the version of TypeScript that was run with `tsc --init`.\n\nI don't think it hurts that much to leave things as-is for now, but I'm open to us changing it.\n\n### What should the default experience be in editors for loose files?\n\nToday, editors like VS Code are able to specify the settings for loose files. By \"loose files\", we mean files where a `tsconfig.json` couldn't be found, or untitled TypeScript/JavaScript buffers. In these cases, we create what's called an \"inferred project\".\n\nWhen a loose file is opened with our language service, we apply a default set of settings. For TypeScript, we try to adopt some loose runtime rules (e.g. high ECMAScript `--target`s, lax module resolution, etc.). This makes it slightly easier to have files can be built and run without a `tsconfig.json` or `jsconfig.json`.\n\nWhile this is fairly rare for TypeScript files...\n\n- it is definitely already common to see JavaScript files with no `tsconfig.json` or `jsconfig.json`, and\n- it may become more common to run loose TypeScript \"scripts\" now that Node.js, Deno, and Bun all support running TypeScript directly.\n\nFor JavaScript, this matters more in cases where `// @ts-check` (or similar ways of checking JavaScript files in the editor) are used. Either way, `noImplicitAny` can be a bit rough when using untyped libraries. Maybe we should perform automatic type acquisition for loose TypeScript files, but it would be confusing to lose typing when a user creates their first `tsconfig.json`.\n\nWe could effectively punt on answering \"what should the new behavior be?\" by explicitly having editors turn `--strict` mode off for inferred projects. This would maintain the status quo today. We would either:\n\n- modify editors using TSServer to explicitly opt in here\n- set `strict: false` as the default setting of inferred projects\n\nI do think we may want to experiment with `--strict` on by default in inferred projects before making a call here.\n\n## More Information\n\nMore information on 6.0 breaking changes and deprecations is available at #54500.","author":{"url":"https://github.com/DanielRosenwasser","@type":"Person","name":"DanielRosenwasser"},"datePublished":"2025-08-25T16:19:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/62333/TypeScript/issues/62333"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:06a5a362-ef41-029e-253f-b7cc836fdc11
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB1F8:35E10A:778EBC:9DB14F:6A5FD566
html-safe-noncebe2c7dfccce52cbe89ed9acaad717d143476dadaee23e056d9c81b0619b5999f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUY4OjM1RTEwQTo3NzhFQkM6OURCMTRGOjZBNUZENTY2IiwidmlzaXRvcl9pZCI6IjUzMTExNDYxNjE5MDI0NDE4MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacad8cd09629baec3ccfb2b0dbb3cc49b19ff74a14aaa34daa7bf2088428eb4db3
hovercard-subject-tagissue:3352441143
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/62333/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f7a7b87506de30bfb24a19b073a4664b2fffe722f6eb19f0b5aa4c509e7c4f6c/microsoft/TypeScript/issues/62333
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f7a7b87506de30bfb24a19b073a4664b2fffe722f6eb19f0b5aa4c509e7c4f6c/microsoft/TypeScript/issues/62333
og:image:altBackground Almost a decade ago, we began to add certain options beyond --noImplicitAny and --strictNullChecks. Flags like --strictFunctionTypes, --noImplicitThis, and --strictBindCallApply have bee...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDanielRosenwasser
hostnamegithub.com
expected-hostnamegithub.com
None2a1904016bf220ad1311da188567b50f2c83d69b89a554fd8b017417589fbe29
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef83c469daaa92993df0b1f479d525995ec8cc172
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/62333#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F62333
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F62333
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/62333
Reloadhttps://github.com/microsoft/TypeScript/issues/62333
Reloadhttps://github.com/microsoft/TypeScript/issues/62333
Please reload this pagehttps://github.com/microsoft/TypeScript/issues/62333
microsoft https://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Notifications https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Fork 13.6k https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Star 110k https://github.com/login?return_to=%2Fmicrosoft%2FTypeScript
Code https://github.com/microsoft/TypeScript
Issues 5k+ https://github.com/microsoft/TypeScript/issues
Pull requests 29 https://github.com/microsoft/TypeScript/pulls
Actions https://github.com/microsoft/TypeScript/actions
Projects https://github.com/microsoft/TypeScript/projects
Models https://github.com/microsoft/TypeScript/models
Wiki https://github.com/microsoft/TypeScript/wiki
Security and quality 0 https://github.com/microsoft/TypeScript/security
Insights https://github.com/microsoft/TypeScript/pulse
Code https://github.com/microsoft/TypeScript
Issues https://github.com/microsoft/TypeScript/issues
Pull requests https://github.com/microsoft/TypeScript/pulls
Actions https://github.com/microsoft/TypeScript/actions
Projects https://github.com/microsoft/TypeScript/projects
Models https://github.com/microsoft/TypeScript/models
Wiki https://github.com/microsoft/TypeScript/wiki
Security and quality https://github.com/microsoft/TypeScript/security
Insights https://github.com/microsoft/TypeScript/pulse
#63087https://github.com/microsoft/TypeScript/pull/63087
#62987https://github.com/microsoft/TypeScript/pull/62987
Enable --strict by defaulthttps://github.com/microsoft/TypeScript/issues/62333#top
#63087https://github.com/microsoft/TypeScript/pull/63087
#62987https://github.com/microsoft/TypeScript/pull/62987
https://github.com/DanielRosenwasser
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 6.0.0https://github.com/microsoft/TypeScript/milestone/218
https://github.com/DanielRosenwasser
DanielRosenwasserhttps://github.com/DanielRosenwasser
on Aug 25, 2025https://github.com/microsoft/TypeScript/issues/62333#issue-3352441143
#54500https://github.com/microsoft/TypeScript/issues/54500
DanielRosenwasserhttps://github.com/DanielRosenwasser
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 6.0.0No due datehttps://github.com/microsoft/TypeScript/milestone/218
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.