Skip to content

Make --strict the default in TypeScript 3.0 #24773

@aboyton

Description

@aboyton

Search Terms

strict default

Suggestion

Congrats on getting towards a 3.0 release. I'm always in constant amazement by the work you are all doing, both in features released and discussions on Github so thank you for that.

Now that you are planning on releasing 3.0 I was wondering if it would be a good idea to make --strict default.

While anyone has the option of turning --strict on or off as they please, I think defaults matter, especially for newcomers. Sadly I fear many are missing out on the advantages that --strict brings as they don't realise that they can turn it on. Even the handbook generally assumes that it is turned off.

As a note: we encourage the use of --strictNullChecks when possible, but for the purposes of this handbook, we will assume it is turned off.

Given that you're planning a major version release I was wondering if now is a good time to consider making --strict default to true. Obviously anyone could change the setting back off if they don't want it turned on.

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript vision

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions