Skip to content

Commit

Permalink
fix: format correction
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenjaneczek committed Jul 14, 2023
1 parent 41ed006 commit c8a0f97
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
4 changes: 2 additions & 2 deletions packages/pyroscope-models/src/spyName.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod';

export type SpyNameFirstClassType = typeof SpyNameFirstClass[number];
export type SpyNameFirstClassType = (typeof SpyNameFirstClass)[number];

export const SpyNameFirstClass = [
'dotnetspy',
Expand All @@ -23,7 +23,7 @@ export const SpyNameOther = [
export const AllSpyNames = [...SpyNameFirstClass, ...SpyNameOther] as const;

export const SpyNameSchema = z.preprocess((val) => {
if (!val || !AllSpyNames.includes(val as typeof AllSpyNames[number])) {
if (!val || !AllSpyNames.includes(val as (typeof AllSpyNames)[number])) {
return 'unknown';
}
return val;
Expand Down
2 changes: 1 addition & 1 deletion packages/pyroscope-models/src/units.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export const UnitsSchema = z.preprocess((u) => {
return 'unknown';
}, z.enum(['samples', 'objects', 'goroutines', 'bytes', 'lock_samples', 'lock_nanoseconds', 'trace_samples', 'exceptions', 'unknown']));

export type UnitsType = typeof units[number];
export type UnitsType = (typeof units)[number];
export type Units = z.infer<typeof UnitsSchema>;
2 changes: 1 addition & 1 deletion webapp/javascript/components/DateRangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function DateRangePicker() {
}
};

const isPresetSelected = (preset: typeof defaultPresets[0][0]) => {
const isPresetSelected = (preset: (typeof defaultPresets)[0][0]) => {
return preset.label === dateToLabel(from, until, offset);
};

Expand Down
2 changes: 1 addition & 1 deletion webapp/javascript/components/TagsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function LabelsSubmenu({
// TODO: type this properly
const [filter, setFilter] = useState<Record<string, string>>({});

const GetTagValues = (labelName: string, t: typeof tags[1]) => {
const GetTagValues = (labelName: string, t: (typeof tags)[1]) => {
const { type } = t;
switch (type) {
case 'loading': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type PlotWithCrosshairsSupport = jquery.flot.plot &
function init(plot: PlotWithCrosshairsSupport) {
function getOptions() {
return plot.getOptions() as jquery.flot.plotOptions & {
syncCrosshairsWith: typeof defaultOptions['syncCrosshairsWith'];
syncCrosshairsWith: (typeof defaultOptions)['syncCrosshairsWith'];
};
}

Expand All @@ -26,7 +26,7 @@ type PlotWithCrosshairsSupport = jquery.flot.plot &
}

function onPlotHover(
syncCrosshairsWith: typeof defaultOptions['syncCrosshairsWith'],
syncCrosshairsWith: (typeof defaultOptions)['syncCrosshairsWith'],
e: unknown,
position: { x: number; y: number }
) {
Expand All @@ -36,7 +36,7 @@ type PlotWithCrosshairsSupport = jquery.flot.plot &
}

function clearCrosshairs(
syncCrosshairsWith: typeof defaultOptions['syncCrosshairsWith']
syncCrosshairsWith: (typeof defaultOptions)['syncCrosshairsWith']
) {
syncCrosshairsWith.forEach((id) =>
accessExternalInstance(id).clearCrosshair()
Expand Down
31 changes: 16 additions & 15 deletions webapp/javascript/pages/exemplars/ExemplarsSingleView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,22 @@ function ExemplarsSingleView() {
<p className={styles.heatmapTitle}>Heatmap</p>
{heatmap}
</Box>
{!exemplarsSingleView.selectionProfile && exemplarsSingleView.heatmap && (
<Box>
<div className={styles.heatmapSelectionGuide}>
<StatusMessage
type="info"
message="Select an area in the heatmap to get started"
/>
<img
className={styles.gif}
src={heatmapSelectionPreviewGif}
alt="heatmap-selection-gif"
/>
</div>
</Box>
)}
{!exemplarsSingleView.selectionProfile &&
exemplarsSingleView.heatmap && (
<Box>
<div className={styles.heatmapSelectionGuide}>
<StatusMessage
type="info"
message="Select an area in the heatmap to get started"
/>
<img
className={styles.gif}
src={heatmapSelectionPreviewGif}
alt="heatmap-selection-gif"
/>
</div>
</Box>
)}
{exemplarsSingleView.heatmap &&
exemplarsSingleView.selectionProfile &&
differenceProfile ? (
Expand Down

0 comments on commit c8a0f97

Please sign in to comment.