Skip to content

Commit 1e2736b

Browse files
committed
chore: better Prettier config for easier reviews
1 parent d7d5f9a commit 1e2736b

File tree

70 files changed

+1477
-1383
lines changed

Some content is hidden

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

70 files changed

+1477
-1383
lines changed

.github/ISSUE_TEMPLATE/BUG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: '🐛 Bug Report'
3-
about: 'Report an unexpected problem or unintended behavior.'
4-
title: '[Bug]'
5-
labels: 'bug'
2+
name: "🐛 Bug Report"
3+
about: "Report an unexpected problem or unintended behavior."
4+
title: "[Bug]"
5+
labels: "bug"
66
---
77

88
<!--

.github/ISSUE_TEMPLATE/DOCUMENTATION.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: '📜 Documentation'
3-
about: 'Correct spelling errors, improvements or additions to documentation files (README, CONTRIBUTING...).'
4-
title: '[Documentation]'
5-
labels: 'documentation'
2+
name: "📜 Documentation"
3+
about: "Correct spelling errors, improvements or additions to documentation files (README, CONTRIBUTING...)."
4+
title: "[Documentation]"
5+
labels: "documentation"
66
---
77

88
<!-- Please make sure your issue has not already been fixed. -->

.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: '✨ Feature Request'
3-
about: 'Suggest a new feature idea.'
4-
title: '[Feature]'
5-
labels: 'feature request'
2+
name: "✨ Feature Request"
3+
about: "Suggest a new feature idea."
4+
title: "[Feature]"
5+
labels: "feature request"
66
---
77

88
<!-- Please make sure your issue has not already been fixed. -->

.github/ISSUE_TEMPLATE/IMPROVEMENT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: '🔧 Improvement'
3-
about: 'Improve structure/format/performance/refactor/tests of the code.'
4-
title: '[Improvement]'
5-
labels: 'improvement'
2+
name: "🔧 Improvement"
3+
about: "Improve structure/format/performance/refactor/tests of the code."
4+
title: "[Improvement]"
5+
labels: "improvement"
66
---
77

88
<!-- Please make sure your issue has not already been fixed. -->

.github/ISSUE_TEMPLATE/QUESTION.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: '🙋 Question'
3-
about: 'Further information is requested.'
4-
title: '[Question]'
5-
labels: 'question'
2+
name: "🙋 Question"
3+
about: "Further information is requested."
4+
title: "[Question]"
5+
labels: "question"
66
---
77

88
### Question

.github/workflows/challenges.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'challenges'
1+
name: "challenges"
22

33
on:
44
push:
@@ -8,39 +8,39 @@ on:
88

99
jobs:
1010
test-solutions:
11-
runs-on: 'ubuntu-latest'
11+
runs-on: "ubuntu-latest"
1212
timeout-minutes: 30
1313
steps:
14-
- uses: 'actions/[email protected]'
14+
- uses: "actions/[email protected]"
1515
with:
1616
fetch-depth: 0
1717

18-
- name: 'Setup Docker'
19-
uses: 'actions-hub/docker/cli@master'
18+
- name: "Setup Docker"
19+
uses: "actions-hub/docker/cli@master"
2020
env:
2121
SKIP_LOGIN: true
2222

23-
- name: 'Setup Node.js'
24-
uses: 'actions/[email protected]'
23+
- name: "Setup Node.js"
24+
uses: "actions/[email protected]"
2525
with:
26-
node-version: 'lts/*'
27-
cache: 'npm'
26+
node-version: "lts/*"
27+
cache: "npm"
2828

29-
- name: 'Install dependencies'
30-
run: 'npm clean-install'
29+
- name: "Install dependencies"
30+
run: "npm clean-install"
3131

32-
- name: 'Build'
33-
run: 'npm run build'
32+
- name: "Build"
33+
run: "npm run build"
3434

35-
- name: 'Install programming-challenges'
36-
run: 'npm install --global'
35+
- name: "Install programming-challenges"
36+
run: "npm install --global"
3737

38-
- uses: 'nrwl/last-successful-commit-action@v1'
39-
id: 'last_successful_commit'
38+
- uses: "nrwl/last-successful-commit-action@v1"
39+
id: "last_successful_commit"
4040
with:
41-
branch: 'master'
42-
workflow_id: 'challenges.yml'
41+
branch: "master"
42+
workflow_id: "challenges.yml"
4343
github_token: ${{ secrets.GITHUB_TOKEN }}
4444

45-
- name: 'Test'
46-
run: 'programming-challenges run test --affected --base=${{ steps.last_successful_commit.outputs.commit_hash }}'
45+
- name: "Test"
46+
run: "programming-challenges run test --affected --base=${{ steps.last_successful_commit.outputs.commit_hash }}"

.github/workflows/cli.yml

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'cli'
1+
name: "cli"
22

33
on:
44
push:
@@ -8,64 +8,64 @@ on:
88

99
jobs:
1010
lint:
11-
runs-on: 'ubuntu-latest'
11+
runs-on: "ubuntu-latest"
1212
steps:
13-
- uses: 'actions/[email protected]'
13+
- uses: "actions/[email protected]"
1414

15-
- name: 'Setup Node.js'
16-
uses: 'actions/[email protected]'
15+
- name: "Setup Node.js"
16+
uses: "actions/[email protected]"
1717
with:
18-
node-version: 'lts/*'
19-
cache: 'npm'
18+
node-version: "lts/*"
19+
cache: "npm"
2020

21-
- name: 'Install dependencies'
22-
run: 'npm clean-install'
21+
- name: "Install dependencies"
22+
run: "npm clean-install"
2323

2424
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
25-
- run: 'npm run lint:editorconfig'
26-
- run: 'npm run lint:markdown'
27-
- run: 'npm run lint:eslint'
25+
- run: "npm run lint:editorconfig"
26+
- run: "npm run lint:markdown"
27+
- run: "npm run lint:eslint"
2828

2929
build:
30-
runs-on: 'ubuntu-latest'
30+
runs-on: "ubuntu-latest"
3131
steps:
32-
- uses: 'actions/[email protected]'
32+
- uses: "actions/[email protected]"
3333

34-
- name: 'Setup Node.js'
35-
uses: 'actions/[email protected]'
34+
- name: "Setup Node.js"
35+
uses: "actions/[email protected]"
3636
with:
37-
node-version: 'lts/*'
38-
cache: 'npm'
37+
node-version: "lts/*"
38+
cache: "npm"
3939

40-
- name: 'Install dependencies'
41-
run: 'npm clean-install'
40+
- name: "Install dependencies"
41+
run: "npm clean-install"
4242

43-
- name: 'Build'
44-
run: 'npm run build'
43+
- name: "Build"
44+
run: "npm run build"
4545

46-
- run: 'npm run build:typescript'
46+
- run: "npm run build:typescript"
4747

4848
test:
49-
runs-on: 'ubuntu-latest'
49+
runs-on: "ubuntu-latest"
5050
steps:
51-
- uses: 'actions/[email protected]'
51+
- uses: "actions/[email protected]"
5252

53-
- name: 'Setup Docker'
54-
uses: 'actions-hub/docker/cli@master'
53+
- name: "Setup Docker"
54+
uses: "actions-hub/docker/cli@master"
5555
env:
5656
SKIP_LOGIN: true
5757

58-
- name: 'Setup Node.js'
59-
uses: 'actions/[email protected]'
58+
- name: "Setup Node.js"
59+
uses: "actions/[email protected]"
6060
with:
61-
node-version: 'lts/*'
62-
cache: 'npm'
61+
node-version: "lts/*"
62+
cache: "npm"
6363

64-
- name: 'Install dependencies'
65-
run: 'npm clean-install'
64+
- name: "Install dependencies"
65+
run: "npm clean-install"
6666

67-
- name: 'Build'
68-
run: 'npm run build'
67+
- name: "Build"
68+
run: "npm run build"
6969

70-
- name: 'Test'
71-
run: 'npm run test'
70+
- name: "Test"
71+
run: "npm run test"

.gitpod.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
image: 'gitpod/workspace-full'
1+
image: "gitpod/workspace-full"
22

33
tasks:
4-
- name: 'programming-challenges'
5-
before: 'npm clean-install'
6-
init: 'npm run build'
7-
command: 'npm install --global && programming-challenges'
4+
- name: "programming-challenges"
5+
before: "npm clean-install"
6+
init: "npm run build"
7+
command: "npm install --global && programming-challenges"
88

99
github:
1010
prebuilds:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Gitpod will automatically setup an environment for you.
4949
#### Prerequisites
5050

5151
- [Node.js](https://nodejs.org/) >= 20.0.0
52-
- [npm](https://npmjs.com/) >= 9.0.0
52+
- [npm](https://npmjs.com/) >= 10.0.0
5353
- [Docker](https://www.docker.com/)
5454

5555
#### Installation

challenges/cakes-swerc-2020-2021/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ make?
1717

1818
- **Line 1:** Single integer `N` for the number of ingredients.
1919
- **`N` next lines:** One for each ingredient. Each of these lines contains two positive integers:
20-
the first one is the required quantity of this ingredient per cake, the second one is the quantity of
21-
this ingredient you have in your kitchen.
20+
the first one is the required quantity of this ingredient per cake, the second one is the quantity of
21+
this ingredient you have in your kitchen.
2222

2323
### Output
2424

Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import readline from 'node:readline'
1+
import readline from "node:readline"
22

33
const input = []
44
const readlineInterface = readline.createInterface({
55
input: process.stdin,
6-
output: process.stdout
6+
output: process.stdout,
77
})
8-
readlineInterface.on('line', (value) => {
8+
readlineInterface.on("line", (value) => {
99
input.push(value)
1010
})
11-
readlineInterface.on('close', solution)
11+
readlineInterface.on("close", solution)
1212

1313
function solution() {
1414
const string = input[0]
1515
const output = string
1616
.trim()
17-
.split(' ')
17+
.split(" ")
1818
.map((word, index) => {
1919
const isFirstElement = index === 0
2020
if (isFirstElement) {
2121
return word
2222
}
2323
return word[0].toUpperCase() + word.slice(1)
2424
})
25-
.join('')
25+
.join("")
2626
console.log(output)
2727
}

challenges/defibrillators/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This data is comprised of lines, each of which represents a defibrillator. Each
2121
- Contact Phone number
2222
- Longitude (degrees)
2323
- Latitude (degrees)
24-
These fields are separated by a semicolon (`;`).
24+
These fields are separated by a semicolon (`;`).
2525

2626
**Beware:** the decimal numbers use the comma (,) as decimal separator. Remember to turn the comma (,) into dot (.) if necessary in order to use the data in your program.
2727

challenges/first-non-repeating-character/solutions/javascript/function/solution.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import readline from 'node:readline'
1+
import readline from "node:readline"
22

33
const input = []
44
const readlineInterface = readline.createInterface({
55
input: process.stdin,
6-
output: process.stdout
6+
output: process.stdout,
77
})
8-
readlineInterface.on('line', (value) => {
8+
readlineInterface.on("line", (value) => {
99
input.push(value)
1010
})
11-
readlineInterface.on('close', solution)
11+
readlineInterface.on("close", solution)
1212

1313
const firstNonRepeatingCharacter = (string) => {
1414
const lettersCount = {}
@@ -18,7 +18,7 @@ const firstNonRepeatingCharacter = (string) => {
1818
lettersCount[character] = {
1919
total: 1,
2020
firstIndex: index,
21-
value: character
21+
value: character,
2222
}
2323
} else {
2424
lettersCount[character].total += 1
@@ -36,7 +36,7 @@ const firstNonRepeatingCharacter = (string) => {
3636
}
3737
}
3838
if (result == null) {
39-
return ''
39+
return ""
4040
}
4141
return result.value
4242
}

challenges/frequency-deviation/solutions/javascript/function/getMaximumFrequencyDeviation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const getMaximumFrequencyDeviation = (string) => {
77
/** @type {string[]} */
88
const subStrings = []
99
for (let index = 0; index < string.length; index++) {
10-
let subString = ''
10+
let subString = ""
1111
for (let subIndex = index; subIndex < string.length; subIndex++) {
1212
subString += string[subIndex]
1313
subStrings.push(subString)
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import readline from 'node:readline'
1+
import readline from "node:readline"
22

3-
import { getMaximumFrequencyDeviation } from './getMaximumFrequencyDeviation.js'
3+
import { getMaximumFrequencyDeviation } from "./getMaximumFrequencyDeviation.js"
44

55
const input = []
66
const readlineInterface = readline.createInterface({
77
input: process.stdin,
8-
output: process.stdout
8+
output: process.stdout,
99
})
10-
readlineInterface.on('line', (value) => {
10+
readlineInterface.on("line", (value) => {
1111
input.push(value)
1212
})
1313

1414
const solution = () => {
1515
console.log(getMaximumFrequencyDeviation(input[0]))
1616
}
1717

18-
readlineInterface.on('close', solution)
18+
readlineInterface.on("close", solution)

0 commit comments

Comments
 (0)