mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Update issue templates (#48261)
This commit is contained in:
parent
5f017df609
commit
7addca63ae
2
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/Bug_report.md
vendored
@ -4,7 +4,9 @@ about: Create a report to help us improve TypeScript
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Bug Report
|
||||
|
||||
<!--
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
2
.github/ISSUE_TEMPLATE/Feature_request.md
vendored
@ -4,7 +4,9 @@ about: Suggest an idea
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# Suggestion
|
||||
|
||||
<!--
|
||||
|
||||
113
.github/ISSUE_TEMPLATE/lib_change.md
vendored
113
.github/ISSUE_TEMPLATE/lib_change.md
vendored
@ -1,55 +1,58 @@
|
||||
---
|
||||
name: Library change
|
||||
about: Fix or improve issues with built-in type definitions like `lib.dom.d.ts`, `lib.es6.d.ts`, etc.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
---
|
||||
# lib Update Request
|
||||
|
||||
<!--
|
||||
Please fill in each section completely. Thank you!
|
||||
|
||||
Are you here for one of these commonly-requested lib changes?
|
||||
* Object.keys - see https://stackoverflow.com/questions/55012174/
|
||||
* Array methods - see https://github.com/microsoft/TypeScript/issues/36554
|
||||
* parseInt, parseFloat, isFinite, isNaN, etc. - see https://github.com/microsoft/TypeScript/issues/4002
|
||||
|
||||
The DOM lib is maintained elsewhere and you can skip a step by filing issues/PRs for the DOM at that repo.
|
||||
See https://github.com/microsoft/TypeScript-DOM-lib-generator
|
||||
-->
|
||||
|
||||
## Configuration Check
|
||||
|
||||
<!--
|
||||
If you're missing common new methods like Array.includes, you may have a misconfigured project.
|
||||
Try setting `lib: "es2020"` and checking whether the type you want is present.
|
||||
You can diagnose further by running `tsc` with `--listFilesOnly` or `--showConfig`.
|
||||
|
||||
Conversely, if you are seeing built-in methods you expect to *not* see, check your 'lib' setting
|
||||
or review your dependencies for lib/reference directives that might be polluting
|
||||
your global scope. This is common when using the 'node' type library. See https://github.com/microsoft/TypeScript/issues/40184
|
||||
|
||||
Replace the text below:
|
||||
-->
|
||||
My compilation *target* is `ES2015` and my *lib* is `the default`.
|
||||
|
||||
## Missing / Incorrect Definition
|
||||
|
||||
<!--
|
||||
What property, method, function, etc is missing or incorrect?
|
||||
-->
|
||||
|
||||
## Sample Code
|
||||
|
||||
<!--
|
||||
What's some code using this that should work, but doesn't?
|
||||
-->
|
||||
|
||||
## Documentation Link
|
||||
|
||||
<!--
|
||||
Link to relevant documentation (e.g. MDN, W3C, ECMAScript Spec) to consult for this property.
|
||||
Note that lib.dom.d.ts intentionally does not include browser-specific extensions
|
||||
or early experimental features.
|
||||
-->
|
||||
---
|
||||
name: Library change
|
||||
about: Fix or improve issues with built-in type definitions like `lib.dom.d.ts`, `lib.es6.d.ts`,
|
||||
etc.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
# lib Update Request
|
||||
|
||||
<!--
|
||||
Please fill in each section completely. Thank you!
|
||||
|
||||
Are you here for one of these commonly-requested lib changes?
|
||||
* Object.keys - see https://stackoverflow.com/questions/55012174/
|
||||
* Array methods - see https://github.com/microsoft/TypeScript/issues/36554
|
||||
* parseInt, parseFloat, isFinite, isNaN, etc. - see https://github.com/microsoft/TypeScript/issues/4002
|
||||
|
||||
The DOM lib is maintained elsewhere and you can skip a step by filing issues/PRs for the DOM at that repo.
|
||||
See https://github.com/microsoft/TypeScript-DOM-lib-generator
|
||||
-->
|
||||
|
||||
## Configuration Check
|
||||
|
||||
<!--
|
||||
If you're missing common new methods like Array.includes, you may have a misconfigured project.
|
||||
Try setting `lib: "es2020"` and checking whether the type you want is present.
|
||||
You can diagnose further by running `tsc` with `--listFilesOnly` or `--showConfig`.
|
||||
|
||||
Conversely, if you are seeing built-in methods you expect to *not* see, check your 'lib' setting
|
||||
or review your dependencies for lib/reference directives that might be polluting
|
||||
your global scope. This is common when using the 'node' type library. See https://github.com/microsoft/TypeScript/issues/40184
|
||||
|
||||
Replace the text below:
|
||||
-->
|
||||
My compilation *target* is `ES2015` and my *lib* is `the default`.
|
||||
|
||||
## Missing / Incorrect Definition
|
||||
|
||||
<!--
|
||||
What property, method, function, etc is missing or incorrect?
|
||||
-->
|
||||
|
||||
## Sample Code
|
||||
|
||||
<!--
|
||||
What's some code using this that should work, but doesn't?
|
||||
-->
|
||||
|
||||
## Documentation Link
|
||||
|
||||
<!--
|
||||
Link to relevant documentation (e.g. MDN, W3C, ECMAScript Spec) to consult for this property.
|
||||
Note that lib.dom.d.ts intentionally does not include browser-specific extensions
|
||||
or early experimental features.
|
||||
-->
|
||||
|
||||
47
.github/ISSUE_TEMPLATE/types-not-correct-in-with-callback.md
vendored
Normal file
47
.github/ISSUE_TEMPLATE/types-not-correct-in-with-callback.md
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
name: Types Not Correct in/with Callback
|
||||
about: TypeScript assuming the wrong type either after a callback runs, or within
|
||||
a callback
|
||||
title: ''
|
||||
labels: Duplicate
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
TypeScript has two narrowing-related behaviors that are both intentional. Please do not log additional bugs on this; see #9998 for more discussion.
|
||||
|
||||
The first is that *narrowings are not respected in callbacks*. In other words:
|
||||
```ts
|
||||
function fn(obj: { name: string | number }) {
|
||||
if (typeof obj.name === "string") {
|
||||
// Errors
|
||||
window.setTimeout(() => console.log(obj.name.toLowerCase());
|
||||
}
|
||||
}
|
||||
```
|
||||
This is intentional since the value of `obj.name` "could" change types between when the narrowing occurred and when the callback was invoke. See also #11498
|
||||
|
||||
The second is that *function calls do not reset narrowings*. In other words:
|
||||
```ts
|
||||
function fn(obj: { name: string | number }) {
|
||||
if (typeof obj.name === "string") {
|
||||
console.log("Here");
|
||||
// Does not error
|
||||
console.log(obj.name.toLowerCase());
|
||||
}
|
||||
}
|
||||
```
|
||||
This is intentional behavior, *even though `console.log` could have mutated obj*. This rule is consistently applied, even with the function is in-principle inspectable to actually have side effects
|
||||
```ts
|
||||
function fn(obj: { name: string | number }) {
|
||||
if (typeof obj.name === "string") {
|
||||
mut();
|
||||
// Does not error
|
||||
console.log(obj.name.toLowerCase());
|
||||
}
|
||||
|
||||
function mut() {
|
||||
obj.name = 42;
|
||||
}
|
||||
}
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user