Skip to content

Commit 337cd93

Browse files
committed
style: format and lint codebase with Prettier + ESLint
1 parent 0a610fc commit 337cd93

File tree

92 files changed

+603
-628
lines changed

Some content is hidden

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

92 files changed

+603
-628
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ jobs:
4747
git config --local user.name "GitHub Action"
4848
git add .
4949
git commit -m "🔧 Auto-fix: ESLint formatting and fixes"
50-
git push
50+
git push

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
run: bun install
2828

2929
- name: Run tests
30-
run: bun test
30+
run: bun test

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/.next/*
2+
**/dist/*
3+
*.hbs
4+
node_modules/*

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"tabWidth": 2,
33
"trailingComma": "all",
44
"singleQuote": true,
5-
"jsxSingleQuote": true,
5+
"jsxSingleQuote": true
66
}

.vscode/settings.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.formatOnSave": true,
4-
"eslint.validate": [
5-
"typescript"
6-
],
7-
"eslint.run": "onType",
8-
"eslint.useFlatConfig": true,
9-
"eslint.format.enable": true,
10-
"mdx.server.enable": true,
11-
"editor.codeActionsOnSave": {
12-
"source.fixAll": "explicit"
13-
},
14-
}
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"eslint.validate": ["typescript", "javascript"],
5+
"[json]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[jsonc]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"eslint.run": "onType",
12+
"eslint.useFlatConfig": true,
13+
"eslint.format.enable": true,
14+
"editor.codeActionsOnSave": {
15+
"source.fixAll.eslint": "explicit"
16+
}
17+
}

NoteBlockWorld.code-workspace

Lines changed: 71 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,72 @@
11
{
2-
"folders": [
3-
{
4-
"path": ".",
5-
"name": "Root"
6-
},
7-
{
8-
"path": "./apps/backend",
9-
"name": "Backend"
10-
},
11-
{
12-
"path": "./apps/frontend",
13-
"name": "Frontend"
14-
},
15-
{
16-
"path": "./packages/configs",
17-
"name": "configs"
18-
},
19-
{
20-
"path": "./packages/database",
21-
"name": "database"
22-
},
23-
{
24-
"path": "./packages/song",
25-
"name": "song"
26-
},
27-
{
28-
"path": "./packages/sounds",
29-
"name": "sounds"
30-
},
31-
{
32-
"path": "./packages/thumbnail",
33-
"name": "thumbnail"
34-
},
35-
],
36-
"settings": {
37-
"window.title": "${dirty}${rootName}${separator}${profileName}${separator}${appName}",
38-
"editor.formatOnSave": true,
39-
"eslint.validate": [
40-
"typescript"
41-
],
42-
"eslint.run": "onType",
43-
"eslint.format.enable": true,
44-
"mdx.server.enable": true,
45-
"editor.codeActionsOnSave": {
46-
"source.fixAll": "explicit"
47-
},
48-
"search.exclude": {
49-
"**/.git": true,
50-
"**/node_modules": true,
51-
"**/dist": true,
52-
},
53-
"workbench.colorCustomizations": {
54-
"activityBar.activeBackground": "#fac977",
55-
"activityBar.background": "#fac977",
56-
"activityBar.foreground": "#15202b",
57-
"activityBar.inactiveForeground": "#15202b99",
58-
"activityBarBadge.background": "#069a62",
59-
"activityBarBadge.foreground": "#e7e7e7",
60-
"commandCenter.border": "#15202b99",
61-
"sash.hoverBorder": "#fac977",
62-
"statusBar.background": "#f8b646",
63-
"statusBar.foreground": "#15202b",
64-
"statusBarItem.hoverBackground": "#f6a315",
65-
"statusBarItem.remoteBackground": "#f8b646",
66-
"statusBarItem.remoteForeground": "#15202b",
67-
"titleBar.activeBackground": "#f8b646",
68-
"titleBar.activeForeground": "#15202b",
69-
"titleBar.inactiveBackground": "#f8b64699",
70-
"titleBar.inactiveForeground": "#15202b99"
71-
},
72-
"peacock.color": "#f8b646"
73-
}
74-
}
2+
"folders": [
3+
{
4+
"path": ".",
5+
"name": "Root",
6+
},
7+
{
8+
"path": "./apps/backend",
9+
"name": "Backend",
10+
},
11+
{
12+
"path": "./apps/frontend",
13+
"name": "Frontend",
14+
},
15+
{
16+
"path": "./packages/configs",
17+
"name": "configs",
18+
},
19+
{
20+
"path": "./packages/database",
21+
"name": "database",
22+
},
23+
{
24+
"path": "./packages/song",
25+
"name": "song",
26+
},
27+
{
28+
"path": "./packages/sounds",
29+
"name": "sounds",
30+
},
31+
{
32+
"path": "./packages/thumbnail",
33+
"name": "thumbnail",
34+
},
35+
],
36+
"settings": {
37+
"window.title": "${dirty}${rootName}${separator}${profileName}${separator}${appName}",
38+
"editor.formatOnSave": true,
39+
"eslint.validate": ["typescript"],
40+
"eslint.run": "onType",
41+
"eslint.format.enable": true,
42+
"mdx.server.enable": true,
43+
"editor.codeActionsOnSave": {
44+
"source.fixAll": "explicit",
45+
},
46+
"search.exclude": {
47+
"**/.git": true,
48+
"**/node_modules": true,
49+
"**/dist": true,
50+
},
51+
"workbench.colorCustomizations": {
52+
"activityBar.activeBackground": "#fac977",
53+
"activityBar.background": "#fac977",
54+
"activityBar.foreground": "#15202b",
55+
"activityBar.inactiveForeground": "#15202b99",
56+
"activityBarBadge.background": "#069a62",
57+
"activityBarBadge.foreground": "#e7e7e7",
58+
"commandCenter.border": "#15202b99",
59+
"sash.hoverBorder": "#fac977",
60+
"statusBar.background": "#f8b646",
61+
"statusBar.foreground": "#15202b",
62+
"statusBarItem.hoverBackground": "#f6a315",
63+
"statusBarItem.remoteBackground": "#f8b646",
64+
"statusBarItem.remoteForeground": "#15202b",
65+
"titleBar.activeBackground": "#f8b646",
66+
"titleBar.activeForeground": "#15202b",
67+
"titleBar.inactiveBackground": "#f8b64699",
68+
"titleBar.inactiveForeground": "#15202b99",
69+
},
70+
"peacock.color": "#f8b646",
71+
},
72+
}

apps/backend/nest-cli.json

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
{
2-
"$schema": "https://json.schemastore.org/nest-cli",
3-
"collection": "@nestjs/schematics",
4-
"sourceRoot": "src",
5-
"entryFile": "server/src/main.js",
6-
"compilerOptions": {
7-
"deleteOutDir": true,
8-
"plugins": [
9-
"@nestjs/swagger/plugin"
10-
],
11-
"assets": [
12-
{
13-
"include": "mailing/templates/**/*.{hbs,png}",
14-
"outDir": "dist/server/src/",
15-
"exclude": "dist/**/*"
16-
},
17-
"**/assets/**/*"
18-
],
19-
"watchAssets": true
20-
}
21-
}
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"entryFile": "server/src/main.js",
6+
"compilerOptions": {
7+
"deleteOutDir": true,
8+
"plugins": ["@nestjs/swagger/plugin"],
9+
"assets": [
10+
{
11+
"include": "mailing/templates/**/*.{hbs,png}",
12+
"outDir": "dist/server/src/",
13+
"exclude": "dist/**/*"
14+
},
15+
"**/assets/**/*"
16+
],
17+
"watchAssets": true
18+
}
19+
}

apps/backend/src/auth/auth.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import type { UserDocument } from '@nbw/database';
2-
import { CreateUser } from '@nbw/database';
31
import { Inject, Injectable, Logger } from '@nestjs/common';
42
import { JwtService } from '@nestjs/jwt';
53
import axios from 'axios';
64
import type { Request, Response } from 'express';
75

6+
import { CreateUser } from '@nbw/database';
7+
import type { UserDocument } from '@nbw/database';
88
import { UserService } from '@server/user/user.service';
99

1010
import { DiscordUser } from './types/discordProfile';

apps/backend/src/lib/GetRequestUser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { UserDocument } from '@nbw/database';
21
import {
32
ExecutionContext,
43
HttpException,
@@ -7,6 +6,8 @@ import {
76
} from '@nestjs/common';
87
import type { Request } from 'express';
98

9+
import type { UserDocument } from '@nbw/database';
10+
1011
export const GetRequestToken = createParamDecorator(
1112
(data: unknown, ctx: ExecutionContext) => {
1213
const req = ctx

apps/backend/src/seed/seed.service.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { Instrument, Note, Song } from '@encode42/nbs.js';
22
import { faker } from '@faker-js/faker';
3+
import {
4+
HttpException,
5+
HttpStatus,
6+
Inject,
7+
Injectable,
8+
Logger,
9+
} from '@nestjs/common';
10+
311
import { UPLOAD_CONSTANTS } from '@nbw/config';
412
import {
513
CategoryType,
@@ -9,14 +17,6 @@ import {
917
UserDocument,
1018
VisibilityType,
1119
} from '@nbw/database';
12-
import {
13-
HttpException,
14-
HttpStatus,
15-
Inject,
16-
Injectable,
17-
Logger,
18-
} from '@nestjs/common';
19-
2020
import { SongService } from '@server/song/song.service';
2121
import { UserService } from '@server/user/user.service';
2222

0 commit comments

Comments
 (0)