Skip to content

Commit 24d1cf6

Browse files
authored
Merge pull request #45 from doug-wade/add-linting-ci
Add linting ci
2 parents 0a69b12 + 981f5d2 commit 24d1cf6

File tree

5 files changed

+67
-43
lines changed

5 files changed

+67
-43
lines changed

.github/workflows/lint.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [18.x, 20.x]
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'yarn'
29+
30+
- name: Install dependencies
31+
run: yarn
32+
33+
- name: Build
34+
run: yarn build
35+
36+
- name: Run linter
37+
run: yarn lint

presentation/console.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ import {
44
Box,
55
CodePane,
66
Deck,
7-
FlexBox,
8-
FullScreen,
97
Heading,
108
Image,
11-
ListItem,
129
Notes,
13-
Progress,
14-
Quote,
1510
Slide,
1611
Text,
17-
UnorderedList,
1812
} from "spectacle";
1913

2014
const images = {
@@ -33,8 +27,8 @@ const images = {
3327
const Presentation = () => (
3428
<Deck>
3529
<Slide>
36-
<Heading>Using Chrome's console</Heading>
37-
<Heading fontSize="h3">It's not just console.log anymore</Heading>
30+
<Heading>Using Chrome&apos;s console</Heading>
31+
<Heading fontSize="h3">It&apos;s not just console.log anymore</Heading>
3832
<Text>
3933
Created by <a href="http://github.com/doug-wade">Doug Wade</a> / <a href="https://mastodon.xyz/@dougwade">@dougwade</a>
4034
</Text>
@@ -170,7 +164,7 @@ console.dir(characters[3]);
170164
console.table(characters);`}
171165
</CodePane>
172166
<Notes>
173-
Here's code with dates to show dates
167+
Here&apos;s code with dates to show dates
174168
<CodePane language="javascript">{`
175169
console.dir({ name: 'Archer', age: 37, aliases: ['Duchess', 'Randy'], created: new Date() });
176170
`}</CodePane>

presentation/meet-react-server.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ import {
44
Box,
55
CodePane,
66
Deck,
7-
FlexBox,
8-
FullScreen,
97
Heading,
108
Image,
119
ListItem,
1210
UnorderedList,
1311
Notes,
14-
Progress,
1512
Slide,
1613
Text
1714
} from "spectacle";
@@ -40,27 +37,27 @@ const Presentation = () => (
4037
<UnorderedList>
4138
<ListItem>Thank Max Stoiber for the intro to css</ListItem>
4239
<ListItem>Express excitement to be in Amsterdam</ListItem>
43-
<ListItem>Going to talk about my favorite FOSS project, though we'll see after James Kyle's talk ;)</ListItem>
40+
<ListItem>Going to talk about my favorite FOSS project, though we&apos;ll see after James Kyle&apos;s talk ;)</ListItem>
4441
</UnorderedList>
4542
</Notes>
4643
</Slide>
4744

4845
<Slide>
49-
<Heading>What's wrong?</Heading>
46+
<Heading>What&apos;s wrong?</Heading>
5047
<Heading fontSize="h3">Javascript Fatigue</Heading>
5148
<Image width="65%" src={images.jsFatigue} />
5249

5350
<Notes>
5451
<UnorderedList>
5552
<ListItem>There are too many tools, and they change too often.</ListItem>
56-
<ListItem>The tooling is complicated to set up, and inaccessible for "joe and jane developer".</ListItem>
53+
<ListItem>The tooling is complicated to set up, and inaccessible for &quot;joe and jane developer&quot;.</ListItem>
5754
<ListItem>it took us many months/tries/mistakes to get a universal react app working well.</ListItem>
5855
</UnorderedList>
5956
</Notes>
6057
</Slide>
6158

6259
<Slide>
63-
<Heading>What's wrong?</Heading>
60+
<Heading>What&apos;s wrong?</Heading>
6461
<Heading fontSize="h3">Slow Internet</Heading>
6562
<Image width="65%" src={images.mobileVsFixed} />
6663
<Text>Credit/Source: <a href="http://www.itu.int/en/ITU-D/Statistics/Pages/facts/default.aspx">ITU ICT Facts and Figures 2016</a></Text>
@@ -70,22 +67,22 @@ const Presentation = () => (
7067
<ListItem>From the The International Telecommunication Union, a branch of the UN</ListItem>
7168
<ListItem>Most internet users are on mobile.</ListItem>
7269
<ListItem>Most internet users are not in the first world.</ListItem>
73-
<ListItem>Most internet users don't have the patience to wait while your 4 MB bundle downloads</ListItem>
70+
<ListItem>Most internet users don&apos;t have the patience to wait while your 4 MB bundle downloads</ListItem>
7471
<ListItem>(47% of consumers expect a web page to load in 2 seconds or less).</ListItem>
7572
</UnorderedList>
7673
</Notes>
7774
</Slide>
7875

7976
<Slide>
80-
<Heading>What's wrong?</Heading>
77+
<Heading>What&apos;s wrong?</Heading>
8178
<Heading fontSize="h3">No Javascript</Heading>
8279
<Image src={images.noJs} />
8380

8481
<Notes>
8582
<UnorderedList>
8683
<ListItem>Primarily an SEO problem.</ListItem>
8784
<ListItem>Some users blocking because of ads or security.</ListItem>
88-
<ListItem>Has the added benefit of maintaining the "document" nature of the web</ListItem>
85+
<ListItem>Has the added benefit of maintaining the &quot;document&quot; nature of the web</ListItem>
8986
</UnorderedList>
9087
</Notes>
9188
</Slide>
@@ -101,7 +98,7 @@ const Presentation = () => (
10198
<Notes>
10299
<UnorderedList>
103100
<ListItem>
104-
They're p similar: they all come with a babel preset,
101+
They&apos;re p similar: they all come with a babel preset,
105102
webpack configuration
106103
</ListItem>
107104

@@ -193,8 +190,8 @@ const Presentation = () => (
193190
<Notes>
194191
<UnorderedList>
195192
<ListItem>Address impatient users by getting chunks on the page as soon as possible</ListItem>
196-
<ListItem>Prevent users from clicking on the wrong element when the page "jumps" (Dark Pattern)</ListItem>
197-
<ListItem>Treat the page like a document that "snaps in" as soon as it is ready</ListItem>
193+
<ListItem>Prevent users from clicking on the wrong element when the page &quot;jumps&quot; (Dark Pattern)</ListItem>
194+
<ListItem>Treat the page like a document that &quot;snaps in&quot; as soon as it is ready</ListItem>
198195
<ListItem>The page becomes interactive as soon as above-the-fold content is loaded but no sooner</ListItem>
199196
</UnorderedList>
200197
</Notes>
@@ -208,7 +205,7 @@ const Presentation = () => (
208205
<Notes>
209206
<UnorderedList>
210207
<ListItem>Send a bundle of data + code that was used for server rendering so the DOM render the same.</ListItem>
211-
<ListItem>client-side rendering "prequests" that the server ready a data bundle and hold it until the request</ListItem>
208+
<ListItem>client-side rendering &quot;prequests&quot; that the server ready a data bundle and hold it until the request</ListItem>
212209
</UnorderedList>
213210
</Notes>
214211
</Slide>
@@ -280,7 +277,7 @@ export default class ExamplePage {
280277
<Notes>
281278
<UnorderedList>
282279
<ListItem>Lifecycle methods are specially named methods that React Server calls as part of the page lifecycle</ListItem>
283-
<ListItem>React Server provides "best-guess" defaults for all lifecycle methods</ListItem>
280+
<ListItem>React Server provides &quot;best-guess&quot; defaults for all lifecycle methods</ListItem>
284281
<ListItem>This example adds meta tags and a title to the page head</ListItem>
285282
</UnorderedList>
286283
</Notes>
@@ -340,7 +337,7 @@ export default class ExamplePage {
340337
<Notes>
341338
<UnorderedList>
342339
<ListItem>External synchronous js file can significantly impact perf by blocking</ListItem>
343-
<ListItem>devs define css + js in a structured way so they can't tank perf</ListItem>
340+
<ListItem>devs define css + js in a structured way so they can&apos;t tank perf</ListItem>
344341
<ListItem>prepares us for http2 by creating a manifest of js + css to push</ListItem>
345342
<ListItem>body classes allow you to add classes to the generated body tag</ListItem>
346343
</UnorderedList>
@@ -482,7 +479,7 @@ navigator.on("loadComplete", onLoadComplete);`}
482479
</Slide>
483480

484481
<Slide>
485-
<Heading>What's next?</Heading>
482+
<Heading>What&apos;s next?</Heading>
486483
<UnorderedList>
487484
<ListItem>Webpack (and hmr!) on the server</ListItem>
488485
<ListItem>Clustering</ListItem>

presentation/python-at-redfin.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ const Presentation = () => (
4848
<Text>Platforms team</Text>
4949

5050
<Notes>
51-
I'm mostly a javascriptista, but Python was the first language I liked
52-
I've been at Redfin almost a year
51+
I&apos;m mostly a javascriptista, but Python was the first language I liked
52+
I&apos;ve been at Redfin almost a year
5353
I work mostly on front end build, especially performance
5454
</Notes>
5555
</Slide>
@@ -71,7 +71,7 @@ const Presentation = () => (
7171
<ListItem>walk score deployments</ListItem>
7272
</UnorderedList>
7373
<Notes>
74-
These are smaller uses; just emphasizing Python's ubiquity
74+
These are smaller uses; just emphasizing Python&apos;s ubiquity
7575
Our nagios alerts are a subset used to monitor Jenkins
7676
Our test team uses python to run performance tests against the site
7777
The data team uses python for listings imports, photos
@@ -89,7 +89,7 @@ const Presentation = () => (
8989
</OrderedList>
9090

9191
<Notes>
92-
We're currently working on creating a continuous deployment pipeline
92+
We&apos;re currently working on creating a continuous deployment pipeline
9393
Many parts of the are written in Python
9494
Our Python is rapidly growing
9595
</Notes>
@@ -112,7 +112,7 @@ const Presentation = () => (
112112
<Notes>
113113
Written at Google, uses hermeticism to guarantee reproducability, and a distributed artifact cache for performance
114114
This is a big part of our move to continuous deployment, to get builds under 6 minutes
115-
We've struggled with our module builds because of npm violations of bazel assumptions
115+
We&apos;ve struggled with our module builds because of npm violations of bazel assumptions
116116
</Notes>
117117
</Slide>
118118

@@ -155,7 +155,7 @@ external_npm_module = rule(
155155
<Notes>
156156
Used almost exclusively for deployments
157157
Is managed by a Google doc that is translated to xml and then updates the google doc with timing data
158-
Manage everything except a small subset of ops boxes that aren't deployed to
158+
Manage everything except a small subset of ops boxes that aren&apos;t deployed to
159159
</Notes>
160160
</Slide>
161161

@@ -297,19 +297,19 @@ $ pip install https://github.com/redfin/dirpy/zipball/master`}
297297
</Slide>
298298

299299
<Slide>
300-
<Heading>We're Hiring!</Heading>
300+
<Heading>We&apos;re Hiring!</Heading>
301301
<Heading fontSize="h3"><a href="http://www.redfin.com/about/jobs/hq">Jobs site</a></Heading>
302302
<Text>Contact us: <a href="mailto:[email protected]">[email protected]</a></Text>
303303
</Slide>
304304

305305
<Slide>
306306
<Heading>Questions?</Heading>
307307
<Quote>
308-
This couldn't possibly work, could it? It can't be that easy, can it? But it works! - Dan Fabulich
308+
This couldn&apos;t possibly work, could it? It can&apos;t be that easy, can it? But it works! - Dan Fabulich
309309
</Quote>
310310
<Notes>
311-
Mostly, our experience in Python has been: it shouldn't be this easy, but it is
312-
Dan / jlo's story about starting a thread / process pool
311+
Mostly, our experience in Python has been: it shouldn&apos;t be this easy, but it is
312+
Dan / jlo&apos;s story about starting a thread / process pool
313313
</Notes>
314314
</Slide>
315315
</Deck>

presentation/walk-score-api.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ import {
44
Box,
55
CodePane,
66
Deck,
7-
FlexBox,
8-
FullScreen,
97
Heading,
108
Image,
119
ListItem,
1210
OrderedList,
13-
Progress,
14-
Quote,
1511
Slide,
1612
Text,
1713
UnorderedList,
@@ -274,7 +270,7 @@ router.get('/api/stop/:id', function *() {
274270
"distance": 0.0437115618187228
275271
, "name": "1ST AVE & LENORA ST"
276272
, "summary_text": "1ST AVE & LENORA ST (0.0 mi)\t99, 121"
277-
, "summary_html": "<span class=\"walkscore\"><span class=\"stop\">1ST AVE &amp; LENORA ST</span> <span class=\"distance\">(0.0 mi)</span> <span class=\"Bus\">99, 121</span></span>"
273+
, "summary_html": "<span class="walkscore"><span class="stop">1ST AVE &amp; LENORA ST</span> <span class="distance">(0.0 mi)</span> <span class="Bus">99, 121</span></span>"
278274
, "route_summary": [
279275
{
280276
"category": "Bus"
@@ -372,8 +368,8 @@ function getRoute() {
372368
<CodePane language="javascript">{`
373369
function linestringToCoordinates(linestring) {
374370
return linestring
375-
.replace(/LINESTRING\(/i, '')
376-
.replace(/\)/i, '')
371+
.replace(/LINESTRING(/i, '')
372+
.replace(/)/i, '')
377373
.split(',')
378374
.map(function(coord) {
379375
var parts = coord.split(' ');

0 commit comments

Comments
 (0)