Skip to content

Adds syntax highlighting to the code #132

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

Merged
merged 1 commit into from
Nov 22, 2019
Merged

Adds syntax highlighting to the code #132

merged 1 commit into from
Nov 22, 2019

Conversation

orta
Copy link
Contributor

@orta orta commented Nov 21, 2019

Two parts of the pipelining from #120

Screen Shot 2019-11-21 at 3 21 00 PM

@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 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 README.md

Line Typo
1 ### gatsby-remark-shiki
3 up code blocks to run through shiki:
20 want this really late in the plugin process if you have anything

Typos for React.md

Line Typo
10 * linting with [TSLint](https://github.com/palantir/
12 * state management with [Redux](https://github.com/reactjs/r
16 me that you're already using [Node.js](https://nodejs.org/) with [n
16 s](https://nodejs.org/) with [npm](https://www.npmjs.com/).
36 [react-scripts-ts](https://www.npmjs.com/packag
55 stores the settings that our linter, [TSLint](https://github.com/
55 he settings that our linter, [TSLint](https://github.com/palantir/
151 t takes a Props object, and destructures it.
180 For our application's lifecycle, we will revisit how applicat
180 ons manage general state with Redux in a bit.
233 reate-react-app uses (namely, Webpack and various loaders) allow us
233 ) allow us to just import the stylesheets we're interested in.
254 ion includes a library called jsdom to allow us to simulate the D
254 the DOM and test its runtime behavior without a browser.
255 yme is similar, but builds on jsdom and makes it easier to make c
317 a useful library for creating composable views.
321 community uses libraries like Redux and MobX.
321 uses libraries like Redux and MobX.
323 [Redux](http://redux.js.org) relies
327 [MobX](https://mobx.js.org/) relies
331 There are various merits and tradeoffs to both.
332 Generally Redux tends to see more widespread
332 torial, we'll focus on adding Redux;
336 ou [familiarize yourself with Redux through its documentation](ht
340 It doesn't make sense to add Redux unless the state of our appli
346 ## Installing Redux
348 To add Redux, we'll first install redux
354 nstall @types/redux because Redux already comes with its own de
358 the shape of the state which Redux will store.
388 s in an easily accessible and refactorable way.
422 to look into libraries like [redux-actions](https://www.npmjs.com/packag
457 Consider looking into Jest's [toEqual](https://facebook.github.io/j
461 When writing with Redux, we will often write componen
464 re about this concept on [Dan Abramov's article *Presentational and C
513 s the connect function from react-redux.
600 src/containers/Helloand use **react-redux's**Provider` to wire up our pro
624 ample, if you'd like to add a Webpack plugin, it might be necessary
624 f you'd like to add a Webpack plugin, it might be necessary to tak
642 till want to learn more about Redux, you can [check out the offic
643 The same goes [for MobX](https://mobx.js.org/).
645 know a little bit more about Webpack.
646 ou can check out our [React & Webpack walkthrough here](./React%20&
646 heck out our [React & Webpack walkthrough here](./React%20&%20Webpack.m
649 probably the most popular for Redux projects, and is often used i
649 ten used in conjunction with [react-router-redux](https://github.com/reactjs/r

Typos for React & Webpack.md

Line Typo
6 t](https://reactjs.org/) and [webpack](https://webpack.js.org/).
10 me that you're already using [Node.js](https://nodejs.org/) with [n
10 s](https://nodejs.org/) with [npm](https://www.npmjs.com/).
31 the TypeScript compiler, then webpack, and end up in a main.js fi
43 Webpack will eventually generate the
47 e'll turn this folder into an npm package.
57 First ensure Webpack is installed.
63 Webpack is a tool that will bundle yo
77 ent-time dependencies on the [ts-loader](https://www.npmjs.com/packag
83 ncies will let TypeScript and webpack play well together.
84 ts-loader helps Webpack compile your Ty
84 ts-loader helps Webpack compile your TypeScript code
85 source-map-loader uses any sourcemap outputs from TypeScript to in
85 uts from TypeScript to inform webpack when generating its own sou
85 ack when generating its own sourcemaps.
88 Please note that ts-loader is not the only loader for ty
189 React and React-DOM's npm packages include standalo
189 React and React-DOM's npm packages include standalone `
189 ct-DOM's npm packages include standalone .js files that you can incl
191 Facebook makes CDN-hosted versions of React available,
193 # Create a webpack configuration file
245 the "namespace pattern", and webpack allows us to continue leverag
246 entry for "react": "React", webpack will work its magic to make a
248 learn more about configuring webpack [here](https://webpack.js.org
258 open up index.html in your favorite browser and everything should

Typos for Migrating from JavaScript.md

Line Typo
87 with common build tools like Browserify, Babelify, and Uglify.
87 build tools like Browserify, Babelify, and Uglify.
90 ## Webpack
92 Webpack integration is pretty simple.
135 The same goes for [ts-loader](https://github.com/TypeStron
135 another TypeScript loader for Webpack.
138 u can see an example of using Webpack in our [tutorial on React and
138 in our [tutorial on React and Webpack](./React%20&%20Webpack.md).
155 for you, you can tighten that behavior up.
192 If you had the following Node/CommonJS code:
200 or the following RequireJS/AMD code:
229 hat, you'll be able to import lodash with no issues, and get accur

Typos for Gulp.md

Line Typo
6 p://gulpjs.com) and then add [Browserify](http://browserify.org), [ugl
6 isperator.net/uglifyjs/), or [Watchify](https://github.com/substack/
7 ljs.io/) functionality using [Babelify](https://github.com/babel/bab
9 me that you're already using [Node.js](https://nodejs.org/) with [n
9 s](https://nodejs.org/) with [npm](https://www.npmjs.com/).
40 e'll turn this folder into an npm package.
61 ge/gulp-typescript) is a gulp plugin for Typescript.
120 Before we get to Browserify, let's build our code out and
161 le syntax, TypeScript emitted CommonJS modules that Node uses.
162 We'll stick with CommonJS for this tutorial, but you co
164 # Browserify
168 tunately, that's exactly what Browserify does.
169 en better, it lets us use the CommonJS module system used by Node, w
172 First, install browserify, [tsify](https://www.npmjs.co
172 First, install browserify, [tsify](https://www.npmjs.com/packag
173 tsify is a Browserify plugin that,
173 tsify is a Browserify plugin that, like gulp-typesc
173 tsify is a Browserify plugin that, like gulp-typescript, g
174 s us adapt the file output of Browserify back into a format that gulp
212 Now change your gulpfile to the following:
245 lso changed default to call Browserify with the tsify plugin instead
245 ` to call Browserify with the tsify plugin instead of gulp-typesc
245 all Browserify with the tsify plugin instead of gulp-typescript.
253 we specified debug: true to Browserify.
254 This causes tsify to emit source maps inside th
259 # Watchify, Babel, and Uglify
261 we are bundling our code with Browserify and tsify, we can add various
261 our code with Browserify and tsify, we can add various features
261 us features to our build with browserify plugins.
261 to our build with browserify plugins.
263 * Watchify starts gulp and keeps it runn
271 ## Watchify
273 We'll start with Watchify to provide background compila
279 Now change your gulpfile to the following:
321 n('update', bundle);so that **Browserify** will run thebundle` functio
325 r default a name since both Watchify and Gulp need to call it.
347 d to install vinyl-buffer and gulp-sourcemaps to keep sourcemaps working.
347 r and gulp-sourcemaps to keep sourcemaps working.
353 Now change your gulpfile to the following:
391 ourcemaps` exist to make sure sourcemaps keep working.
392 hese calls give us a separate sourcemap file instead of using inline
392 file instead of using inline sourcemaps like before.
402 First install Babelify and the Babel preset for ES20
403 Like Uglify, Babelify mangles code, so we'll need v
403 o we'll need vinyl-buffer and gulp-sourcemaps.
404 By default Babelify will only process files with
404 ts` extension as an option to Babelify.
410 Now change your gulpfile to the following:

Typos for Library Structures.md

Line Typo
29 r example, if you were using [jQuery](https://jquery.com/), the `$
73 * CommonJS/Node.js-style imports of the
73 * CommonJS/Node.js-style imports of the form `va
90 mple, express only works in Node.js and must be loaded using the
90 and must be loaded using the CommonJS require function.
92 2015, ECMAScript 6, and ES6), CommonJS, and RequireJS have similar n
92 pt 6, and ES6), CommonJS, and RequireJS have similar notions of *impo
93 In JavaScript CommonJS (Node.js), for example, you w
93 In JavaScript CommonJS (Node.js), for example, you would writ
135 Many popular Node.js libraries are in the module f
140 y popular libraries, such as [Moment.js](http://momentjs.com/), are w
141 For example, in Node.js or using RequireJS, you would
141 example, in Node.js or using RequireJS, you would write:
173 often demonstrate a "Using in Node.js" example showing require,
179 Examples include [jQuery](https://jquery.com/), [Momen
179 Query](https://jquery.com/), [Moment.js](http://momentjs.com/), [loda
179 t.js](http://momentjs.com/), [lodash](https://lodash.com/), and ma
208 ## Module Plugin or UMD Plugin
208 ## Module Plugin or UMD Plugin
210 A module plugin changes the shape of another
211 For example, in Moment.js, moment-range adds a new `r
219 ## Global Plugin
221 A global plugin is global code that changes
226 ### Identifying global plugins
228 Global plugins are generally easy to identif
256 al, they're similar to global plugins, but need a require call to
333 low is to only declare types namespaced by whatever global variable
351 # The Impact of ES6 on Module Plugins
353 Some plugins add or modify top-level expor
354 While this is legal in CommonJS and other loaders, ES6 module

Typos for Variable Declarations.md

Line Typo
9 to avoid some of the common "gotchas" that users run into in JavaS
146 intimately familiar with this behavior, but if you're surprised, you
365 ns have drastically different behavior when declared as part of a lo
440 # Destructuring
442 eature that TypeScript has is destructuring.
446 ## Array destructuring
448 The simplest form of destructuring is array destructuring assign
448 orm of destructuring is array destructuring assignment:
465 Destructuring works with already-declared v
505 ## Tuple destructuring
507 Tuples may be destructured like arrays; the destructurin
507 destructured like arrays; the destructuring variables get the types of th
515 It's an error to destructure a tuple beyond the range of i
521 As with arrays, you can destructure the rest of the tuple with `.
535 ## Object destructuring
537 You can also destructure objects:
551 Like array destructuring, you can have assignment with
586 o be written after the entire destructuring:
607 Destructuring also works in function declar
617 d getting defaults right with destructuring can be tricky.
629 or optional properties on the destructured property instead of the main
641 Use destructuring with care.
642 es, anything but the simplest destructuring expression is confusing.
643 ially true with deeply nested destructuring, which gets really hard to
644 Try to keep destructuring expressions small and simple.
645 ys write the assignments that destructuring would generate yourself.
649 d operator is the opposite of destructuring.
659 This gives bothPlus the value `[0, 1, 2, 3, 4, 5]

Typos for Classes.md

Line Typo
67 ase classes are often called superclasses.
128 hat each member be explicitly labeled public to be visible.
253 # Readonly modifier
255 You can make properties readonly by using the readonly keywo
256 Readonly properties must be initialize
272 example, we had to declare a readonly member name and a construct
342 o prove to ourselves that our accessor is now checking the length of
347 Downleveling to ECMAScript 3 is not suppor

Typos for Advanced Types.md

Line Typo
30 [Enum Member Types](#enum-member-ty
55 e intersection types used for mixins and other concepts that don't
55 n the classic object-oriented mold.
57 le that shows how to create a mixin:
179 Union types are useful for modeling situations when values can ov
309 , let's borrow our industrial string-padder example from earlier:
361 The inventor of null, Tony Hoare, calls this his ["billion dol
543 hese features together to get enum-like behavior with strings.
543 res together to get enum-like behavior with strings.
607 # Enum Member Types
609 mentioned in [our section on enums](./Enums.md#union-enums-and-e
609 enums-and-enum-member-types), enum members have types when every
611 pes", we're referring to both enum member types as well as numer
892 Or we might want a readonly version:
982 example, if Person.name was readonly, Partial<Person>.name would
982 artial.name` would be readonly and optional.

Lighthouse Scores

/
Performance Accessibility Best Practices SEO Progressive Web App
0.96 0.9 0.93 0.7 1
/tsconfig
Performance Accessibility Best Practices SEO Progressive Web App
0.91 0.9 1 0.8 0.96
/docs/handbook/integrating-with-build-tools.html
Performance Accessibility Best Practices SEO Progressive Web App
0.96 0.9 1 0.77 0.96

Snapshots updated

backstop_default_Old_Handbook_Example_0_viewport_1_tablet.png
Before After
backstop_default_Old_Handbook_Example_0_viewport_2_computer.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 5397507

@orta orta merged commit 462bdee into v2 Nov 22, 2019
@jakebailey jakebailey deleted the code-syntax branch May 17, 2024 22:04
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.

1 participant