Skip to content

Commit 48c3844

Browse files
committed
chore: idk something
enjoy the 4394 problems, i got a bit silly
1 parent 78122dd commit 48c3844

File tree

11 files changed

+193
-14489
lines changed

11 files changed

+193
-14489
lines changed

.eslintignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.now/*
2+
*.css
3+
.changeset
4+
dist
5+
esm/*
6+
public/*
7+
tests/*
8+
scripts/*
9+
*.config.js
10+
.DS_Store
11+
node_modules
12+
coverage
13+
.next
14+
build
15+
!.commitlintrc.cjs
16+
!.lintstagedrc.cjs
17+
!jest.config.js
18+
!plopfile.js
19+
!react-shim.js
20+
!tsup.config.ts

.eslintrc.json

Lines changed: 122 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,124 @@
11
{
2-
"extends": "eslint:recommended",
3-
"env": {
4-
"node": true,
5-
"es6": true
6-
},
7-
"parserOptions": {
8-
"sourceType": "module",
9-
"ecmaVersion": "latest"
10-
},
11-
"rules": {
12-
"arrow-spacing": ["warn", { "before": true, "after": true }],
13-
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
14-
"comma-dangle": ["error", "always-multiline"],
15-
"comma-spacing": "error",
16-
"comma-style": "error",
17-
"curly": ["error", "multi-line", "consistent"],
18-
"dot-location": ["error", "property"],
19-
"handle-callback-err": "off",
20-
"indent": ["error", "tab"],
21-
"keyword-spacing": "error",
22-
"max-nested-callbacks": ["error", { "max": 4 }],
23-
"max-statements-per-line": ["error", { "max": 2 }],
24-
"no-console": "off",
25-
"no-empty-function": "error",
26-
"no-floating-decimal": "error",
27-
"no-inline-comments": "error",
28-
"no-lonely-if": "error",
29-
"no-multi-spaces": "error",
30-
"no-multiple-empty-lines": [
31-
"error",
32-
{ "max": 2, "maxEOF": 1, "maxBOF": 0 }
33-
],
34-
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }],
35-
"no-trailing-spaces": ["error"],
36-
"no-var": "error",
37-
"object-curly-spacing": ["error", "always"],
38-
"prefer-const": "error",
39-
"quotes": ["error", "single"],
40-
"semi": ["error", "always"],
41-
"space-before-blocks": "error",
42-
"space-before-function-paren": [
43-
"error",
44-
{
45-
"anonymous": "never",
46-
"named": "never",
47-
"asyncArrow": "always"
48-
}
49-
],
50-
"space-in-parens": "error",
51-
"space-infix-ops": "error",
52-
"space-unary-ops": "error",
53-
"spaced-comment": "error",
54-
"yoda": "error"
55-
}
2+
"$schema": "https://json.schemastore.org/eslintrc.json",
3+
"env": {
4+
"browser": false,
5+
"es2021": true,
6+
"node": true
7+
},
8+
"extends": [
9+
"plugin:react/recommended",
10+
"plugin:prettier/recommended",
11+
"plugin:react-hooks/recommended",
12+
"plugin:jsx-a11y/recommended"
13+
],
14+
"plugins": [
15+
"react",
16+
"unused-imports",
17+
"import",
18+
"@typescript-eslint",
19+
"jsx-a11y",
20+
"prettier"
21+
],
22+
"parser": "@typescript-eslint/parser",
23+
"parserOptions": {
24+
"ecmaFeatures": {
25+
"jsx": true
26+
},
27+
"ecmaVersion": 12,
28+
"sourceType": "module"
29+
},
30+
"settings": {
31+
"react": {
32+
"version": "detect"
33+
}
34+
},
35+
"rules": {
36+
// "no-console": "warn",
37+
"react/prop-types": "off",
38+
"react/jsx-uses-react": "off",
39+
"react/react-in-jsx-scope": "off",
40+
"react-hooks/exhaustive-deps": "off",
41+
"jsx-a11y/click-events-have-key-events": "warn",
42+
"jsx-a11y/interactive-supports-focus": "warn",
43+
"prettier/prettier": [
44+
"warn",
45+
{
46+
"tabWidth": 4
47+
}
48+
],
49+
"no-unused-vars": "off",
50+
"unused-imports/no-unused-vars": "off",
51+
"unused-imports/no-unused-imports": "warn",
52+
"@typescript-eslint/no-unused-vars": [
53+
"warn",
54+
{
55+
"args": "after-used",
56+
"ignoreRestSiblings": false,
57+
"argsIgnorePattern": "^_.*?$"
58+
}
59+
],
60+
"import/order": [
61+
"warn",
62+
{
63+
"groups": [
64+
"type",
65+
"builtin",
66+
"object",
67+
"external",
68+
"internal",
69+
"parent",
70+
"sibling",
71+
"index"
72+
],
73+
"pathGroups": [
74+
{
75+
"pattern": "~/**",
76+
"group": "external",
77+
"position": "after"
78+
}
79+
],
80+
"newlines-between": "always"
81+
}
82+
],
83+
"react/self-closing-comp": "warn",
84+
"react/jsx-sort-props": [
85+
"warn",
86+
{
87+
"callbacksLast": true,
88+
"shorthandFirst": true,
89+
"noSortAlphabetically": false,
90+
"reservedFirst": true
91+
}
92+
],
93+
"padding-line-between-statements": [
94+
"warn",
95+
{
96+
"blankLine": "always",
97+
"prev": "*",
98+
"next": "return"
99+
},
100+
{
101+
"blankLine": "always",
102+
"prev": [
103+
"const",
104+
"let",
105+
"var"
106+
],
107+
"next": "*"
108+
},
109+
{
110+
"blankLine": "any",
111+
"prev": [
112+
"const",
113+
"let",
114+
"var"
115+
],
116+
"next": [
117+
"const",
118+
"let",
119+
"var"
120+
]
121+
}
122+
]
123+
}
56124
}

.github/workflows/build.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
name: Build Site Test
1+
name: Update bun.lockb
22

33
on:
44
push:
55
branches:
66
- '*'
7-
paths:
8-
- "web/**"
9-
pull_request:
10-
types: [opened, reopened, synchronize]
7+
8+
permissions:
9+
contents: write
1110

1211
jobs:
13-
build-site-test:
14-
name: Build Site Test
12+
update-bun-lockb:
13+
name: "Update bun.lockb"
1514
runs-on: ubuntu-latest
16-
1715
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v2
20-
21-
- name: Setup Bun
16+
- name: Set up Bun
2217
uses: oven-sh/setup-bun@v1
2318

24-
- name: Install dependencies
19+
- name: Check out repository
20+
uses: actions/checkout@v4
21+
22+
- name: Install dependencies with Bun
2523
run: bun install
2624

27-
- name: Run ESLint
28-
run: bun run build
25+
- name: Check for changes
26+
id: git_status
27+
run: |
28+
git add bun.lockb
29+
if [ -z "$(git status --porcelain)" ]; then
30+
echo "No changes to bun.lockb"
31+
echo "::set-output name=changes_detected::false"
32+
else
33+
echo "Changes detected to bun.lockb"
34+
echo "::set-output name=changes_detected::true"
35+
fi
36+
37+
- name: Commit and push changes to bun.lockb
38+
if: steps.git_status.outputs.changes_detected == 'true'
39+
run: |
40+
git config --global user.name 'github-actions[bot]'
41+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
42+
git commit -m "Update bun.lockb (via GitHub Actions)"
43+
git pull --rebase origin main
44+
git push

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

bot/src/commands.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Commands taken from https://github.com/NiaAxern/discord-youtube-subscriber-count/blob/main/src/commands/utilities.ts
2-
31
import client from '.';
42
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, type CommandInteraction, ChannelType, type APIApplicationCommandOption, GuildMember, AttachmentBuilder, ComponentType } from 'discord.js';
53
import { heapStats } from 'bun:jsc';

bot/src/utils/sendAutoUpdates.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ import client from "..";
33
import leaderboardEmbed from "./leaderboardEmbed";
44
import { getAllGuildsWithUpdatesEnabled } from "./requestAPI";
55

6+
interface Guild {
7+
id: string;
8+
updates_channel_id: string;
9+
}
10+
611
export default async function () {
712
const allGuildsData = await getAllGuildsWithUpdatesEnabled()
813

9-
// TODO: Type guild
10-
allGuildsData.forEach(async (guild: any) => {
14+
allGuildsData.forEach(async (guild: Guild) => {
1115
const [embed, row] = await leaderboardEmbed(guild.id)
1216
const channel = await client.channels.fetch(guild.updates_channel_id) as TextChannel;
1317
await channel?.send({ embeds: [embed], components: [row] });

bun.lockb

10 KB
Binary file not shown.

eslint.config.mjs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)