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: updated dev dependencies (#4309) #4318

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

jpaten
Copy link
Contributor

@jpaten jpaten commented Dec 20, 2024

Ticket

Closes #4309.

Reviewers

@frano-m .
@hunterckx .

Changes

  • Updated dev dependencies
  • Moved next-mdx-remote from dev to prod dependencies
  • Made linting changes to satisfy new linting rules
  • Reran prettier with new changed, keeping the es5 comma rules that used to be default

@jpaten jpaten linked an issue Dec 20, 2024 that may be closed by this pull request
@github-actions github-actions bot added the canary Done by the Clever Canary team label Dec 20, 2024
@jpaten jpaten changed the title chore: updated typescript (#4309) chore: updated dev dependencies (#4309) Dec 20, 2024
Copy link
Contributor Author

@jpaten jpaten left a comment

Choose a reason for hiding this comment

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

Hi @frano-m! When we updated sonarjs they added some new linting errors that were triggered. I wasn't sure what to do with a couple of them, so I wondered if you'd be able to take a look and let me know if what I did made sense or if another solution would be better. Thank you so much!

__tests__/project-matrix-mapper.test.ts Show resolved Hide resolved
__tests__/project-matrix-mapper.test.ts Show resolved Hide resolved
app/utils/tsvParser.ts Show resolved Hide resolved
"react-hooks/exhaustive-deps": "error",
"sonarjs/todo-tag": "warn",
"sonarjs/redundant-type-aliases": "warn",
"sonarjs/no-nested-conditional": "warn"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this error to a warn since it would involve changing a lot of entries such as in announcements.tsx. @frano-m I'm not sure if we should change all of these to use chained if statements or if it's best just to disable this warn all together?

  return (
    <Fragment>
      {isSessionTimeout ? (
        <Banner onClose={clearSessionTimeout}>
          For your security, you have been logged out due to 15 minutes of
          inactivity.
        </Banner>
      ) : isSystemUnavailable ? (
        <Banner>
          One or more of the system components are currently unavailable.
          Functionality may be degraded.
        </Banner>
      ) : isSystemIndexing ? (
        <Banner>
          Data indexing in progress. Downloads and exports are disabled as
          search results may be incomplete.
        </Banner>
      ) : (
        generalAnnouncement
      )}
    </Fragment>
  );

"react-hooks/exhaustive-deps": "error"
"react-hooks/exhaustive-deps": "error",
"sonarjs/todo-tag": "warn",
"sonarjs/redundant-type-aliases": "warn",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frano-m this is triggered for cases like the below in app/apis/catalog/ncpi-catalog/common/entities.ts. Not sure if it should be disabled, kept as a warn, and/or if we should remove those cases, do you have thoughts?

export type DbGapId = string;

@@ -6,6 +6,7 @@ interface ErrorProps {
error?: Error | null;
}

// eslint-disable-next-line sonarjs/no-globals-shadowing -- TODO not sure of reason for this
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frano-m I'm not super familiar with the purpose of this file - should this stay disabled, and if so would you be able to let me know a reason to specify so I can remove the TODO? Thank you so much for taking a look at these, I know there's a lot!

@@ -201,7 +201,8 @@ export default EntityDetailPage;
* @returns catalog prefix.
*/
function getCatalogPrefix(defaultCatalog: string): string {
return defaultCatalog.replace(/\d.*$/, "");
//eslint-disable-next-line sonarjs/slow-regex -- catalog numbers should be short and are user provided
return defaultCatalog.replace(/\d.*$/, ""); //TODO - are all catalog numbers less than a maximum length? could remove eslint ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@frano-m can we replace the .* here with .{0,5} or something else with a specified length to clear this error? I don't think leaving it disabled is a big deal but it might be neater

.prettierignore Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
canary Done by the Clever Canary team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update dev dependencies
3 participants