Skip to content

Commit 4805d9d

Browse files
style: adopt standard v16 ruleset
1 parent 77ce22a commit 4805d9d

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

2018/day-03/claims.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const unique = require('../helpers').unique
22

3-
var _conflicts = []
4-
var _claims = []
5-
var _cloth = []
3+
let _conflicts = []
4+
let _claims = []
5+
let _cloth = []
66

77
/**
88
* Generates an empty matrix of X columns and Y rows

2018/day-03/claims.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-env mocha */
22
const expect = require('chai').expect
3-
var {
3+
const {
44
_cloth,
55
countConflicts,
66
findNonOverlappingClaims,

2018/day-10/beacons.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Beacon {
3030
const data = {}
3131
// Calculate the position of all the beacons
3232
data.contents = this.start.map((beacon) => {
33-
var point = {}
33+
const point = {}
3434
Object.keys(beacon.position).forEach((key) => {
3535
point[key] = beacon.position[key] + (frame * beacon.velocity[key])
3636
})

2018/day-10/solution.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ const init = (data) => {
1919

2020
// Find the frame with the best focus
2121
const best = beaconTracker.frameMeta.reduce((acc, curr, idx) => {
22-
return (curr.focus < acc.focus) ? {
23-
idx: idx,
24-
focus: curr.focus,
25-
dims: curr.dims
26-
} : acc
22+
return (curr.focus < acc.focus)
23+
? {
24+
idx: idx,
25+
focus: curr.focus,
26+
dims: curr.dims
27+
}
28+
: acc
2729
}, { idx: 0, focus: beaconTracker.frameMeta[0].focus, dims: { dim: [0, 0], origin: [0, 0] } })
2830

2931
// const answer = sumMetadata(data)

2018/day-11/fuel-cells.js

-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ class Rack {
7979
return null // break for speed on invalid squares
8080
}
8181
const dest = this.cells[pointer]
82-
if (!dest) {
83-
84-
}
8582
power += (dest) ? dest.power : 0
8683
}
8784
}

2018/day-13/tracks.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class Track {
5959
(this.trackTurns.indexOf(s) === 0 && a === 'x') // horizontal turns clockwise
6060
// (this.trackTurns.indexOf(s) === 0 && a === 'x') // horizontal turns counter-clockwise
6161
// (this.trackTurns.indexOf(s) === 1 && a === 'y') // vertical turns counter-clockwise
62-
) ? 1 : -1
62+
)
63+
? 1
64+
: -1
6365
// Find the value of the new direction
6466
return this.cartDirections[this._roationDirection(d, r)]
6567
}

0 commit comments

Comments
 (0)