Skip to content

Commit fc87fa1

Browse files
committed
🎨 [style] Improve code formatting and consistency across multiple files
- Refactor spacing and indentation in `strava-balance/messages.js` for better readability. - Standardize formatting in `strava-balance/strava-fit-parser.js`, ensuring consistent use of spaces and line breaks. - Clean up whitespace and line breaks in `zwiftbikes/zwiftBikeCalculator.js` and `zwiftbikes/zwiftBikeGallery.js` for improved clarity. - Adjust event listener syntax in `zwiftbikes/zwiftBikeCalculator.js` and `zwiftbikes/zwiftBikeGallery.js` to use concise arrow functions. ✨ [feat] Add TypeScript configuration file - Introduce `tsconfig.json` to enable TypeScript support and improve type safety across the project. - Configure various compiler options to enhance development experience and enforce strict type checking. Signed-off-by: Nick2bad4u <[email protected]>
1 parent 6fdab2e commit fc87fa1

143 files changed

Lines changed: 14613 additions & 9999 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ title: ''
55
labels: bug
66
assignees: Nick2bad4u
77
---
8+
89
### What Userstyle or Script are you opening this for?
910

1011
List the name of the UserStyle or UserScript.
1112

1213
### Provide the Website URL
1314

14-
[https://example.com](https://example.com "https://example.com")
15+
[https://example.com](https://example.com 'https://example.com')
1516

1617
### Describe the bug
1718

1819
A clear and concise description of what the bug is, as best as you can.
1920

2021
### Provide the URL to the page the bug is occurring on
2122

22-
[https://example.com/website/webpage](https://example.com/website/webpage "https://example.com/website/webpage")
23+
[https://example.com/website/webpage](https://example.com/website/webpage 'https://example.com/website/webpage')
2324

2425
### Steps to Reproduce
2526

26-
1. *Go to '...'*
27-
2. *Click on '...'*
28-
3. *Scroll down to '...'*
29-
4. *See error*
27+
1. _Go to '...'_
28+
2. _Click on '...'_
29+
3. _Scroll down to '...'_
30+
4. _See error_
3031

3132
### Expected behavior
3233

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ List the name of the UserStyle or UserScript.
1212

1313
### Provide the Website URL
1414

15-
[https://example.com](https://example.com "https://example.com")
15+
[https://example.com](https://example.com 'https://example.com')
1616

1717
### Describe the feature you'd like
1818

.github/PULL_REQUEST_TEMPLATE/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
27+
28+
- OS: [e.g. iOS]
29+
- Browser [e.g. chrome, safari]
30+
- Version [e.g. 22]
3031

3132
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
33+
34+
- Device: [e.g. iPhone6]
35+
- OS: [e.g. iOS8.1]
36+
- Browser [e.g. stock browser, safari]
37+
- Version [e.g. 22]
3638

3739
**Additional context**
3840
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/dependabot.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,51 @@ version: 2
1111
enable-beta-ecosystems: true
1212

1313
multi-ecosystem-groups:
14-
dependabot-all:
15-
schedule:
16-
interval: "monthly"
14+
dependabot-all:
15+
schedule:
16+
interval: 'semiannually'
1717

1818
updates:
19-
- package-ecosystem: github-actions
20-
directory: /
21-
allow:
22-
# Allow both direct and indirect updates for all packages
23-
- dependency-type: "all"
24-
labels:
25-
- "github-actions"
26-
multi-ecosystem-group: dependabot-all
27-
patterns:
28-
- "*"
19+
- package-ecosystem: github-actions
20+
directory: /
21+
allow:
22+
# Allow both direct and indirect updates for all packages
23+
- dependency-type: 'all'
24+
labels:
25+
- 'github-actions'
26+
multi-ecosystem-group: dependabot-all
27+
patterns:
28+
- '*'
2929

30-
- package-ecosystem: bundler
31-
directory: /
32-
allow:
33-
# Allow both direct and indirect updates for all packages
34-
- dependency-type: "all"
35-
labels:
36-
- "bundler"
37-
multi-ecosystem-group: dependabot-all
38-
patterns:
39-
- "*"
30+
- package-ecosystem: bundler
31+
directory: /
32+
allow:
33+
# Allow both direct and indirect updates for all packages
34+
- dependency-type: 'all'
35+
labels:
36+
- 'bundler'
37+
multi-ecosystem-group: dependabot-all
38+
patterns:
39+
- '*'
4040

41-
- package-ecosystem: npm
42-
directory: /
43-
allow:
44-
# Allow both direct and indirect updates for all packages
45-
- dependency-type: "all"
46-
labels:
47-
- "npm"
48-
multi-ecosystem-group: dependabot-all
49-
patterns:
50-
- "*"
41+
- package-ecosystem: npm
42+
directory: /
43+
allow:
44+
# Allow both direct and indirect updates for all packages
45+
- dependency-type: 'all'
46+
labels:
47+
- 'npm'
48+
multi-ecosystem-group: dependabot-all
49+
patterns:
50+
- '*'
5151

52-
- package-ecosystem: pip
53-
directory: /
54-
allow:
55-
# Allow both direct and indirect updates for all packages
56-
- dependency-type: "all"
57-
labels:
58-
- "pip"
59-
multi-ecosystem-group: dependabot-all
60-
patterns:
61-
- "*"
52+
- package-ecosystem: pip
53+
directory: /
54+
allow:
55+
# Allow both direct and indirect updates for all packages
56+
- dependency-type: 'all'
57+
labels:
58+
- 'pip'
59+
multi-ecosystem-group: dependabot-all
60+
patterns:
61+
- '*'

.github/labeler.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626

2727
root:
2828
- changed-files:
29-
- any-glob-to-any-file: "*"
29+
- any-glob-to-any-file: '*'
3030

3131
# Add 'AnyChange' label to any changes within the entire repository
3232
AnyChange:
3333
- changed-files:
34-
- any-glob-to-any-file: "**"
34+
- any-glob-to-any-file: '**'
3535

3636
# Add 'Actions' label to any changes within '.workflows' folder or any subfolders
3737
Actions:
@@ -48,60 +48,60 @@ Style:
4848

4949
CSS:
5050
- changed-files:
51-
- any-glob-to-any-file: "**/*.css"
51+
- any-glob-to-any-file: '**/*.css'
5252

5353
JavaScript:
5454
- changed-files:
55-
- any-glob-to-any-file: "**/*.js"
55+
- any-glob-to-any-file: '**/*.js'
5656

5757
HTML:
5858
- changed-files:
59-
- any-glob-to-any-file: "**/*.html"
59+
- any-glob-to-any-file: '**/*.html'
6060

6161
PNG:
6262
- changed-files:
63-
- any-glob-to-any-file: "**/*.png"
63+
- any-glob-to-any-file: '**/*.png'
6464

6565
SVG:
6666
- changed-files:
67-
- any-glob-to-any-file: "**/*.svg"
67+
- any-glob-to-any-file: '**/*.svg'
6868

6969
JPG:
7070
- changed-files:
71-
- any-glob-to-any-file: "**/*.jpg"
71+
- any-glob-to-any-file: '**/*.jpg'
7272

7373
GIF:
7474
- changed-files:
75-
- any-glob-to-any-file: "**/*.gif"
75+
- any-glob-to-any-file: '**/*.gif'
7676

7777
JSON:
7878
- changed-files:
79-
- any-glob-to-any-file: "**/*.json"
79+
- any-glob-to-any-file: '**/*.json'
8080

8181
XML:
8282
- changed-files:
83-
- any-glob-to-any-file: "**/*.xml"
83+
- any-glob-to-any-file: '**/*.xml'
8484

8585
Markdown:
8686
- changed-files:
87-
- any-glob-to-any-file: "**/*.md"
87+
- any-glob-to-any-file: '**/*.md'
8888

8989
YAML:
9090
- changed-files:
91-
- any-glob-to-any-file: "**/*.yaml"
91+
- any-glob-to-any-file: '**/*.yaml'
9292

9393
TypeScript:
9494
- changed-files:
95-
- any-glob-to-any-file: "**/*.ts"
95+
- any-glob-to-any-file: '**/*.ts'
9696

9797
SCSS:
9898
- changed-files:
99-
- any-glob-to-any-file: "**/*.scss"
99+
- any-glob-to-any-file: '**/*.scss'
100100

101101
# Add 'feature' label to any PR where the head branch name starts with `feature` or has a `feature` section in the name
102102
feature:
103-
- head-branch: ["^feature", "feature"]
103+
- head-branch: ['^feature', 'feature']
104104

105105
# Add 'release' label to any PR that is opened against the `main` branch
106106
release:
107-
- base-branch: "main"
107+
- base-branch: 'main'

.github/workflows/Snake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ name: Snake
1919
on:
2020
# run automatically every day at midnight
2121
schedule:
22-
- cron: "0 0 * * *"
22+
- cron: '0 0 * * *'
2323
# allows to manually run the job at any time
2424
workflow_dispatch:
2525

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# CI — Lint, Test, Coverage
2+
#
3+
# Runs on every push and pull-request to main.
4+
# Steps:
5+
# 1. Lint CSS (stylelint)
6+
# 2. Lint JS (ESLint with TypeScript-aware rules)
7+
# 3. Run Jest unit tests with coverage
8+
# 4. Upload LCOV report to Codecov
9+
10+
name: CI
11+
12+
on:
13+
push:
14+
branches: [main]
15+
pull_request:
16+
branches: [main]
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: ci-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
ci:
28+
name: Lint · Test · Coverage
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
# ── Security hardening ────────────────────────────────────────────────
33+
- name: Harden runner
34+
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
35+
with:
36+
egress-policy: audit
37+
38+
# ── Source checkout ───────────────────────────────────────────────────
39+
- name: Checkout repository
40+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
41+
42+
# ── Node.js setup ─────────────────────────────────────────────────────
43+
- name: Set up Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: lts/*
47+
cache: npm
48+
49+
# ── Install dependencies ──────────────────────────────────────────────
50+
- name: Install dependencies
51+
run: npm ci --legacy-peer-deps
52+
53+
# ── CSS lint ──────────────────────────────────────────────────────────
54+
- name: Lint CSS (stylelint)
55+
run: npm run lint:css
56+
57+
# ── JS lint ───────────────────────────────────────────────────────────
58+
- name: Lint JS (ESLint)
59+
run: npm run lint:js
60+
61+
# ── Unit tests + coverage ─────────────────────────────────────────────
62+
- name: Run tests with coverage
63+
run: npm run test:coverage
64+
65+
# ── Upload to Codecov ─────────────────────────────────────────────────
66+
- name: Upload coverage to Codecov
67+
uses: codecov/codecov-action@v4
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
files: ./coverage/lcov.info
71+
flags: unittests
72+
name: UserStyles-coverage
73+
fail_ci_if_error: false
74+
verbose: true

.github/workflows/codeql.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
# the `language` matrix defined below to confirm you have the correct set of
3131
# supported CodeQL languages.
3232
#
33-
name: "CodeQL"
33+
name: 'CodeQL'
3434

3535
on:
3636
push:
37-
branches: ["main"]
37+
branches: ['main']
3838
pull_request:
3939
# The branches below must be a subset of the branches above
40-
branches: ["main"]
40+
branches: ['main']
4141
schedule:
42-
- cron: "0 0 * * 1"
42+
- cron: '0 0 * * 1'
4343

4444
permissions:
4545
contents: read
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
fail-fast: false
6262
matrix:
63-
language: ["javascript", "ruby"]
63+
language: ['javascript', 'ruby']
6464
# CodeQL supports [ $supported-codeql-languages ]
6565
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
6666

@@ -100,4 +100,4 @@ jobs:
100100
- name: Perform CodeQL Analysis
101101
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
102102
with:
103-
category: "/language:${{matrix.language}}"
103+
category: '/language:${{matrix.language}}'

0 commit comments

Comments
 (0)