Skip to content

Commit

Permalink
Chore/knip cleanup (WoWAnalyzer#6723)
Browse files Browse the repository at this point in the history
* [Chore] Remove duplicate exports

Prioritising regular exports over default exports

* [Chore] Remove export from unused exported types

* [Chore] Remove duplicated exported values related to Sepsis

* [Chore] Only export SELECTED_PLAYER and SELECTED_PLAYER_PET from one place

* [Chore] Clean up unused exported types

* [Chore] Remove unused exports in namespaces
  • Loading branch information
Pewtro authored Apr 22, 2024
1 parent 7049d61 commit b67a4cb
Show file tree
Hide file tree
Showing 181 changed files with 249 additions and 471 deletions.
1 change: 1 addition & 0 deletions src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 4, 22), 'Clean up dead code using knip', Putro),
change(date(2024, 4, 20), 'Fix friendly/enemy determination', emallson),
change(date(2024, 4, 17), 'Add 10.2.7 patch.', ToppleTheNun),
change(date(2024, 4, 12), 'Fix mana level chart', emallson),
Expand Down
4 changes: 0 additions & 4 deletions src/analysis/classic/deathknight/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/druid/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Analyzer, { Options } from 'parser/core/Analyzer';
import { SELECTED_PLAYER } from 'parser/core/EventFilter';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import SpellUsable from 'parser/shared/modules/SpellUsable';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AnyEvent } from 'parser/core/Events';
import { Info } from 'parser/core/metric';
import castCount from 'parser/shared/metrics/castCount';

export interface LowRankSpells {
interface LowRankSpells {
[primarySpellId: number]: number[];
}

Expand Down
3 changes: 0 additions & 3 deletions src/analysis/classic/hunter/shared/SPELLS_PET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ export const GORE = 35298; // r9
export const SCORPID_POISON = 27060; // r5
// Serpent
export const POISON_SPIT = 35392; // r3
// Turtle
export const SHELL_SHIELD = 26064; // r1
// Warp Stalker
export const CLAW = 27049; // r9
export const WARP = 35346; // r1
// Wind Serpent
export const LIGHTNING_BREATH = 25012; // r6
// Wolf
Expand Down
4 changes: 0 additions & 4 deletions src/analysis/classic/hunter/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ export default lowRankSpells;
export const whitelist = {
[SPELLS.EXPLOSIVE_SHOT.id]: [60052],
};

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { AnyEvent } from 'parser/core/Events';
import { Info } from 'parser/core/metric';
import castCount from 'parser/shared/metrics/castCount';

export interface LowRankSpells {
interface LowRankSpells {
[primarySpellId: number]: number[];
}

Expand Down
4 changes: 0 additions & 4 deletions src/analysis/classic/mage/arcane/CONFIG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import type Config from 'parser/Config';

import CHANGELOG from './CHANGELOG';

export enum Build {
DEFAULT = 'default',
}

const config: Config = {
// The people that have contributed to this spec recently. People don't have to sign up to be long-time maintainers to be included in this list. If someone built a large part of the spec or contributed something recently to that spec, they can be added to the contributors list. If someone goes MIA, they may be removed after major changes or during a new expansion.
contributors: [jazminite],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ import SPELLS from 'common/SPELLS/classic/mage';
const NEW_ARCANE_MISSILES_TIMEOUT = 5000;
const ARCANE_MISSILES_BOLT_COUNT = 5;

export interface ArcaneMissilesLog {
arcaneMissilesCastEvents: CastEvent[];
arcaneMissilesDamageEvents: DamageEvent[];
}

export interface ArcaneMissilesBeginChannelEvent extends BeginChannelEvent {
interface ArcaneMissilesBeginChannelEvent extends BeginChannelEvent {
arcaneMissilesCastEvents: CastEvent[];
arcaneMissilesDamageEvents: DamageEvent[];
}
Expand Down
3 changes: 1 addition & 2 deletions src/analysis/classic/mage/shared/ColdSnap.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Analyzer, { Options } from 'parser/core/Analyzer';
import { SELECTED_PLAYER } from 'parser/core/EventFilter';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events from 'parser/core/Events';
import SpellUsable from 'parser/shared/modules/SpellUsable';

Expand Down
4 changes: 0 additions & 4 deletions src/analysis/classic/mage/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/paladin/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/priest/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/rogue/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import SPELLS from 'common/SPELLS/classic/shaman';
import { TotemElements } from 'analysis/classic/shaman/shared/totems/totemConstants';
import { TotemTracker } from 'analysis/classic/shaman/shared';

export interface ChecklistProps extends BaseChecklistProps {
interface ChecklistProps extends BaseChecklistProps {
totemTracker: TotemTracker;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import SPELLS from 'common/SPELLS/classic';
import { TotemElements } from 'analysis/classic/shaman/shared/totems/totemConstants';
import { TotemTracker } from 'analysis/classic/shaman/shared';

export interface ChecklistProps extends BaseChecklistProps {
interface ChecklistProps extends BaseChecklistProps {
totemTracker: TotemTracker;
}

Expand Down
4 changes: 2 additions & 2 deletions src/analysis/classic/shaman/shared/TotemTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import {
TOTEMS_BY_ELEMENT,
} from './totems/totemConstants';

export interface TotemEventTracker {
interface TotemEventTracker {
[TotemElements.Fire]: TotemEvent[];
[TotemElements.Water]: TotemEvent[];
[TotemElements.Earth]: TotemEvent[];
[TotemElements.Air]: TotemEvent[];
}

export interface TotemEvent {
interface TotemEvent {
totemSpellId: number;
totemName: string; // This is just to make debugging easier
summonedAt: number;
Expand Down
4 changes: 0 additions & 4 deletions src/analysis/classic/shaman/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/warlock/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ export default lowRankSpells;
export const whitelist = {
[SPELLS.LIFE_TAP.id]: [1454],
};

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
4 changes: 0 additions & 4 deletions src/analysis/classic/warrior/shared/lowRankSpells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ const lowRankSpells = Object.entries(SPELLS).reduce((result, [str, obj]) => {
}, {});

export default lowRankSpells;

export interface LowRankSpells {
[primarySpellId: number]: number[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SUGGESTION_IMPORTANCE from 'parser/core/ISSUE_IMPORTANCE';
import { BoolThreshold, ThresholdStyle, When } from 'parser/core/ParseResults';
import * as React from 'react';

export interface RuneForgeCheckItem {
interface RuneForgeCheckItem {
forge: Enchant;
importance: SUGGESTION_IMPORTANCE;
suggestion: React.ReactNode;
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/retail/demonhunter/havoc/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TALENTS from 'common/TALENTS/demonhunter';
import { ResourceLink, SpellLink } from 'interface';
import PreparationSection from 'interface/guide/components/Preparation/PreparationSection';
import { explanationAndDataSubsection } from 'interface/guide/components/ExplanationRow';
import HideExplanationsToggle from 'interface/guide/components/HideExplanationsToggle';
import { HideExplanationsToggle } from 'interface/guide/components/HideExplanationsToggle';
import CooldownUsage from 'parser/core/MajorCooldowns/CooldownUsage';
import RESOURCE_TYPES from 'game/RESOURCE_TYPES';

Expand All @@ -15,7 +15,7 @@ import {
PERFECT_TIME_AT_FURY_CAP,
} from './modules/resourcetracker/FuryTracker';
import FuryCapWaste from './guide/FuryCapWaste';
import HideGoodCastsToggle from 'interface/guide/components/HideGoodCastsToggle';
import { HideGoodCastsToggle } from 'interface/guide/components/HideGoodCastsToggle';
import { PerformanceStrong } from 'analysis/retail/priest/shadow/modules/guide/ExtraComponents';
import { formatPercentage } from 'common/format';
import ActiveTimeGraph from 'parser/ui/ActiveTimeGraph';
Expand Down
34 changes: 5 additions & 29 deletions src/analysis/retail/demonhunter/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ export const SHATTERED_RESTORATION_SCALING = [0, 5, 10];

export const UNRESTRAINED_FURY_SCALING = [0, 10, 20];

export const WILL_OF_THE_ILLIDARI_SCALING = [0, 2, 4];

export const ILLIDARI_KNOWLEDGE_SCALING = [0, 2, 4];

export const SOUL_RENDING_SCALING = [0, 5, 10];

export const SOUL_RENDING_ADDITIONAL_METAMORPHOSIS_SCALING = [0, 10, 20];

export const INFERNAL_ARMOR_SCALING = [0, 10, 20];

export const ERRATIC_FELHEART_SCALING = [0, 0.1, 0.2];

export const PITCH_BLACK_SCALING = [0, 120];
Expand All @@ -27,8 +17,6 @@ export const CHAMPION_OF_THE_GLAIVE_SCALING = [0, 1];

export const RUSH_OF_CHAOS_SCALING = [0, 30, 60];

export const DEMONIC_ORIGINS_CDR_SCALING = [0, 60];

export const DEMONIC_DURATION = 6000;

export function getSigilOfFlameSpell(c: Combatant): Spell {
Expand Down Expand Up @@ -77,41 +65,29 @@ export const DEMON_SOUL_BUFF_ALLOWLIST = [
393054, 393055, 393834,
];

export const SIGIL_OF_FLAME_SPELLS: Spell[] = [
SPELLS.SIGIL_OF_FLAME,
SPELLS.SIGIL_OF_FLAME_PRECISE,
];
const SIGIL_OF_FLAME_SPELLS: Spell[] = [SPELLS.SIGIL_OF_FLAME, SPELLS.SIGIL_OF_FLAME_PRECISE];
export const SIGIL_OF_FLAME_SPELL_IDS = SIGIL_OF_FLAME_SPELLS.map((spell) => spell.id);

export const SIGIL_OF_MISERY_SPELLS: Spell[] = [
const SIGIL_OF_MISERY_SPELLS: Spell[] = [
TALENTS_DEMON_HUNTER.SIGIL_OF_MISERY_TALENT,
SPELLS.SIGIL_OF_MISERY_PRECISE,
];
export const SIGIL_OF_MISERY_SPELL_IDS = SIGIL_OF_MISERY_SPELLS.map((spell) => spell.id);

export const ELYSIAN_DECREE_SPELLS: Spell[] = [
const ELYSIAN_DECREE_SPELLS: Spell[] = [
TALENTS_DEMON_HUNTER.ELYSIAN_DECREE_TALENT,
SPELLS.ELYSIAN_DECREE_PRECISE,
];
export const ELYSIAN_DECREE_SPELL_IDS = ELYSIAN_DECREE_SPELLS.map((spell) => spell.id);

export const SIGIL_OF_SILENCE_SPELLS: Spell[] = [
const SIGIL_OF_SILENCE_SPELLS: Spell[] = [
TALENTS_DEMON_HUNTER.SIGIL_OF_SILENCE_TALENT,
SPELLS.SIGIL_OF_SILENCE_PRECISE,
];
export const SIGIL_OF_SILENCE_SPELL_IDS = SIGIL_OF_SILENCE_SPELLS.map((spell) => spell.id);

export const SIGIL_OF_CHAINS_SPELLS: Spell[] = [
const SIGIL_OF_CHAINS_SPELLS: Spell[] = [
TALENTS_DEMON_HUNTER.SIGIL_OF_CHAINS_TALENT,
SPELLS.SIGIL_OF_CHAINS_PRECISE,
];
export const SIGIL_OF_CHAINS_SPELL_IDS = SIGIL_OF_CHAINS_SPELLS.map((spell) => spell.id);

export const SIGIL_SPELLS: Spell[] = [
...SIGIL_OF_FLAME_SPELLS,
...SIGIL_OF_MISERY_SPELLS,
...ELYSIAN_DECREE_SPELLS,
...SIGIL_OF_SILENCE_SPELLS,
...SIGIL_OF_CHAINS_SPELLS,
];
export const SIGIL_SPELL_IDS = SIGIL_SPELLS.map((spell) => spell.id);
4 changes: 2 additions & 2 deletions src/analysis/retail/demonhunter/vengeance/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { TALENTS_DEMON_HUNTER } from 'common/TALENTS/demonhunter';
import SPELLS from 'common/SPELLS/demonhunter';
import { ResourceLink, SpellLink } from 'interface';
import PreparationSection from 'interface/guide/components/Preparation/PreparationSection';
import HideExplanationsToggle from 'interface/guide/components/HideExplanationsToggle';
import { HideExplanationsToggle } from 'interface/guide/components/HideExplanationsToggle';
import FuryCapWaste from 'analysis/retail/demonhunter/shared/guide/FuryCapWaste';
import CooldownUsage from 'parser/core/MajorCooldowns/CooldownUsage';
import RESOURCE_TYPES from 'game/RESOURCE_TYPES';
import HideGoodCastsToggle from 'interface/guide/components/HideGoodCastsToggle';
import { HideGoodCastsToggle } from 'interface/guide/components/HideGoodCastsToggle';
import CooldownGraphSubsection, {
Cooldown,
} from 'interface/guide/components/CooldownGraphSubSection';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TooltipElement } from 'interface';
import SpellLink from 'interface/SpellLink';
import TALENTS from 'common/TALENTS/demonhunter';
import SPELLS from 'common/SPELLS/demonhunter';
import HideExplanationsToggle from 'interface/guide/components/HideExplanationsToggle';
import { HideExplanationsToggle } from 'interface/guide/components/HideExplanationsToggle';
import { Highlight } from 'interface/Highlight';
import Timeline from 'interface/guide/components/MajorDefensives/Timeline';
import AllCooldownUsagesList from 'interface/guide/components/MajorDefensives/AllCooldownUsagesList';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SPELLS from 'common/SPELLS/demonhunter';
import { TALENTS_DEMON_HUNTER } from 'common/TALENTS/demonhunter';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import Events, { CastEvent, ChangeBuffStackEvent, Event, EventType } from 'parser/core/Events';
import Events, { CastEvent, ChangeBuffStackEvent, EventType } from 'parser/core/Events';
import EventEmitter from 'parser/core/modules/EventEmitter';
import BoringSpellValueText from 'parser/ui/BoringSpellValueText';
import Statistic from 'parser/ui/Statistic';
Expand All @@ -11,11 +11,6 @@ import SoulFragmentsTracker, { MAX_SOUL_FRAGMENTS } from '../features/SoulFragme

const REMOVE_STACK_BUFFER = 100;

export interface ConsumeSoulFragmentsEvent extends Event<EventType.ConsumeSoulFragments> {
spellId: number;
numberofSoulFragmentsConsumed: number;
}

class SoulFragmentsConsume extends Analyzer {
static dependencies = {
soulFragmentsTracker: SoulFragmentsTracker,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { shouldIgnore } from 'parser/shared/modules/hit-tracking/utilities';
import { TALENTS_DEMON_HUNTER } from 'common/TALENTS/demonhunter';
import HitBasedAnalyzer from 'analysis/retail/demonhunter/vengeance/guide/HitBasedAnalyzer';

export type TrackedHit = {
type TrackedHit = {
mitigated: boolean;
event: DamageEvent;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { shouldIgnore } from 'parser/shared/modules/hit-tracking/utilities';
import { TALENTS_DEMON_HUNTER } from 'common/TALENTS/demonhunter';
import HitBasedAnalyzer from 'analysis/retail/demonhunter/vengeance/guide/HitBasedAnalyzer';

export type TrackedHit = {
type TrackedHit = {
mitigated: boolean;
event: DamageEvent;
};
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/retail/druid/feral/modules/core/Snapshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export type SnapshotSpec = {
};

/** Data object recording a period of time that a DoT was active, and which snapshots it benfitted from */
export type DotUptime = {
type DotUptime = {
/** Timestamp when this debuff was applied or refreshed */
start: number;
/** Timestamp when we expect the debuff to expire */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
import SPELLS from 'common/SPELLS';
import { Options } from 'parser/core/Module';
import Events, { DamageEvent } from 'parser/core/Events';
import { SELECTED_PLAYER } from 'parser/core/EventFilter';
import { TALENTS_DRUID } from 'common/TALENTS';
import { ReactNode } from 'react';
import MajorDefensiveStatistic from 'interface/MajorDefensiveStatistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import { SpellLink } from 'interface';
import { SELECTED_PLAYER } from 'parser/core/Analyzer';

const BASE_MITIGATION = 0.2;
const REINFORCED_FUR_ADDITIONAL_MITIGATION = 0.1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { TALENTS_DRUID } from 'common/TALENTS';
import { Options } from 'parser/core/Module';
import SPELLS from 'common/SPELLS';
import Events, { DamageEvent } from 'parser/core/Events';
import { SELECTED_PLAYER } from 'parser/core/EventFilter';
import { ReactNode } from 'react';
import MajorDefensiveStatistic from 'interface/MajorDefensiveStatistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import { SpellLink } from 'interface';
import { SELECTED_PLAYER } from 'parser/core/Analyzer';

const MITIGATION = 0.35;

Expand Down
Loading

0 comments on commit b67a4cb

Please sign in to comment.