Skip to content

Commit 42cba86

Browse files
authored
chore: add "lint" script (#51)
1 parent 9437ec8 commit 42cba86

6 files changed

Lines changed: 57 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222

2323
- name: Lint code
2424
run: |
25-
(cd mclib && bunx eslint .)
26-
(cd web && bunx eslint .)
25+
(cd mclib && bun run lint)
26+
(cd web && bun run lint)
2727
2828
- name: build CLI
2929
run: cd cli && bun run build

mclib/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"scripts": {
1313
"build": "tsc",
14-
"test": "bunx vitest run"
14+
"test": "bunx vitest run",
15+
"lint": "eslint ."
1516
},
1617
"type": "module",
1718
"types": "dist/index.d.ts",

web/src/config.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1-
import { ModrinthRepository, CurseForgeRepository, ModQueryService, LocalSolutionFinder } from 'mclib';
1+
import {
2+
ModrinthRepository,
3+
CurseForgeRepository,
4+
ModQueryService,
5+
LocalSolutionFinder
6+
} from 'mclib';
27
import type { ISolutionFinder } from 'mclib';
38
declare const __APP_VERSION__: string;
49

510
// eslint-disable-next-line @typescript-eslint/no-explicit-any
611
export const fetchClient = (url: any, init: RequestInit = {}) => {
7-
init['headers'] = {
8-
...init['headers'],
9-
'User-Agent': 'github.com/iTrooz/ModpackCreator v' + __APP_VERSION__
10-
};
11-
return fetch(url, init);
12-
}
12+
init['headers'] = {
13+
...init['headers'],
14+
'User-Agent': 'github.com/iTrooz/ModpackCreator v' + __APP_VERSION__
15+
};
16+
return fetch(url, init);
17+
};
1318

14-
export const repositories = [new ModrinthRepository(fetchClient), new CurseForgeRepository(fetchClient)];
19+
export const repositories = [
20+
new ModrinthRepository(fetchClient),
21+
new CurseForgeRepository(fetchClient)
22+
];
1523
export const modQueryService = new ModQueryService(repositories);
16-
export const solutionFinder: ISolutionFinder = new LocalSolutionFinder(modQueryService)
24+
export const solutionFinder: ISolutionFinder = new LocalSolutionFinder(modQueryService);

web/src/routes/+layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const prerender = true
1+
export const prerender = true;

web/static/colors.css

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
* {
2-
/* GREY */
3-
--grey-light-2: hsla(120, 56%, 96%, 1);
4-
--grey-light-1: hsla(120, 15%, 86%, 1);
5-
--grey: hsla(120, 2%, 47%, 1);
6-
--grey-dark-1: hsla(120, 5%, 22%, 1);
7-
--grey-dark-2: hsla(120, 3%, 13%, 1);
8-
/* GREEN */
9-
--green-light-2: hsla(94, 78%, 87%, 1);
10-
--green-light-1: hsla(94, 59%, 70%, 1);
11-
--green: hsla(94, 39%, 48%, 1);
12-
--green-dark-1: hsla(96, 72%, 19%, 1);
13-
--green-dark-2: hsla(96, 93%, 11%, 1);
14-
/* ORANGE */
15-
--orange-light-2: hsla(37, 78%, 89%, 1);
16-
--orange-light-1: hsla(36, 82%, 72%, 1);
17-
--orange: hsla(38, 62%, 55%, 1);
18-
--orange-dark-1: hsla(38, 68%, 34%, 1);
19-
--orange-dark-2: hsla(38, 88%, 17%, 1);
20-
/* RED */
21-
--red-light-2: hsla(8, 69%, 91%, 1);
22-
--red-light-1: hsla(9, 74%, 73%, 1);
23-
--red: hsla(9, 56%, 53%, 1);
24-
--red-dark-1: hsla(9, 75%, 22%, 1);
25-
--red-dark-2: hsla(9, 90%, 12%, 1);
26-
/* BLUE */
27-
--blue-light-2: hsla(213, 73%, 91%, 1);
28-
--blue-light-1: hsla(212, 90%, 72%, 1);
29-
--blue: hsla(212, 70%, 55%, 1);
30-
--blue-dark-1: hsla(212, 82%, 30%, 1);
31-
--blue-dark-2: hsla(212, 94%, 14%, 1);
2+
/* GREY */
3+
--grey-light-2: hsla(120, 56%, 96%, 1);
4+
--grey-light-1: hsla(120, 15%, 86%, 1);
5+
--grey: hsla(120, 2%, 47%, 1);
6+
--grey-dark-1: hsla(120, 5%, 22%, 1);
7+
--grey-dark-2: hsla(120, 3%, 13%, 1);
8+
/* GREEN */
9+
--green-light-2: hsla(94, 78%, 87%, 1);
10+
--green-light-1: hsla(94, 59%, 70%, 1);
11+
--green: hsla(94, 39%, 48%, 1);
12+
--green-dark-1: hsla(96, 72%, 19%, 1);
13+
--green-dark-2: hsla(96, 93%, 11%, 1);
14+
/* ORANGE */
15+
--orange-light-2: hsla(37, 78%, 89%, 1);
16+
--orange-light-1: hsla(36, 82%, 72%, 1);
17+
--orange: hsla(38, 62%, 55%, 1);
18+
--orange-dark-1: hsla(38, 68%, 34%, 1);
19+
--orange-dark-2: hsla(38, 88%, 17%, 1);
20+
/* RED */
21+
--red-light-2: hsla(8, 69%, 91%, 1);
22+
--red-light-1: hsla(9, 74%, 73%, 1);
23+
--red: hsla(9, 56%, 53%, 1);
24+
--red-dark-1: hsla(9, 75%, 22%, 1);
25+
--red-dark-2: hsla(9, 90%, 12%, 1);
26+
/* BLUE */
27+
--blue-light-2: hsla(213, 73%, 91%, 1);
28+
--blue-light-1: hsla(212, 90%, 72%, 1);
29+
--blue: hsla(212, 70%, 55%, 1);
30+
--blue-dark-1: hsla(212, 82%, 30%, 1);
31+
--blue-dark-2: hsla(212, 94%, 14%, 1);
3232
}

web/vitest.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { defineConfig } from 'vitest/config';
22

33
export default defineConfig({
4-
test: {
5-
globals: true,
6-
environment: 'node',
7-
include: ['src/**/*.{test,spec}.{js,ts}']
8-
}
4+
test: {
5+
globals: true,
6+
environment: 'node',
7+
include: ['src/**/*.{test,spec}.{js,ts}']
8+
}
99
});

0 commit comments

Comments
 (0)