Skip to content

Commit bdf5171

Browse files
committed
fix linting
1 parent 4672758 commit bdf5171

File tree

53 files changed

+89
-123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+89
-123
lines changed

epicshop/fix-watch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ const debouncedRun = debounce(run, 200)
2626

2727
// Add event listeners.
2828
watcher
29-
.on('addDir', (path) => {
29+
.on('addDir', (_path) => {
3030
debouncedRun()
3131
})
32-
.on('unlinkDir', (path) => {
32+
.on('unlinkDir', (_path) => {
3333
debouncedRun()
3434
})
3535
.on('error', (error) => console.log(`Watcher error: ${error}`))

epicshop/fix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// This should run by node without any dependencies
22
// because you may need to run it without deps.
33

4-
import cp from 'node:child_process'
54
import fs from 'node:fs'
65
import path from 'node:path'
76
import { fileURLToPath } from 'node:url'
87

98
const __dirname = path.dirname(fileURLToPath(import.meta.url))
109
const here = (...p) => path.join(__dirname, ...p)
1110
const VERBOSE = false
11+
// eslint-disable-next-line
1212
const logVerbose = (...args) => (VERBOSE ? console.log(...args) : undefined)
1313

1414
const workshopRoot = here('..')
@@ -78,7 +78,7 @@ function exists(p) {
7878
try {
7979
fs.statSync(p)
8080
return true
81-
} catch (error) {
81+
} catch {
8282
return false
8383
}
8484
}

exercises/01.objects/01.problem.object-literals/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
// 🐨 When you're done, uncomment this:
1818
// console.log(
19-
// 'Results JSON:',
19+
// 'Results:',
2020
// JSON.stringify({
2121
// user,
2222
// admin,

exercises/01.objects/01.solution.object-literals/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import { execSync } from 'node:child_process'
33
import { test } from 'node:test'
44

55
const output = execSync('npm start --silent', { encoding: 'utf8' })
6-
const jsonLine = output
7-
.split('\n')
8-
.find((line) => line.startsWith('Results JSON:'))
9-
assert.ok(jsonLine, '🚨 Missing "Results JSON:" output line')
10-
const { user, admin } = JSON.parse(jsonLine.replace('Results JSON:', '').trim())
6+
const jsonLine = output.split('\n').find((line) => line.startsWith('Results:'))
7+
assert.ok(jsonLine, '🚨 Missing "Results:" output line')
8+
const { user, admin } = JSON.parse(jsonLine.replace('Results:', '').trim())
119

1210
await test('User object should have correct properties', () => {
1311
assert.strictEqual(

exercises/01.objects/01.solution.object-literals/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ console.log(`User: ${user.name}, Age: ${user.age}`)
1717
console.log(`Admin: ${admin.name}, Age: ${admin.age}`)
1818

1919
console.log(
20-
'Results JSON:',
20+
'Results:',
2121
JSON.stringify({
2222
user,
2323
admin,

exercises/01.objects/02.problem.property-access/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const product = {
2525

2626
// 🐨 When you're done, uncomment this:
2727
// console.log(
28-
// 'Results JSON:',
28+
// 'Results:',
2929
// JSON.stringify({
3030
// product,
3131
// formatted: formatProduct(product),

exercises/01.objects/02.solution.property-access/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import { execSync } from 'node:child_process'
33
import { test } from 'node:test'
44

55
const output = execSync('npm start --silent', { encoding: 'utf8' })
6-
const jsonLine = output
7-
.split('\n')
8-
.find((line) => line.startsWith('Results JSON:'))
9-
assert.ok(jsonLine, '🚨 Missing "Results JSON:" output line')
6+
const jsonLine = output.split('\n').find((line) => line.startsWith('Results:'))
7+
assert.ok(jsonLine, '🚨 Missing "Results:" output line')
108
const { product, formatted } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('Product object should have correct properties', () => {

exercises/01.objects/02.solution.property-access/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function formatProduct(p: { name: string; price: number }): string {
2323
console.log(formatProduct(product))
2424

2525
console.log(
26-
'Results JSON:',
26+
'Results:',
2727
JSON.stringify({
2828
product,
2929
formatted: formatProduct(product),

exercises/01.objects/03.problem.optional-properties/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
// 🐨 When you're done, uncomment this:
2727
// console.log(
28-
// 'Results JSON:',
28+
// 'Results:',
2929
// JSON.stringify({
3030
// alice,
3131
// bob,

exercises/01.objects/03.solution.optional-properties/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import { execSync } from 'node:child_process'
33
import { test } from 'node:test'
44

55
const output = execSync('npm start --silent', { encoding: 'utf8' })
6-
const jsonLine = output
7-
.split('\n')
8-
.find((line) => line.startsWith('Results JSON:'))
9-
assert.ok(jsonLine, '🚨 Missing "Results JSON:" output line')
10-
const { alice, bob } = JSON.parse(jsonLine.replace('Results JSON:', '').trim())
6+
const jsonLine = output.split('\n').find((line) => line.startsWith('Results:'))
7+
assert.ok(jsonLine, '🚨 Missing "Results:" output line')
8+
const { alice, bob } = JSON.parse(jsonLine.replace('Results:', '').trim())
119

1210
await test('User without optional properties should work', () => {
1311
assert.strictEqual(

0 commit comments

Comments
 (0)