Skip to content

Commit

Permalink
chore: more cleanup with biome, and fully migrate to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
xhayper committed May 11, 2024
1 parent b498bde commit 81bb12d
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 60 deletions.
28 changes: 24 additions & 4 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>sapphiredev/readme:sapphire-renovate"],
"schedule": ["every month"]
}
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>sapphiredev/.github:sapphire-renovate"],
"bun": {
"rangeStrategy": "bump",
"packageRules": [
{
"matchUpdateTypes": ["patch"],
"matchCurrentVersion": "/^0\\./",
"automerge": true,
"platformAutomerge": true
},
{
"matchUpdateTypes": ["minor", "patch"],
"matchCurrentVersion": ">=1.0.0",
"automerge": true,
"platformAutomerge": true
},
{
"matchDepTypes": ["engines"],
"enabled": false
}
]
}
}
68 changes: 32 additions & 36 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": [
"dist",
"node_modules",
"types",
".next",
"generated",
"*.json"
]
},
"formatter": {
"enabled": true,
"lineEnding": "lf",
"indentWidth": 2,
"indentStyle": "tab",
"lineWidth": 200
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"suspicious": {
"noArrayIndexKey": "off",
"noExplicitAny": "warn"
}
}
}
}
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"ignore": ["dist", "node_modules", "types", ".next", "generated", "*.json"]
},
"formatter": {
"enabled": true,
"lineEnding": "lf",
"indentWidth": 2,
"indentStyle": "tab",
"lineWidth": 200
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"suspicious": {
"noArrayIndexKey": "off",
"noExplicitAny": "warn"
},
"correctness": {
"noUnusedImports": "warn"
}
}
}
}
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"changeset:version": "changeset version",
"docs": "typedoc && cd docs && find . -type f -name \"*.html\" -exec sed -i'' -e 's/__namedParameters/options/g' {} +",
"prepublishOnly": "turbo run prepublishOnly",
"prepare": "husky init"
"prepare": "husky"
},
"devDependencies": {
"@biomejs/biome": "1.7.3",
Expand Down
1 change: 0 additions & 1 deletion packages/api/lib/rest/errors/PermissionsError.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { RequestOptions, ResponseDetails } from "../RestManager";
import { GuildedAPIError } from "./GuildedAPIError";

export class PermissionsError extends GuildedAPIError {}
1 change: 0 additions & 1 deletion packages/api/lib/rest/util/routes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { WSPayload, WSSchema } from "../../generated/api-typings";
import type { SocialLinkPayload } from "../../generated/router";

export const ROUTES = {
Expand Down
2 changes: 1 addition & 1 deletion packages/gil/__tests__/shared/commands/Help.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandExecuteContext, type CommandOptions, GilClient } from "../../../lib";
import { Command, type CommandExecuteContext, type CommandOptions } from "../../../lib";

export default class Help extends Command {
options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/gil/__tests__/shared/commands/Ping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Command, type CommandOptions, StoredRoleType } from "../../../lib";
import { Command, type CommandOptions } from "../../../lib";

export default class Ping extends Command {
options = {
Expand Down
2 changes: 1 addition & 1 deletion packages/gil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "dist/index.js",
"types": "types/index.d.ts",
"scripts": {
"test": "ts-node test/index.ts",
"test": "bun test",
"build": "tsc && gen-esm-wrapper . ./dist/index.mjs",
"build:typecheck": "tsc --noEmit",
"prepublishOnly": "rimraf dist/ && rimraf types/ && bun run build",
Expand Down
1 change: 0 additions & 1 deletion packages/guilded.js/lib/gateway/handler/BotEventHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { WSPacket } from "@guildedjs/api";
import { WSPayload } from "@guildedjs/api";
import { constants } from "../../constants";
import { Server } from "../../structures/Server";
import { GatewayEventHandler } from "./GatewayEventHandler";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Collection } from "@discordjs/collection";
import type { Client } from "../../structures/Client";
import { GlobalManager } from "./GlobalManager";

/**
Expand Down
1 change: 0 additions & 1 deletion packages/guilded.js/lib/managers/global/RoleManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Collection } from "@discordjs/collection";
import type { RolesService } from "@guildedjs/api";
import { RolePayload } from "@guildedjs/api";
import { Role } from "../../structures";
import type { OptionBody } from "../../typings";
import { CacheableStructManager } from "./CacheableStructManager";
Expand Down
12 changes: 1 addition & 11 deletions packages/guilded.js/lib/typings.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import type { Collection } from "@discordjs/collection";
import type {
ChatService,
DocPayload,
EmbedPayload,
ListItemPayload,
ListItemSummaryPayload,
ServerMemberBanPayload,
ServerMemberPayload,
ServerMemberSummaryPayload,
SocialLinkPayload,
} from "@guildedjs/api";
import type { ChatService, DocPayload, ListItemPayload, ListItemSummaryPayload, ServerMemberBanPayload, ServerMemberPayload, ServerMemberSummaryPayload, SocialLinkPayload } from "@guildedjs/api";
import type { MemberRemovedEvent, MemberUnbannedEvent, MemberUpdatedEvent, MessageDeletedEvent, MessageReactionDeletedEvent } from "./events";
import type { Channel, Embed, Member, MemberBan, Message, MessageReaction, Webhook } from "./structures";
import type { CalendarEvent, CalendarEventRsvp } from "./structures/CalendarEvent";
Expand Down

0 comments on commit 81bb12d

Please sign in to comment.