Title: Suggestion: Export some internal type checking helpers · Issue #19602 · microsoft/TypeScript · GitHub
Open Graph Title: Suggestion: Export some internal type checking helpers · Issue #19602 · microsoft/TypeScript
X Title: Suggestion: Export some internal type checking helpers · Issue #19602 · microsoft/TypeScript
Description: I'm trying to implement a tslint custom rule to manually force and check yield typings inside of generator-based sagas from redux-saga. As the statuses of #2983 and similar issues are unknown it seems like custom rule is the only way for...
Open Graph Description: I'm trying to implement a tslint custom rule to manually force and check yield typings inside of generator-based sagas from redux-saga. As the statuses of #2983 and similar issues are unknown it se...
X Description: I'm trying to implement a tslint custom rule to manually force and check yield typings inside of generator-based sagas from redux-saga. As the statuses of #2983 and similar issues are unknown i...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/19602
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: Export some internal type checking helpers","articleBody":"I'm trying to implement a [tslint](https://github.com/palantir/tslint) custom rule to manually force and check yield typings inside of generator-based sagas from [redux-saga](https://redux-saga.js.org). As the statuses of #2983 and similar issues are unknown it seems like custom rule is the only way for now.\r\n\r\nSo, at the moment I'm able to only force setting explicit type on the left side of yield expression:\r\n```typescript\r\nconst timePeriod = yield select(FilterSelectors.timePeriod);\r\n ^^^ error from custom rule - value has implicit any type \r\n```\r\nThe next step is to extract the types of the left and right sides of such yield and it's possible with public `TypeChecker#getTypeFromTypeNode`. \r\nNow when both types are available they could be checked for assignability with helpers under `// TYPE CHECKING` section in `compiler/checker.ts` in `createTypechecker` factory function (like `checkTypeAssignableTo`), but unfortunately they are isolated inside that factory.\r\n\r\nTherefore I suggest exporting that helpers from `compiler/checker.ts` on the module-level (or under a namespace, or even as `TypeChecker` static fields), they will be very helpful for implementing such custom rules.","author":{"url":"https://github.com/raveclassic","@type":"Person","name":"raveclassic"},"datePublished":"2017-10-31T09:26:00Z","url":"https://github.com/microsoft/TypeScript/issues/19602"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1ef0e5a5-5487-64cf-4757-5db3e1a207bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E414:291B58:2D5ECA:397D38:6B0101F8 |
| html-safe-nonce | 89d358b22253ef461354031ce200393adee1f966d19ae9fc6067a3595c85cedb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDE0OjI5MUI1ODoyRDVFQ0E6Mzk3RDM4OjZCMDEwMUY4IiwidmlzaXRvcl9pZCI6Ijc3NTgxNzg1ODc4MDI5OTc2OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a77e41899304d3a6bdc8bbf4d03ae6a6bb100f3b6aa2182a8ef3a339a5e9419 |
| hovercard-subject-tag | issue:269889106 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/19602/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e719ac502e349e93df3f248a2de20097ba43437de9792a54592080a9205ac783/microsoft/TypeScript/issues/19602 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e719ac502e349e93df3f248a2de20097ba43437de9792a54592080a9205ac783/microsoft/TypeScript/issues/19602 |
| og:image:alt | I'm trying to implement a tslint custom rule to manually force and check yield typings inside of generator-based sagas from redux-saga. As the statuses of #2983 and similar issues are unknown it se... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | raveclassic |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width