Skip to content

Commit 4cab844

Browse files
committed
fix linting
1 parent 6d1c68c commit 4cab844

File tree

26 files changed

+44
-60
lines changed

26 files changed

+44
-60
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.classes/01.problem.class-basics/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// sampleCart.addItem(sampleLaptop)
2727
// sampleCart.addItem(sampleMouse)
2828
// console.log(
29-
// 'Results JSON:',
29+
// 'Results:',
3030
// JSON.stringify({
3131
// product: {
3232
// name: sampleLaptop.name,

exercises/01.classes/01.solution.class-basics/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, cart, emptyCart } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('Product class should create instances with name and price', () => {

exercises/01.classes/01.solution.class-basics/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const afterFirstAddCount = sampleCart.items.length
5050
sampleCart.addItem(sampleMouse)
5151

5252
console.log(
53-
'Results JSON:',
53+
'Results:',
5454
JSON.stringify({
5555
product: {
5656
name: sampleLaptop.name,

exercises/01.classes/02.problem.constructors/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// sampleAccount.deposit(100)
3232
// sampleAccount.deposit(50)
3333
// console.log(
34-
// 'Results JSON:',
34+
// 'Results:',
3535
// JSON.stringify({
3636
// user: { name: user.name, email: user.email, role: user.role },
3737
// admin: { name: admin.name, email: admin.email, role: admin.role },

exercises/01.classes/02.solution.constructors/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 { user, admin, account, config, customConfig } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('User constructor should set name, email, and default role', () => {

exercises/01.classes/02.solution.constructors/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const balanceAfterFirstDeposit = sampleAccount.getBalance()
6666
sampleAccount.deposit(50)
6767

6868
console.log(
69-
'Results JSON:',
69+
'Results:',
7070
JSON.stringify({
7171
user: { name: user.name, email: user.email, role: user.role },
7272
admin: { name: admin.name, email: admin.email, role: admin.role },

exercises/02.interfaces-and-classes/01.problem.implementing-interfaces/index.ts

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

2222
// 🐨 When you're done, uncomment this:
2323
// console.log(
24-
// 'Results JSON:',
24+
// 'Results:',
2525
// JSON.stringify({
2626
// creditCard: {
2727
// cardNumber: creditCard.cardNumber,

exercises/02.interfaces-and-classes/01.solution.implementing-interfaces/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 { creditCard, paypal } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('CreditCard should implement PaymentMethod interface', () => {

0 commit comments

Comments
 (0)