Skip to content

Instantly share code, notes, and snippets.

View orta's full-sized avatar
🥂

Orta Therox orta

🥂
View GitHub Profile
@orta
orta / rfc.md
Last active February 20, 2024 02:23
A proposal for improving TS2322 error messages

This is a work in progress. Please don't take this as something that will definitely happen, we all know what happens to well laid plans and I need to present it to the rest of the TypeScript team in order to figure out a lot of feasibility questions.

Intro

The examples in this PR assumes [CLI DX] Improve positioning of compiler error messaging info #45717 is merged

In 4.4, all diagnostic messages from TypeScript are treated the same, we have a massive .JSON file of ±2000 diagnostic messages which are used everywhere from compiler messages to CLI help. Aside from some simple string manipulation, these are effectively what we output for all error messages. I'd like to propose that we break this pattern, just for error TS2322.

TS2322 is our 'type x is not assignable to y' error, you'd see it for const str: string = 123 and I expect it is the most seen

@orta
orta / me.txt
Last active June 19, 2023 12:09
whoami
Since 2013 I've worked entirely in the open, lowering the barriers to different
developer ecosystems as one of the most active users on GitHub.
I've helped big OSS projects with design, project management and occasionally code.
@orta
orta / main.gif
Last active June 19, 2023 12:09
Yesterday's PRs:
main.gif
@orta
orta / Issue.md
Last active April 29, 2023 08:19
Disclosable Sections in a GH issue
Summary text. Hello World, how is it going?
@orta
orta / 0 ~ Intro.md
Last active March 14, 2023 01:53
Type | Treats 2020

The Challenge

Welcome to TypeScript's first ever set of virtual code challenges: Type | Treat (or "Type or Treat")! We will be presenting some "spooky" code challenges that will allow you to get deeper into the TypeScript language but in a fun way.

Starting tomorrow, a new code challenge will be posted every weekday, along with its solution the day after. The last solution will be posted on Halloween day.

Are The Challenges For TypeScript Developers Only?

Absolutely not! We want all developers, familiar with TypeScript or not to be apart of Type | Treat. Every day will have two different types of challenges, one for beginners/learners and one for intermediate/advanced developers. That way everyone can participate.

@orta
orta / gist:9d932ae27dfa12b44ca4c10775a3eff6
Last active January 19, 2023 03:31
Notes on adding JSDoc -> d.ts support for JS libs

Command to add:

yarn tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js

or via npx

npx -p typescript@next tsc --declaration --emitDeclarationOnly --allowJs --lib es2015 lib/*.js
name download_total
AFNetworking 61983241
Fabric 50998892
Crashlytics 49667729
SDWebImage 45471101
Alamofire 42097177
CocoaLumberjack 36071914
Bolts 35294870
FirebaseInstanceID 30277793
FirebaseAnalytics 30254593
@orta
orta / index.md
Last active June 2, 2022 16:56
My Playground Preview

TSNYC Jan 2020


What is TypeScript?

TypeScript extends JavaScript by adding types.

@orta
orta / pong.lua
Created April 23, 2022 17:50
A trivial version of pong for the playdate
import "CoreLibs/sprites"
import "CoreLibs/graphics"
playdate.display.setRefreshRate(20)
local gfx = playdate.graphics
local spritelib = gfx.sprite
local screenWidth = playdate.display.getWidth()
local screenHeight = playdate.display.getHeight()
https://ortastuff.s3.amazonaws.com/gifs/bike.gif
https://ortastuff.s3.amazonaws.com/gifs/bug-hunting.gif
https://ortastuff.s3.amazonaws.com/gifs/cheers-boxing.gif
https://ortastuff.s3.amazonaws.com/gifs/clap-2.gif
https://ortastuff.s3.amazonaws.com/gifs/clap.gif
https://ortastuff.s3.amazonaws.com/gifs/danger.gif
https://ortastuff.s3.amazonaws.com/gifs/delisa-nah.gif
https://ortastuff.s3.amazonaws.com/gifs/delisa-one-thumb.gif
https://ortastuff.s3.amazonaws.com/gifs/delisa-two-thumbs-2.gif
https://ortastuff.s3.amazonaws.com/gifs/delisa-two-thumbs.gif