Skip to content

Instantly share code, notes, and snippets.

🐦
Tweet tweet

Orta orta

🐦
Tweet tweet
Block or report user

Report or block orta

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View i_have_a_crash.md

I have a tsc.js stack trace, how can I know what is happening?

Getting tsc into a debugger

Normally when you run npm run tsc or yarn tsc you are running ./node_modules/.bin/tsc, you can run that same command with a debugger attached by running node --inspect-brk ./node_modules/.bin/tsc which will launch up and wait for you to attach a debugger. Running this command should say something like:

Debugger listening on ws://127.0.0.1:9229/ef185d8c-fbb5-41d9-82ff-926b182cd5c1 For help, see: https://nodejs.org/en/docs/inspector

View _script_to_get_docs.js
const { readdirSync, readFileSync } = require('fs');
const { join, parse } = require('path');
const ts = require('typescript');
const fileToParse = join(__dirname, '../', 'src', 'index.ts')
let program = ts.createProgram([fileToParse], {});
program.getTypeChecker({});
const sourceFile = program.getSourceFile(fileToParse)
let optionsInterface, mainExport
View self_review_ts_dec_2019.md

Core Priorities

Briefly state your (2-5) core priorities that represent your primary areas of focus and the targeted business impact. Also include your critical indicators of success for each

  1. Lower the barrier of entry to adopting and understanding TypeScript. Will validate by re-requesting feedback from the community a second time like issues #31983 and hopefully it should be a new set of problems.

  2. Provide resources for people wanting to improve the TypeScript community. Validated by seeing more meetups, conferences rely on infra we provide.

  3. Make it easier to people wanting to build tooling around TypeScript. Some of this can be think this can be validated by making a community survey and comparing to internal feedback. I have some personal docs, and ideas in the website overview but would be good to get overall ideas.

View self_review_ts_dec_2019.md

Core Priorities

Briefly state your (2-5) core priorities that represent your primary areas of focus and the targeted business impact. Also include your critical indicators of success for each

  1. Lower the barrier of entry to adopting and understanding TypeScript. Will validate by re-requesting feedback from the community a second time like issues #31983 and hopefully it should be a new set of problems.

  2. Provide resources for people wanting to improve the TypeScript community. Validated by seeing more meetups, conferences rely on infra we provide.

  3. Make it easier to people wanting to build tooling around TypeScript. Some of this can be think this can be validated by making a community survey and comparing to internal feedback. I have some personal docs, and ideas in the website overview but would be good to get overall ideas.

View gist:3f56c1aec87a419d2b4a2a542f1f0d5b
Refactors:
[ { name: 'Add or remove braces in an arrow function' },
{ name: 'Convert export' },
{ name: 'Convert import' },
{ name: 'Convert parameters to destructured object' },
{ name: 'Extract Symbol' },
{ name: 'Extract type' },
{ name: 'Generate \'get\' and \'set\' accessors' },
{ name: 'Move to a new file' } ]
View pirate.md

#

Options fer All

It be the basic options. Aye

#

Incremental

Enable incremental compilation

View en.md

#

Basic Options

Additional Checks Copy

#

Incremental

Enable incremental compilation

@orta
orta / gist:9d932ae27dfa12b44ca4c10775a3eff6
Last active Oct 19, 2019
Notes on adding JSDoc -> d.ts support for JS libs
View gist:9d932ae27dfa12b44ca4c10775a3eff6

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
View gist:a9024566e233b7b37ea48139d9a5933b
package   small_ts ⍟14   ✔  17:00:44
package   small_ts ⍟14  ls lib  ✔  17:00:59
README.md lib.es2016.full.d.ts lib.es5.d.ts
cancellationToken.js lib.es2017.d.ts lib.es6.d.ts
cs lib.es2017.full.d.ts lib.esnext.array.d.ts
de lib.es2017.intl.d.ts lib.esnext.asynciterable.d.ts
diagnosticMessages.generated.json lib.es2017.object.d.ts lib.esnext.bigint.d.ts
es lib.es2017.sharedmemory.d.ts lib.esnext.d.ts
fr lib.es2017.string.d.ts lib.esnext.full.d.ts
it lib.es2017.typedarrays.d.ts lib.esnext.intl.d.ts
View deno-015.d.ts
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
declare namespace Deno {
/** The current process id of the runtime. */
export let pid: number;
/** Reflects the NO_COLOR environment variable: https://no-color.org/ */
export let noColor: boolean;
You can’t perform that action at this time.