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

chore: Fix lints in examples [DT-7060] #54

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

lanesawyer
Copy link
Collaborator

What

  • Fixes linting issues in the examples folder

How

  • pnpm lint
  • See the errors
  • Fix them!

PR Checklist

  • Is your PR title following our conventional commit naming recommendations?
  • Have you filled in the PR Description Template?
  • Is your branch up to date with the latest in main?
  • Do the CI checks pass successfully?
  • Have you smoke tested the example applications?
  • Did you check that the changes meet accessibility standards?
  • Have you tested the application on these browsers?
    • Chrome (Fully supported)
    • Firefox (Major bug fixes supported)
    • Safari (Major bug fixes supported)

@lanesawyer lanesawyer requested a review from a team as a code owner February 10, 2025 22:17
@lanesawyer
Copy link
Collaborator Author

Lint job is expected to fail, but you can look at it and see that the number of errors is lower now with this PR!

Copy link
Contributor

@Jarbuckle Jarbuckle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a few things I'm wondering about!

@@ -274,7 +274,6 @@ export function getVisibleTiles(
): { layer: number; view: box2D; tiles: VoxelTile[] } {
// const { axes, datasets } = dataset.multiscales[0];
// const zIndex = indexOfDimension(axes, sliceDimension[plane]);
const sliceSize = sizeInUnits(uvTable[plane], dataset.multiscales[0].axes, dataset.multiscales[0].datasets[0])!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this line removed by Biome, or was this a change made for other reasons?

Copy link
Collaborator Author

@lanesawyer lanesawyer Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it as I was looking through issues because it was marked as completely unused. I could comment it out like the ones above though 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if it's completely unused, I see no problem removing it!

console.warn('no size for plane', plane, axes, best);
continue;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this wasn't added by Biome; what does this relate to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replied to a related item elsewhere, it's to make TypeScript happy because of the ! assertion.

@@ -1,7 +1,7 @@
import type { DziImage, DziRenderSettings } from '@alleninstitute/vis-dzi';
import { Box2D, type box2D, type vec2 } from '@alleninstitute/vis-geometry';
import { useEffect, useMemo, useRef, useState } from 'react';
import React from 'react';
import type React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize React was a type 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, I missed this one. It auto-fixed it to this. We were importing it because we didn't have Vite set up correctly to just have React be available. Will remove!

if (!s) {
console.warn('no size for plane', data.plane, data.dataset.multiscales[0].axes);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this isn't Biome-related?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is, previously the s was asserted to exist with s!, and Biome throws linting errors since we're overriding TypeScript. So I added a guard with a log and quit early. This is in the examples, so that seemed fine enough.

We'll want to be more cautious about fixing the type assertions in the actual packages with the next PR though.

<Button
name="layer"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these added by Biome? They seem like functional changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these to resolve Biome lint errors that the labels weren't attached to anything!

@lanesawyer lanesawyer merged commit 17022a0 into main Feb 11, 2025
5 of 6 checks passed
@lanesawyer lanesawyer deleted the lane/biome-example-lint-fixes branch February 11, 2025 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants