Skip to content

Commit 1d0ae2f

Browse files
authored
Lint (#17)
1 parent d64fbc6 commit 1d0ae2f

File tree

7 files changed

+113
-157
lines changed

7 files changed

+113
-157
lines changed

.github/workflows/lint.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
types: [opened, synchronize]
7+
jobs:
8+
lint-eslint:
9+
name: Run lint:eslint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version-file: '.nvmrc'
19+
cache: 'npm'
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run lint:eslint
25+
run: |
26+
npm run lint:eslint
27+
env:
28+
CI: true
29+
lint-prettier:
30+
name: Run lint:prettier
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout the repository
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version-file: '.nvmrc'
40+
cache: 'npm'
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Run lint:prettier
46+
run: |
47+
npm run lint:prettier
48+
env:
49+
CI: true

.github/workflows/resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: "${{ steps.get-node-version.outputs.NODE_VERSION }}"
20+
node-version: '${{ steps.get-node-version.outputs.NODE_VERSION }}'
2121

2222
- name: Install dependencies
2323
run: npm install

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
This repository contains:
44

5-
- resources (a list of websites) for Web Scrobbler [website][website]
6-
- a script file and other environment files that generate resources
5+
- resources (a list of websites) for Web Scrobbler [website][website]
6+
- a script file and other environment files that generate resources
77

88
This repository is updated automatically. Please don't submit pull requests here.
99

1010
If you find an issue, or have a question, feel free to create a new issue:
1111

12-
- [in the extension repository][extension-issues], if it's related to the extension
13-
- [in the website repository][website-issues], if it's related to the website
12+
- [in the extension repository][extension-issues], if it's related to the extension
13+
- [in the website repository][website-issues], if it's related to the website
1414

1515
[website]: https://web-scrobbler.github.io/
1616
[website-issues]: https://github.com/web-scrobbler/web-scrobbler.github.io/issues

index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ const resDir = 'resources';
1616
const moduleFile = 'connectors.ts';
1717
const listFile = `${resDir}/connectors.json`;
1818

19-
async function main(args:string[]) {
19+
async function main(args: string[]) {
2020
const latestTag = args.at(-1);
2121

2222
if (!latestTag) {
23-
console.error('You must provide version as an argument')
23+
console.error('You must provide version as an argument');
2424
process.exit(1);
2525
}
2626

@@ -56,7 +56,7 @@ async function dumpConnectors() {
5656
const connectors = (await import(`./${moduleFile}`)).default as any[];
5757

5858
const labelArray = connectors.map((entry) => entry.label);
59-
const contents = JSON.stringify(labelArray, null, 2);
59+
const contents = JSON.stringify(labelArray, null, 2) + '\n';
6060

6161
if (!fs.existsSync(resDir)) {
6262
mkdir(resDir);

0 commit comments

Comments
 (0)