Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable --enforceReadonly in TypeScript code base #59326

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f8fa8b2
Implement --strictReadonly compiler option
ahejlsberg Apr 20, 2024
453d778
Fix inconsistent 'readonly' modifiers in lib files
ahejlsberg Apr 22, 2024
0b5728a
Accept new baselines
ahejlsberg Apr 22, 2024
170bb5f
Change option name to --enforceReadonly
ahejlsberg Apr 23, 2024
97adafc
Accept new API baselines
ahejlsberg Apr 23, 2024
800c901
More baseline changes
ahejlsberg Apr 23, 2024
8c1ac64
Add tests
ahejlsberg Apr 23, 2024
88c2579
Merge branch 'main' into enforceReadonly
ahejlsberg Apr 23, 2024
d7c8851
Remove unused file
ahejlsberg Apr 23, 2024
dd6c3a8
Enforce read-only semantics in generic mapped types
ahejlsberg Apr 24, 2024
638e55c
Add more tests
ahejlsberg Apr 24, 2024
6fafe58
Compile APILibCheck.ts with --enforceReadonly
ahejlsberg Apr 24, 2024
4d16813
Accept new API baselines
ahejlsberg Apr 24, 2024
f9a132b
Fix formatting
ahejlsberg Apr 24, 2024
d616ca0
Fix comment
ahejlsberg Apr 25, 2024
474a34b
Exclude methods from strict checking
ahejlsberg Apr 25, 2024
3ee4e91
Add more tests
ahejlsberg Apr 25, 2024
5afbd2c
Remove test
ahejlsberg Apr 26, 2024
dbd7d0b
Accept new baselines
ahejlsberg Apr 29, 2024
f3bdc07
Merge branch 'main' into enforceReadonly
ahejlsberg Jul 15, 2024
90ce450
Exclude comparable relation from strict readonly checking
ahejlsberg Jul 17, 2024
c8a66e0
Add more tests
ahejlsberg Jul 17, 2024
43cc32f
Align String.raw template parameter with TemplateStringsArray
ahejlsberg Jul 17, 2024
4a668c3
Accept new baselines
ahejlsberg Jul 17, 2024
4d1a5ff
Enable enforceReadonly mode
ahejlsberg Jul 17, 2024
5cf719a
Fix inconsistencies uncovered by --enforceReadonly
ahejlsberg Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Accept new baselines
ahejlsberg committed Jul 17, 2024
commit 4a668c321d43dabd90e886c4cfa1d7e60d50c141
8 changes: 4 additions & 4 deletions tests/baselines/reference/stringRawType.types
Original file line number Diff line number Diff line change
@@ -4,12 +4,12 @@
String.raw({ raw: ["foo", "bar", "baz"] }, 1, 2);
>String.raw({ raw: ["foo", "bar", "baz"] }, 1, 2) : string
> : ^^^^^^
>String.raw : (template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string
> : ^ ^^ ^^^^^ ^^ ^^^^^
>String.raw : (template: { readonly raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string
> : ^ ^^ ^^^^^ ^^ ^^^^^
>String : StringConstructor
> : ^^^^^^^^^^^^^^^^^
>raw : (template: { raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string
> : ^ ^^ ^^^^^ ^^ ^^^^^
>raw : (template: { readonly raw: readonly string[] | ArrayLike<string>; }, ...substitutions: any[]) => string
> : ^ ^^ ^^^^^ ^^ ^^^^^
>{ raw: ["foo", "bar", "baz"] } : { raw: string[]; }
> : ^^^^^^^^^^^^^^^^^^
>raw : string[]