Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): update eslint-config to v1.0.0-beta.1 #239

Merged
merged 2 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@commitlint/types": "19.5.0",
"@eslint-react/eslint-plugin": "1.14.2",
"@eslint/config-inspector": "0.5.5",
"@isentinel/eslint-config": "0.10.0",
"@isentinel/eslint-config": "1.0.0-beta.1",
"@rbxts/compiler-types": "3.0.0-types.0",
"@rbxts/types": "1.0.813",
"eslint": "9.21.0",
Expand Down
462 changes: 309 additions & 153 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/client/audio/sound-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class SoundController implements OnInit, OnStart {
this.soundGroups.set(SoundType.Music, this.makeSoundGroup(SoundType.Music));
this.soundGroups.set(SoundType.SoundEffect, this.makeSoundGroup(SoundType.SoundEffect));

this.logger.Info(`Setup SoundGroup instances`);
this.logger.Info("Setup SoundGroup instances");
}

/** @ignore */
Expand Down Expand Up @@ -127,11 +127,11 @@ export default class SoundController implements OnInit, OnStart {

private onSettingsChanged(current: PlayerSettings): void {
const musicGroup = this.soundGroups.get(SoundType.Music);
assert(musicGroup, `Music SoundGroup not found`);
assert(musicGroup, "Music SoundGroup not found");
musicGroup.Volume = current.musicVolume;

const sfxGroup = this.soundGroups.get(SoundType.SoundEffect);
assert(sfxGroup, `SoundEffect SoundGroup not found`);
assert(sfxGroup, "SoundEffect SoundGroup not found");
sfxGroup.Volume = current.sfxVolume;
}
}
4 changes: 2 additions & 2 deletions src/client/player/character/character-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class CharacterController implements OnStart {
return;
}

this.logger.Verbose(`Character has been removed.`);
this.logger.Verbose("Character has been removed.");

connection.Disconnect();
this.currentCharacter = undefined;
Expand All @@ -110,7 +110,7 @@ export default class CharacterController implements OnStart {
* @param rig - The character rig that was loaded.
*/
private onRigLoaded(rig: CharacterRig): void {
this.logger.Debug(`Loaded character rig.`);
this.logger.Debug("Loaded character rig.");
this.currentCharacter = rig;
this.onCharacterAdded.Fire(rig);
}
Expand Down
4 changes: 2 additions & 2 deletions src/client/runtime.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function start(): void {

Flamework.addPaths("src/client");

Log.Info(`Flamework ignite!`);
Log.Info("Flamework ignite!");
Flamework.ignite();

createApp().catch(() => {
Log.Fatal(`Failed to create React app!`);
Log.Fatal("Failed to create React app!");
});
}

Expand Down
25 changes: 12 additions & 13 deletions src/server/player/character/character-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,18 @@ export default class CharacterService implements OnStart, OnPlayerJoin {
this.logger.Debug(`Loaded character rig for ${name}`);

debug.profilebegin("Lifecycle_Character_Added");
{
for (const { id, event } of this.characterAddedEvents) {
janitor
.Add(
Promise.defer(() => {
debug.profilebegin(id);
event.onCharacterAdded(rig, playerEntity);
}),
)
.catch(err => {
this.logger.Error(`Error in character lifecycle ${id}: ${err}`);
});
}

for (const { id, event } of this.characterAddedEvents) {
janitor
.Add(
Promise.defer(() => {
debug.profilebegin(id);
event.onCharacterAdded(rig, playerEntity);
}),
)
.catch(err => {
this.logger.Error(`Error in character lifecycle ${id}: ${err}`);
});
}

debug.profileend();
Expand Down
4 changes: 2 additions & 2 deletions src/server/player/leaderstats-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class LeaderstatsService implements OnInit, OnPlayerJoin, OnPlayerLeave {
): void {
assert(
this.leaderstats.find(entry => entry.Name === statName) === undefined,
`Stat provided already exists.`,
"Stat provided already exists.",
);

this.leaderstats.push({
Expand All @@ -154,7 +154,7 @@ export class LeaderstatsService implements OnInit, OnPlayerJoin, OnPlayerLeave {
ValueType: valueType,
});

this.logger.Info(`Registered leaderboard stat {@stat}`, statName);
this.logger.Info("Registered leaderboard stat {@stat}", statName);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/server/player/player-removal-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ export default class PlayerRemovalService {
public toMessage(code: KickCode): string {
switch (code) {
case KickCode.PlayerFullServer: {
return `The server is full. Please try again later.`;
return "The server is full. Please try again later.";
}
case KickCode.PlayerInstantiationError: {
return `An error occurred while instantiating your player. Please rejoin the game.`;
return "An error occurred while instantiating your player. Please rejoin the game.";
}
case KickCode.PlayerProfileReleased: {
return `Your player profile has been released. Please rejoin the game.`;
return "Your player profile has been released. Please rejoin the game.";
}
case KickCode.PlayerProfileUndefined: {
return `Your player profile is undefined. Please rejoin the game.`;
return "Your player profile is undefined. Please rejoin the game.";
}
}
}
Expand Down
70 changes: 34 additions & 36 deletions src/server/player/player-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,18 @@ export default class PlayerService implements OnStart {

// Call all connected lifecycle events
debug.profilebegin("Lifecycle_Player_Join");
{
for (const { id, event } of this.playerJoinEvents) {
janitor
.AddPromise(
Promise.defer(() => {
debug.profilebegin(id);
event.onPlayerJoin(playerEntity);
}),
)
.catch(err => {
this.logger.Error(`Error in player lifecycle ${id}: ${err}`);
});
}

for (const { id, event } of this.playerJoinEvents) {
janitor
.AddPromise(
Promise.defer(() => {
debug.profilebegin(id);
event.onPlayerJoin(playerEntity);
}),
)
.catch(err => {
this.logger.Error(`Error in player lifecycle ${id}: ${err}`);
});
}

debug.profileend();
Expand Down Expand Up @@ -222,29 +221,28 @@ export default class PlayerService implements OnStart {
// Call all connected lifecycle events
const promises = new Array<Promise<void>>();
debug.profilebegin("Lifecycle_Player_Leave");
{
for (const { id, event } of this.playerLeaveEvents) {
const promiseEvent = Promise.defer<void>((resolve, reject) => {
debug.profilebegin(id);
try {
const leaveEvent = async (): Promise<void> => {
await event.onPlayerLeave(playerEntity);
};

const [success, err] = leaveEvent().await();
if (!success) {
reject(err);
return;
}

resolve();
} catch (err) {
this.logger.Error(`Error in player lifecycle ${id}: ${err}`);

for (const { id, event } of this.playerLeaveEvents) {
const promiseEvent = Promise.defer<void>((resolve, reject) => {
debug.profilebegin(id);
try {
const leaveEvent = async (): Promise<void> => {
await event.onPlayerLeave(playerEntity);
};

const [success, err] = leaveEvent().await();
if (!success) {
reject(err);
return;
}
});

promises.push(promiseEvent);
}
resolve();
} catch (err) {
this.logger.Error(`Error in player lifecycle ${id}: ${err}`);
}
});

promises.push(promiseEvent);
}

debug.profileend();
Expand All @@ -265,13 +263,13 @@ export default class PlayerService implements OnStart {
return;
}

this.logger.Debug(`Game closing, holding open until all player entities are removed.`);
this.logger.Debug("Game closing, holding open until all player entities are removed.");

while (!this.playerEntities.isEmpty()) {
this.onEntityRemoving.Wait();
}

this.logger.Debug(`All player entities removed, closing game.`);
this.logger.Debug("All player entities removed, closing game.");
});
}
}
2 changes: 1 addition & 1 deletion src/server/runtime.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function start(): void {

Flamework.addPaths("src/server");

Log.Info(`Flamework ignite!`);
Log.Info("Flamework ignite!");
Flamework.ignite();
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/assets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare const assets: {
};
marketing: {
"example-icon": "rbxassetid://18110928241";
googly: "rbxassetid://18110928530";
"googly": "rbxassetid://18110928530";
};
};
export = assets;
2 changes: 1 addition & 1 deletion src/shared/util/flamework-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Flamework, Modding, Reflect } from "@flamework/core";

export const FLAMEWORK_DEFAULT_LOAD_ORDER = 1;

export const FLAMEWORK_DECORATOR_PREFIX = `flamework:decorators.`;
export const FLAMEWORK_DECORATOR_PREFIX = "flamework:decorators.";

/**
* Checks if the given object is decorated with a specific identifier.
Expand Down
60 changes: 60 additions & 0 deletions src/types/promise.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
interface PromiseLike<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
*
* @param onfulfilled - The callback to execute when the Promise is
* resolved.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then(
onfulfilled?: undefined,
onrejected?: (reason: unknown) => PromiseLike<T> | T,
): PromiseLike<T>;

/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
*
* @param onfulfilled - The callback to execute when the Promise is
* resolved.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<U>(
onfulfilled: (value: T) => PromiseLike<U> | U,
onrejected?: (reason: unknown) => PromiseLike<U> | U,
): PromiseLike<U>;
}

interface Promise<T> extends PromiseLike<T> {
/**
* Attaches a callback for only the rejection of the Promise.
*
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch(onrejected?: (reason: unknown) => PromiseLike<T> | T): Promise<T>;

/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
*
* @param onfulfilled - The callback to execute when the Promise is
* resolved.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then(onfulfilled?: undefined, onrejected?: (reason: unknown) => PromiseLike<T> | T): Promise<T>;

/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
*
* @param onfulfilled - The callback to execute when the Promise is
* resolved.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<U>(
onfulfilled: (value: T) => PromiseLike<U> | U,
onrejected?: (reason: unknown) => PromiseLike<U> | U,
): Promise<U>;
}
24 changes: 12 additions & 12 deletions src/types/services.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
interface ReplicatedStorage {
rbxts_include: Folder & {
"rbxts_include": Folder & {
Promise: ModuleScript;
RuntimeLib: ModuleScript;
};
TS: Folder & {
"TS": Folder & {
assets: ModuleScript;
constants: ModuleScript;
functions: Folder & {
Expand All @@ -21,11 +21,11 @@ interface ReplicatedStorage {
persistent: ModuleScript & {
"persistent-selectors": ModuleScript;
"persistent-slice": ModuleScript & {
achievements: ModuleScript;
balance: ModuleScript;
"achievements": ModuleScript;
"balance": ModuleScript;
"default-data": ModuleScript;
mtx: ModuleScript;
settings: ModuleScript;
"mtx": ModuleScript;
"settings": ModuleScript;
};
};
};
Expand All @@ -50,12 +50,12 @@ interface ReplicatedStorage {
interface ServerScriptService {
TS: Folder & {
"mtx-service": ModuleScript;
network: ModuleScript;
player: Folder & {
character: Folder & {
"network": ModuleScript;
"player": Folder & {
"character": Folder & {
"character-service": ModuleScript;
};
data: Folder & {
"data": Folder & {
"player-data-service": ModuleScript;
"validate-data": ModuleScript;
};
Expand All @@ -66,8 +66,8 @@ interface ServerScriptService {
"player-service": ModuleScript;
"with-player-entity": ModuleScript;
};
runtime: Script;
store: ModuleScript & {
"runtime": Script;
"store": ModuleScript & {
middleware: Folder & {
broadcaster: ModuleScript;
};
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"useUnknownInCatchVariables": true,
"downlevelIteration": true,
"outDir": "out/",
"allowSyntheticDefaultImports": true,
Expand Down
Loading