Skip to content

Commit 0e6780b

Browse files
committed
fix linting
1 parent ce87fed commit 0e6780b

File tree

63 files changed

+105
-148
lines changed

Some content is hidden

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

63 files changed

+105
-148
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.expressions-and-output/02.problem.escaping-strings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
// newlines: 'Hello\nWorld',
2121
// tabs: 'Name:\tAge:\tCity:',
2222
// }
23-
// console.log('Results JSON:', JSON.stringify(results))
23+
// console.log('Results:', JSON.stringify(results))

exercises/01.expressions-and-output/02.solution.escaping-strings/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 { apostrophe, quotes, newlines, tabs } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('should print string with apostrophe', () => {

exercises/01.expressions-and-output/02.solution.escaping-strings/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,4 @@ console.log(newlines)
1717
const tabs = 'Name:\tAge:\tCity:'
1818
console.log(tabs)
1919

20-
console.log(
21-
'Results JSON:',
22-
JSON.stringify({ apostrophe, quotes, newlines, tabs }),
23-
)
20+
console.log('Results:', JSON.stringify({ apostrophe, quotes, newlines, tabs }))

exercises/01.expressions-and-output/03.problem.strings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
// fullName: 'Your Name',
1515
// sentence: 'I am learning to code',
1616
// }
17-
// console.log('Results JSON:', JSON.stringify(results))
17+
// console.log('Results:', JSON.stringify(results))

exercises/01.expressions-and-output/03.solution.strings/index.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ import { readFileSync } from 'node:fs'
44
import { test } from 'node:test'
55

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

1311
await test('should print Hello TypeScript', () => {
1412
assert.ok(

exercises/01.expressions-and-output/03.solution.strings/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ const sentence = 'I' + ' ' + 'am' + ' ' + 'learning' + ' ' + 'to' + ' ' + 'code'
88
console.log(greeting)
99
console.log(fullName)
1010
console.log(sentence)
11-
console.log('Results JSON:', JSON.stringify({ greeting, fullName, sentence }))
11+
console.log('Results:', JSON.stringify({ greeting, fullName, sentence }))

exercises/01.expressions-and-output/04.problem.numbers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
// divideResult: 25,
1818
// groupedResult: 30,
1919
// }
20-
// console.log('Results JSON:', JSON.stringify(results))
20+
// console.log('Results:', JSON.stringify(results))

exercises/01.expressions-and-output/04.solution.numbers/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 { addResult, multiplyResult, divideResult, groupedResult } = JSON.parse(
11-
jsonLine.replace('Results JSON:', '').trim(),
9+
jsonLine.replace('Results:', '').trim(),
1210
)
1311

1412
await test('should print correct arithmetic results', () => {

0 commit comments

Comments
 (0)