Skip to content

Commit

Permalink
Lint (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse authored Sep 2, 2024
1 parent d64fbc6 commit 1d0ae2f
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 157 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Lint
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize]
jobs:
lint-eslint:
name: Run lint:eslint
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint:eslint
run: |
npm run lint:eslint
env:
CI: true
lint-prettier:
name: Run lint:prettier
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run lint:prettier
run: |
npm run lint:prettier
env:
CI: true
2 changes: 1 addition & 1 deletion .github/workflows/resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "${{ steps.get-node-version.outputs.NODE_VERSION }}"
node-version: '${{ steps.get-node-version.outputs.NODE_VERSION }}'

- name: Install dependencies
run: npm install
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

This repository contains:

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

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

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

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

[website]: https://web-scrobbler.github.io/
[website-issues]: https://github.com/web-scrobbler/web-scrobbler.github.io/issues
Expand Down
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const resDir = 'resources';
const moduleFile = 'connectors.ts';
const listFile = `${resDir}/connectors.json`;

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

if (!latestTag) {
console.error('You must provide version as an argument')
console.error('You must provide version as an argument');
process.exit(1);
}

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

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

if (!fs.existsSync(resDir)) {
mkdir(resDir);
Expand Down
Loading

0 comments on commit 1d0ae2f

Please sign in to comment.