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

Fill out the TS Config reference #121

Merged
merged 27 commits into from Dec 19, 2019
Merged

Fill out the TS Config reference #121

merged 27 commits into from Dec 19, 2019

Conversation

orta
Copy link
Contributor

@orta orta commented Nov 9, 2019

Separating this PR to only be (more or less) only text content for the reference so that it can be easier for the team to read and review once there's docs for every compiler flag.

General gist:
Screen Shot 2019-12-05 at 1 45 09 PM

I'm still not sold on whether the editor should live on the side, or a sidebar of all items.

PR Preview: https://typescript-v2-121.ortam.now.sh/tsconfig

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2019

Messages
📖

Deployed to a PR branch - tsconfig old handbook

Got false positives?

Make changes to the global settings spellcheck.json in /artsy/peril-settings.

Typos for useDefineForClassFields.md

Line Typo
5 ation has a different runtime behavior to TypeScript's implementatio
7 to the upcoming ECMA runtime behavior.

Typos for typeRoots.md

Line Typo
19 This config file will include all packa

Typos for typeAcquisition.md

Line Typo
5 ulesautomatically using the **DefinitelyTyped** set of@types` definitions.

Typos for target.md

Line Typo
8 changes which JS features are downleveled and which are left intact.
14 If your are only working with Node.js, here are recommended `target
22 These are based on [node.green](https://node.green)'s databa

Typos for stripInternal.md

Line Typo
5 @internal` annotation in it's JSDoc comment.
7 n your d.ts files, look at [api-extractor](https://api-extractor.com).

Typos for strict.md

Line Typo
5 a wide range of type checking behavior that results in stronger guar
10 will be added to disable that behavior.

Typos for sourceMap.md

Line Typo
5 Enables the generation of [sourcemap files](https://developer.mozi
9 files will in turn contain a sourcemap comment to indicate to tools
26 And this also generates this json map:

Typos for resolveJsonModule.md

Line Typo
5 ws importing modules with a '.json' extension, which is a common

Typos for removeComments.md

Line Typo
7 a TypeScript file which has a JSDoc comment:

Typos for pretty.md

Line Typo
5 ize errors and messages using color and context, this is on by de
6 single colored messages from the compiler.

Typos for preserveSymlinks.md

Line Typo
5 s to reflect the same flag in Node.js; which does not resolve the r
7 ag also exhibits the opposite behavior to Webpack’s `resolve.symlink
7 bits the opposite behavior to Webpack’s resolve.symlinks option (i.
7 ksto true parallels setting **Webpack’s**resolve.symlinks` to false,

Typos for preserveConstEnums.md

Line Typo
6 on at runtime by emitting the enum value instead of a reference.
23 The default const enum behavior is to convert any `Album.Some
24 to the enum from the JavaScript completel

Typos for plugins.md

Line Typo
5 List of language service plugins to run inside the editor.
7 Language service plugins are a way to provide addition
11 - [ts-sql-plugin](https://github.com/xialvjun/
12 - [typescript-styled-plugin](https://github.com/Microsoft
13 - [typescript-eslint-language-service](https://github.com/Quramy/ty
13 age-service) — Provides eslint error messaging and fix-its i
15 ally include language service plugins](https://code.visualstudio.co

Typos for outDir.md

Line Typo
6 urce files is preserved; see [rootDir](#rootDir) if the computed ro

Typos for out.md

Line Typo
5 Use [outFile](#outfile) instead.

Typos for noImplicitUseStrict.md

Line Typo
5 n emitting a module file to a non-ES6 target, TypeScript emits a `"

Typos for noFallthroughCasesInSwitch.md

Line Typo
5 Report errors for fallthrough cases in switch statement.
7 on't accidentally ship a case fallthrough bug.

Typos for noEmitHelpers.md

Line Typo
27 be switched out with your own globals via this flag:

Typos for noEmit.md

Line Typo
7 bel](https://babeljs.io), or [swc](https://github.com/swc-proje

Typos for moduleResolution.md

Line Typo
5 resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre
5 .js) or 'classic' (TypeScript pre-1.6). You probably won't need t

Typos for mapRoot.md

Line Typo
17 are that index.js will have sourcemaps at `https://my-website.com/de

Typos for lib.md

Line Typo
10 pt API objects (maybe through polyfills), but doesn't yet support the
11 * You have polyfills or native implementations for
23 available in ES2018 - async iterables, promise.finally, `Intl.Plu
26 Additional APIs available in ESNext - This changes as the JavaScr
28

Typos for keyofStringsOnly.md

Line Typo
7 used to help people keep this behavior from [before TypeScript 2.9's

Typos for isolatedModules.md

Line Typo
10 interpreted by a single-file transpilation process.
11 It does not change the behavior of your code, or otherwise ch
11 code, or otherwise change the behavior of TypeScript's checking and

Typos for inlineSourceMap.md

Line Typo
7 t want to debug JS files on a webserver that doesn't allow .map fil

Typos for incremental.md

Line Typo
9 files to be built to, use the config option [tsBuildInfoFile](#t

Typos for importHelpers.md

Line Typo
5 For certain downleveling operations, TypeScript uses s
5 eading arrays or objects, and async operations.
9 re instead imported from the [tslib](https://www.npmjs.com/packag

Typos for generateCpuProfile.md

Line Typo
5 nce to have TypeScript emit a v8 CPU profile during the compil

Typos for files.md

Line Typo
5 Specifies an allowlist of files to include in the pr

Typos for extends.md

Line Typo
6 The path may use Node.js style resolution.
8 en by those in the inheriting config file. All relative paths foun
10 exclude from the inheriting config file overwrite those from t
11 base config file, and that circularity be

Typos for esModuleInterop.md

Line Typo
5 emit interoperability between CommonJS and ES Modules via creation o
7 TypeScript adheres to the EcmaScript standard for modules, which m
9 attern is rare in modules for CommonJS. For example, without `esModu

Typos for downlevelIteration.md

Line Typo
5 Downleveling is TypeScript's term for tran
6 concepts in older JavaScript runtimes.
13 r / ofloop on any object is **downleveled** to a traditionalfor` loop:
24 % compliant with ECMAScript 6 behavior.
28 lementation (either native or polyfill).
52 escription, it sounds easy to downlevel to ES5:
60 l create an own property if spreaded, but will not if built using
74 more accurately emulate ES 6 behavior.

Typos for disableSourceOfProjectReferenceRedirect.md

Line Typo
5 ides a way to go [back to the pre-3.7](/docs/handbook/release-not
5 ting-with-project-references) behavior where d.ts files were used to
5 ct-references) behavior where d.ts files were used to as the bou

Typos for declarationDir.md

Line Typo
25 Would place the d.ts for the index.ts in a `type

Typos for declaration.md

Line Typo
7 s like TypeScript can provide intellisense and accurate types for un-typ
7 isense and accurate types for un-typed code.

Typos for charset.md

Line Typo
6 t UTF-16 (BE and LE) or UTF-8 BOMs.

Typos for alwaysStrict.md

Line Typo
7 ntroduced in ES5 and provides behavior tweaks to the runtime of the

Typos for allowUmdGlobalAccess.md

Line Typo
5 ets you access UMD exports as globals from inside module files. A m
7 the particular library (like jQuery or Lodash) will always be ava
7 cular library (like jQuery or Lodash) will always be available at

Typos for allowSyntheticDefaultImports.md

Line Typo
20 This option brings the behavior of TypeScript in-line with Ba

Typos for README.md

Line Typo
1 ### Generating the TSConfig Reference
3 ts multi-lingual docs for the TSConfig. As much as possible is based
27 The TSConfig reference is created by a two
30 cs which are picked up by the typescriptlang-org Gatsby site at `http://localh
40 You can validate any codeblocks which use twoslasher via the
40 date any codeblocks which use twoslasher via the script:
52 You can debug twoslash by setting the environment va

Typos for README.md

Line Typo
1 # TypeScript TwoSlasher
4 by the [fourslash test system](https://github.c
13 ndling showing the results of transpilation with certain flags
21 - Think about how to ship to npm
24 The twoslash markup API lives inside your
45 Finally you can set any tsconfig compiler flag using this synt
446 ebug logs by running with the env var of DEBUG="*".
454 is optimized and bundled with Rollup into multiple formats (Common
454 Rollup into multiple formats (CommonJS, UMD, and ES Module).

Lighthouse Scores

/

Performance Accessibility Best Practices SEO Progressive Web App
0.91 1 0.93 0.89 0.96

/tsconfig

Performance Accessibility Best Practices SEO Progressive Web App
0.92 0.99 1 0.91 0.96

/docs/handbook/integrating-with-build-tools.html

Performance Accessibility Best Practices SEO Progressive Web App
0.96 1 1 0.89 0.96

Snapshots updated

backstop_default_TSConfig_Example_0_viewport_0_phone.png
Before After
backstop_default_TSConfig_Example_0_viewport_1_tablet.png
Before After
backstop_default_TSConfig_Example_0_viewport_2_computer.png
Before After

Generated by 🚫 dangerJS against 1de0e0c

@orta orta changed the title Consolidated some of my own notes for the TSConfig docs Fill out the TS Config reference Nov 14, 2019
@orta orta changed the base branch from tsconfig-meta to v2 November 14, 2019 19:32
@orta orta mentioned this pull request Nov 19, 2019
@orta orta marked this pull request as ready for review December 10, 2019 23:30
Copy link
Contributor

@elibarzilay elibarzilay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All should be taken as cosmetic comments.

packages/gatsby-remark-shiki/index.js Outdated Show resolved Hide resolved
Comment on lines 32 to 34
const isError = errors.find(e => {
return e.character <= pos && e.character + e.length >= pos + token.content.length
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(That's a step in the opposite direction from what I'd do :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not wrong, but it became much easier to debug this way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orta, so now I'm curious -- how did it become easier?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made it easier to switch the function to log like this:

const findTokenDebug = start => e => {
  const result = start <= e.character && start + token.content.length <= e.character + e.length

  console.log(result, start, '<=', e.character, '&&', start + token.content.length, '<=', e.character + e.length)
  return result
}

and jump back and forth, in the current version I'm working on I just have a separate debug logging function instead

packages/sandbox/src/startPlayground.ts Show resolved Hide resolved
packages/ts-twoslasher/README.md Outdated Show resolved Hide resolved
packages/ts-twoslasher/src/index.ts Outdated Show resolved Hide resolved
packages/tsconfig-reference/copy/en/options/typeRoots.md Outdated Show resolved Hide resolved
}
```

This `tsconfig.json` file will *only* include `./node_modules/@types/node`, `./node_modules/@types/lodash` and `./node_modules/@types/express`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:

node, lodash, and express in the ./node_modules/@types directory.

instead?

(Also, double space after "include".)

```

This `tsconfig.json` file will *only* include `./node_modules/@types/node`, `./node_modules/@types/lodash` and `./node_modules/@types/express`.
Other packages under `node_modules/@types/*` will not be included.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe compare to the previous option?

---

This flag is used as a part of migrating to the upcoming standard version of how class fields works. TypeScript introduced class fields many years before it was ratified in TC39, where it had a different runtime behavior but the same syntax. This flag switches to the ECMA runtime behavior.
This flag is used as a part of migrating to the upcoming standard version of how class fields works. TypeScript introduced class fields many years before it was ratified in TC39. The latest version of the upcoming specification has a different runtime behavior to TypeScript's implementation but the same syntax.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"... used as a part of ..."

"standard version of how class fields works."

packages/tsconfig-reference/scripts/lint.js Show resolved Hide resolved
Copy link
Contributor

@elibarzilay elibarzilay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All should be taken as cosmetic comments.

@orta
Copy link
Contributor Author

orta commented Dec 19, 2019

Alright, I'm going to merge this and to get the ball rolling - I will still take feedback in here and just merge it into v2

@orta orta merged commit 19b0750 into v2 Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants