Skip to content

Commit

Permalink
chore: updated and ran prettier (#3409)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaten committed Dec 20, 2024
1 parent c45e529 commit 7553a6c
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 69 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ build

# dependencies
node_modules

# other (avoids breaking a link)
app/components/common/MDXContent/hca-dcp/downloadBatchCorrectionWarning.mdx
4 changes: 3 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{}
{
"trailingComma": "es5"
}
12 changes: 6 additions & 6 deletions app/apis/azul/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function isNullOrUndefined(value: any): boolean {
*/
export function processAggregatedOrArrayValue<
T,
K extends KeyOfTypeStringOrNullArray<T>
K extends KeyOfTypeStringOrNullArray<T>,
>(responseValues: T[], key: K): string[] {
// Aggregate key values across response values.
const values = aggregateResponseValues(
Expand All @@ -91,7 +91,7 @@ export function processAggregatedOrArrayValue<
*/
export function processAggregatedBooleanOrArrayValue<
T,
K extends KeyOfTypeBooleanOrNullArray<T>
K extends KeyOfTypeBooleanOrNullArray<T>,
>(responseValues: T[], key: K): string[] {
// Aggregate key values across response values.
const values = aggregateResponseValues(
Expand All @@ -114,7 +114,7 @@ export function processAggregatedBooleanOrArrayValue<
*/
export function processAggregatedNumberEntityValue<
T,
K extends KeyOfTypeNumberOrNull<T>
K extends KeyOfTypeNumberOrNull<T>,
>(responseValues: T[], key: K): number {
// Aggregate key values across response values.
return aggregateNumericalResponseValues(responseValues, key);
Expand All @@ -129,7 +129,7 @@ export function processAggregatedNumberEntityValue<
*/
export function processEntityArrayValue<
T,
K extends KeyOfTypeStringOrNullArray<T>
K extends KeyOfTypeStringOrNullArray<T>,
>(responseValues: T[], key: K, label = LABEL.UNSPECIFIED): string[] {
// Response values should be a singleton array; check for at least one value here.
if (responseValues.length === 0) {
Expand Down Expand Up @@ -202,7 +202,7 @@ export function processNumberEntityValue<T, K extends KeyOfTypeNumberOrNull<T>>(
*/
function aggregateNumericalResponseValues<
T,
K extends KeyOfTypeNumberOrNull<T>
K extends KeyOfTypeNumberOrNull<T>,
>(responseValues: T[], key: K): number {
return responseValues
.map((responseValue) => responseValue[key] as unknown as number)
Expand All @@ -217,7 +217,7 @@ function aggregateNumericalResponseValues<
*/
function aggregateResponseValues<
T,
K extends KeyOfTypeStringOrNullArray<T> | KeyOfTypeBooleanOrNullArray<T>
K extends KeyOfTypeStringOrNullArray<T> | KeyOfTypeBooleanOrNullArray<T>,
>(responseValues: T[], key: K): StringOrNullArray | BooleanOrNullArray {
return responseValues
.filter((responseValue) => !!responseValue[key])
Expand Down
2 changes: 1 addition & 1 deletion app/apis/catalog/anvil-catalog/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getConsortiumTitle = (
};

export const anvilCatalogStudyInputMapper = <
StudyType extends AnVILCatalogStudyAny
StudyType extends AnVILCatalogStudyAny,
>(
input: StudyType
): StudyType => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface ArchivePreviewTableProps {
*/
function getArchivePreviewTableColumns<
T extends RowData,
TData = unknown
TData = unknown,
>(): ColumnDef<T, TData>[] {
return [
{
Expand Down
23 changes: 13 additions & 10 deletions app/viewModelBuilders/azul/hca-dcp/common/viewModelBuilders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ export function getGeneratedMatricesActionsColumnDef<T>(): ColumnDef<T> {
* @returns anatomical entity column def.
*/
export function getGeneratedMatricesAnatomicalEntityColumnDef<
T
T,
>(): ColumnDef<T> {
return {
accessorKey: HCA_DCP_CATEGORY_KEY.ORGAN,
Expand All @@ -1986,7 +1986,7 @@ export function getGeneratedMatricesAnatomicalEntityColumnDef<
* @returns content description column def.
*/
export function getGeneratedMatricesContentDescriptionColumnDef<
T
T,
>(): ColumnDef<T> {
return {
accessorKey: HCA_DCP_CATEGORY_KEY.CONTENT_DESCRIPTION,
Expand Down Expand Up @@ -2059,7 +2059,7 @@ export function getGeneratedMatricesGenusSpeciesColumnDef<T>(): ColumnDef<T> {
* @returns library construction method column def.
*/
export function getGeneratedMatricesLibraryConstructionMethodColumnDef<
T
T,
>(): ColumnDef<T> {
return {
accessorKey: HCA_DCP_CATEGORY_KEY.LIBRARY_CONSTRUCTION_METHOD,
Expand All @@ -2080,7 +2080,7 @@ export function getGeneratedMatricesLibraryConstructionMethodColumnDef<
* @returns matrix cell count column def.
*/
export function getGeneratedMatricesMatrixCellCountColumnDef<
T
T,
>(): ColumnDef<T> {
return {
accessorKey: HCA_DCP_CATEGORY_KEY.MATRIX_CELL_COUNT,
Expand Down Expand Up @@ -2424,12 +2424,15 @@ export const renderWhenUnAuthenticated = (
* @returns total cells from cellSuspensions.
*/
function rollUpTotalCells(entityResponse: EntityResponse): number | null {
return entityResponse.cellSuspensions.reduce((acc, { totalCells }) => {
if (totalCells) {
acc = (acc ?? 0) + totalCells;
}
return acc;
}, null as null | number);
return entityResponse.cellSuspensions.reduce(
(acc, { totalCells }) => {
if (totalCells) {
acc = (acc ?? 0) + totalCells;
}
return acc;
},
null as null | number
);
}

/**
Expand Down
5 changes: 2 additions & 3 deletions files/ncpi-catalog/build-ncpi-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ async function buildCatalog(): Promise<void> {
SOURCE_FIELD_TYPE
)) as PlatformStudy[];

const ncpiPlatformStudies = await buildNCPIPlatformStudies(
platformStudyStubs
);
const ncpiPlatformStudies =
await buildNCPIPlatformStudies(platformStudyStubs);

const ncpiCatalogPlatforms = buildNCPICatalogPlatforms(ncpiPlatformStudies);

Expand Down
90 changes: 48 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@
"babel-loader": "^8.2.5",
"eslint": "^8.33.0",
"eslint-config-next": "^15.1.2",
"eslint-config-prettier": "^8.6.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsdoc": "^50.6.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-sonarjs": "^3.0.1",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
Expand All @@ -97,8 +97,8 @@
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"next-mdx-remote": "^4.2.0",
"prettier": "^2.8.3",
"prettier-plugin-organize-imports": "^3.2.2",
"prettier": "^3.4.2",
"prettier-plugin-organize-imports": "^4.1.0",
"typescript": "^5.7.2",
"url-loader": "^4.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion site-config/anvil-catalog/dev/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ function buildMenuItems(
...menuItem,
menuItems: buildMenuItems(menuItems, parameter, true),
url: replaceParameters(url, parameter),
visible: isSubMenu ? visible ?? VISIBLE.MD_DOWN : visible,
visible: isSubMenu ? (visible ?? VISIBLE.MD_DOWN) : visible,
}));
}

0 comments on commit 7553a6c

Please sign in to comment.