Skip to content

Conversation

@interim17
Copy link
Contributor

@interim17 interim17 commented Aug 2, 2025

Problem

So this is... big, but apparently our repo is a little messy. T_T

Even with some overrides and some rules silenced, getting eslint and typecheck happy required many, many changes.

At the end of the day we will get:

  • husky will run lint and typecheck before you can commit
  • CI/CD will run lint and typecheck on your PR
  • everything current to this PR will pass those checks

I think it's worth doing and will make our work going forward more sound.

I am going to extensively comment on this PR to try and explain why things are changing if it isn't obvious.

There are a few open questions or things I'm unsure about:

  • 404.js is legacy, but maybe used by gatsby internally. Should we either remove it or write it custom, seems like the text is from the template
  • Navbar is not currently used anywhere that I can tell. Remove? Context?
  • I added an override for a lot of rules for the Preview code. It was just too much to handle because it's typed very generally/loosely and I'm less familiar with it.
  • I updated the mobile view to map over data structures (taggedGene, protein, etc) that are lists, but it was treating as single items. I haven't confirmed yet how they look, may need styling
  • I added a module declaration for css modules so we can move towards importing them like:
    import styles from instead of using require and destructuring the classnames, do we want to go that direction?

A lot of changes are obvious, removing unused stuff and throwing types on things.

  • New feature (non-breaking change which adds functionality)

@netlify
Copy link

netlify bot commented Aug 2, 2025

Deploy Preview for cell-catalog failed. Why did it fail? →

Name Link
🔨 Latest commit 3473f2a
🔍 Latest deploy log https://app.netlify.com/projects/cell-catalog/deploys/68910cf7852125000832e691

// },
plugins: [
"gatsby-plugin-react-helmet",
"gatsby-plugin-react-helmet-async",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like for SSR the async version of react-helmet is preferred, and is also more maintained. I have yet to confirm what it does, and what this has changed. I just made the linter happy.

The Helmet is an example of something where I am unclear if we are intentionally implementing it or it is a legacy from the template used to start the repo.

const useDisableWheel = () => {
useEffect(() => {
document.addEventListener("wheel", function (event) {
document.addEventListener("wheel", function () {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unused

Comment on lines +5 to +15
const DiseaseCatalogPreview = ({ entry, widgetFor }: TemplateProps) => {
const props = {
title: entry.getIn(["data", "title"]),
content: widgetFor("body"),
footerText: entry.getIn(["data", "footer_text"]),
};

return <DiseaseCatalogTemplate {...(props as any)} />;
};

export default DiseaseCatalogPreview;
export default DiseaseCatalogPreview;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a punt, along with the override rules in the eslint config, the preview code is too much to deal with right now.

Comment on lines +54 to +57
const width = useWindowWidth();
const isPhone = width < PHONE_BREAKPOINT;

const suppressRowClickRef = useRef(false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needed to pull hooks out of map

Comment on lines +54 to +65
// eslint-disable-next-line @typescript-eslint/no-misused-promises
onClick={async () => {
try {
await navigator.clipboard.writeText(href);
setShareTooltipText("Copied!");
} catch {
setShareTooltipText("Failed to copy");
} finally {
setTimeout(() => {
setShareTooltipText("");
}, 1000);
});
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

navigator.clipboard.writeText(href) is async. I made one linting rule happy by adding this try/catch, but added an ignore to the other one for now.

Comment on lines +77 to +78
): ColumnsType<any> => {
const columns: ColumnsType<any> = [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tweaking the column typing was one of the more involved changes.

I typed the columns prop in CellLineTable and I'm using the antd type ColumnType and ColumnProps to get the same type-safety we got from this before:
export type CellLineColumns<T> = GetProp<typeof Table<T>, "columns">

Probably more than one way to do this, but everything seems to be working...

<html lang="en" />
<title>{title}</title>
<meta name="description" content={description} />
<HelmetProvider>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapping in HelmetProvider seems to be the main difference here. As I said in the write up I'm a little shaky on exactly how this all works, would appreciate feedback.

className={` navbar-start has-text-centered navbar-menu ${
isActive && "is-active"
}`}
className={` navbar-start has-text-centered navbar-menu`}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isActive was never reset, so that classname was never applied. Also is this component going to be used? Doesn't seem to be currently.

setEnv("staging");
}
}, []);
}, [hostname]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linter didn't like missing dependency in hook

Comment on lines +5 to +10
<Layout>
<div>
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
</div>
</Layout>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we want this?

coriellLink: string;
}
// eslint-disable-next-line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a little confusing, we have these eslint comments a few places, but were not running eslint... template legacy? They don't seem necessary with the current config.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have eslint sent to run in my IDE, so that's probably what the origin of these are

structure,
isoforms,
}: GeneNameTemplateProps) => {
}: GeneFrontMatter) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linter doesn't like extending a type but not adding anything.

@interim17
Copy link
Contributor Author

FWIW, I'm not sure this branch should really be merged as-is since its so large and failing a CI/CD check. Maybe more of a conversation piece.

I could start with a more minimal set of linting rules (no unused vars/imports) and go from there.

@interim17 interim17 closed this Aug 13, 2025
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.

3 participants