Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerthox committed May 4, 2024
1 parent 8092d08 commit 1eff60c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module.exports = {
version: "17.0.2" // stable Discord
}
},
parserOptions: {
project: ["./tsconfig.json"]
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
Expand Down
4 changes: 2 additions & 2 deletions src/BetterVolume/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createPlugin, Finder, Filters, Patcher, React, Logger} from "dium";
import {Snowflake, MediaEngineStore, MediaEngineContext, AudioConvert, MediaEngineActions, Dispatcher} from "@dium/modules";
import {createPlugin, Finder, Filters, Patcher, React} from "dium";
import {Snowflake, MediaEngineStore, MediaEngineContext, AudioConvert, MediaEngineActions} from "@dium/modules";
import {Settings} from "./settings";
import {css} from "./styles.module.scss";
import {MenuItem} from "@dium/components";
Expand Down
10 changes: 5 additions & 5 deletions src/BetterVolume/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MAX_VOLUME_PERC = 200;

const MAX_VOLUME_AMP = AudioConvert.perceptualToAmplitude(MAX_VOLUME_PERC);

export const dispatchVolumeOverrides = () => {
export const dispatchVolumeOverrides = (): void => {
for (const [userId, volume] of Object.entries(Settings.current.volumeOverrides)) {
Dispatcher.dispatch<SetVolumeAction>({
type: ActionType.AUDIO_SET_LOCAL_VOLUME,
Expand All @@ -29,11 +29,11 @@ interface SetVolumeAction extends Flux.Action {
context: MediaEngineContext;
}

const settingsUpdateHandler = (action: Flux.Action) => dispatchVolumeOverrides();
const settingsUpdateHandler = (_action: Flux.Action) => dispatchVolumeOverrides();

interface AudioSettingsManager {
actions: Record<string, Flux.ActionHandler> & {
AUDIO_SET_LOCAL_VOLUME: Flux.ActionHandler<SetVolumeAction>
AUDIO_SET_LOCAL_VOLUME: Flux.ActionHandler<SetVolumeAction>;
};
initializedCount: number;
stores: Map<any, any>;
Expand Down Expand Up @@ -70,7 +70,7 @@ let originalHandler = null;

const hasSetVolume = Filters.byKeys(ActionType.AUDIO_SET_LOCAL_VOLUME);

export const handleVolumeSync = () => {
export const handleVolumeSync = (): void => {
Dispatcher.subscribe(ActionType.USER_SETTINGS_PROTO_UPDATE, settingsUpdateHandler);
Logger.log(`Subscribed to ${ActionType.USER_SETTINGS_PROTO_UPDATE} events`);

Expand All @@ -88,7 +88,7 @@ export const handleVolumeSync = () => {
});
};

export const resetVolumeSync = () => {
export const resetVolumeSync = (): void => {
Dispatcher.unsubscribe(ActionType.USER_SETTINGS_PROTO_UPDATE, settingsUpdateHandler);
Logger.log(`Unsubscribed from ${ActionType.USER_SETTINGS_PROTO_UPDATE} events`);

Expand Down
4 changes: 2 additions & 2 deletions src/CollapseEmbeds/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createPlugin, Filters, Finder, PatchDataWithResult, Patcher, React, Logger, Utils} from "dium";
import {createPlugin, Filters, Finder, PatchDataWithResult, Patcher, React, Utils} from "dium";
import {Message, Attachment} from "@dium/modules";
import {FormSwitch, MessageFooter, Embed, MediaItem, MediaItemProps} from "@dium/components";
import {FormSwitch, MessageFooter, Embed, MediaItemProps} from "@dium/components";
import {Settings} from "./settings";
import {Hider, AccessoryType} from "./hider";
import {css} from "./styles.module.scss";
Expand Down

0 comments on commit 1eff60c

Please sign in to comment.