Skip to content

Commit 35e7f88

Browse files
authored
chore!: migrate to prettier 3 and updated plugins (#754) (#755)
* chore!: update tanstack packages to latest (#752) * chore!: update isomorphic-dompurify to latest (#752) * chore!: update mui/material to latest (#752) * chore!: update copy-to-clipboard, react-dropzone, react-window, yup (#752) * chore!: update @commitlint/cli, @commitlint/config-conventional (#752) * chore!: updated @emotion/react, @emotion/styled, @emotion/jest to latest (#752) * chore: update @testing-library/react to latest (#742) * chore: update storybook (#752) * chore: update @typescript-eslint/eslint-plugin to latest (#752) * chore: update eslint and eslint-config-prettier (#752) * chore: update eslint-related packages (#752) * chore: minor bump prettier (#752) * chore!: update package-lock (#752) * chore: udpate package-lock (#752) * chore: migrate to prettier 3 and updated plugins (#754) --------- Co-authored-by: Fran McDade <18710366+frano-m@users.noreply.github.com>
1 parent a5229b7 commit 35e7f88

File tree

365 files changed

+1137
-1061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

365 files changed

+1137
-1061
lines changed

docs/TRUSTED_PUBLISHING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ To enable trusted publishing for this package on npm, you need to:
5050

5151
1. **Log in to npm** and navigate to the package settings for `@databiosphere/findable-ui`
5252
2. **Add a GitHub Actions Publishing Workflow**:
53-
5453
- Go to the package's publishing settings
5554
- Click "Add GitHub Actions Publishing Workflow"
5655
- Configure the trusted publisher with:

package-lock.json

Lines changed: 107 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"eslint-config-prettier": "^10.1.8",
4242
"eslint-plugin-eslint-comments": "^3.2.0",
4343
"eslint-plugin-jsdoc": "^61.5.0",
44-
"eslint-plugin-prettier": "^4.2.5",
44+
"eslint-plugin-prettier": "^5.5.4",
4545
"eslint-plugin-react-hooks": "^4.6.0",
4646
"eslint-plugin-sonarjs": "^0.25.1",
4747
"eslint-plugin-sort-destructure-keys": "^2.0.0",
@@ -51,8 +51,8 @@
5151
"jest": "^29.4.1",
5252
"jest-environment-jsdom": "^29.4.1",
5353
"jest-fetch-mock": "^3.0.3",
54-
"prettier": "^2.8.8",
55-
"prettier-plugin-organize-imports": "^3.2.4",
54+
"prettier": "^3.7.4",
55+
"prettier-plugin-organize-imports": "^4.3.0",
5656
"storybook": "^10.1.10",
5757
"ts-jest": "^29.2.5",
5858
"typescript": "^5.5.4"

src/apis/azul/common/filterTransformer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function transformFilters(filters: Filters): string {
5252
}
5353

5454
export function transformAzulPagination(
55-
azulPagination: AzulPaginationResponse | undefined
55+
azulPagination: AzulPaginationResponse | undefined,
5656
): PaginationResponse {
5757
if (!azulPagination) {
5858
return {
@@ -74,7 +74,7 @@ export function transformAzulPagination(
7474

7575
function extractIndex(
7676
type: AzulSearchIndex,
77-
urlString: string | undefined
77+
urlString: string | undefined,
7878
): PaginationIndex | null {
7979
if (!urlString) {
8080
return null;
@@ -95,7 +95,7 @@ function extractIndex(
9595
*/
9696
export function transformTermFacets(
9797
termFacets: AzulTermFacets,
98-
filterState: SelectedFilter[]
98+
filterState: SelectedFilter[],
9999
): SelectCategory[] {
100100
const categories: SelectCategory[] = [];
101101

@@ -104,7 +104,7 @@ export function transformTermFacets(
104104
const termFacet = termFacets[key];
105105
// Build a set of filter state category values for the category.
106106
const setOfFilterStateValues = new Set(
107-
filterState.find(({ categoryKey }) => categoryKey === key)?.value
107+
filterState.find(({ categoryKey }) => categoryKey === key)?.value,
108108
);
109109

110110
// Build category values from terms of term facet.
@@ -121,7 +121,7 @@ export function transformTermFacets(
121121
label: term.term ?? LABEL.UNSPECIFIED,
122122
selected: false, // Selected state updated in filter hook.
123123
};
124-
}
124+
},
125125
);
126126

127127
// Add remaining filter state category values to the category values. This allows us to maintain the selected

src/common/analytics/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function isTrackingEnabled(): boolean {
3232
*/
3333
export function track(
3434
eventName: EVENT_NAME,
35-
params: EventParams[typeof eventName]
35+
params: EventParams[typeof eventName],
3636
): void {
3737
if (!isTrackingEnabled()) {
3838
return;

src/common/categories/config/range/typeGuards.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CategoryConfig } from "../types";
88
* @returns True if the category config is a range category, false otherwise.
99
*/
1010
export function isRangeCategoryConfig(
11-
categoryConfig: CategoryConfig
11+
categoryConfig: CategoryConfig,
1212
): categoryConfig is RangeCategoryView {
1313
return categoryConfig.viewKind === VIEW_KIND.RANGE;
1414
}

src/common/categories/config/types.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@ export interface CommonCategoryConfig {
2424
* Range category config.
2525
*/
2626
export interface RangeCategoryConfig
27-
extends CommonCategoryConfig,
28-
RangeViewKind {
27+
extends CommonCategoryConfig, RangeViewKind {
2928
unit?: string; // e.g. "kg"
3029
}
3130

3231
/**
3332
* Select category config.
3433
*/
3534
export interface SelectCategoryConfig
36-
extends CommonCategoryConfig,
37-
SelectViewKind {
35+
extends CommonCategoryConfig, SelectViewKind {
3836
enableChartView?: boolean;
3937
mapSelectCategoryValue?: (
40-
selectCategoryValue: SelectCategoryValueView
38+
selectCategoryValue: SelectCategoryValueView,
4139
) => SelectCategoryValueView;
4240
}

src/common/categories/config/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import { CategoryConfig } from "./types";
1212
export function findCategoryConfig<V extends VIEW_KIND>(
1313
viewKind: V,
1414
key: Category["key"],
15-
configs: CategoryConfig[]
15+
configs: CategoryConfig[],
1616
): Extract<CategoryConfig, { viewKind?: V }> | undefined {
1717
return configs.find(
1818
(c): c is Extract<CategoryConfig, { viewKind?: V }> =>
1919
// When `viewKind` is undefined, it corresponds to a `SelectCategoryConfig`.
2020
// This predicate ensures that `viewKind` is either explicitly matched or treated as undefined
2121
// for compatibility with `SelectCategoryConfig` and other explicitly defined view kinds.
22-
(c.viewKind === undefined || c.viewKind === viewKind) && c.key === key
22+
(c.viewKind === undefined || c.viewKind === viewKind) && c.key === key,
2323
);
2424
}
2525

@@ -31,7 +31,7 @@ export function findCategoryConfig<V extends VIEW_KIND>(
3131
*/
3232
export function findRangeCategoryConfig(
3333
key: Category["key"],
34-
configs: CategoryConfig[]
34+
configs: CategoryConfig[],
3535
): Extract<CategoryConfig, { viewKind: VIEW_KIND.RANGE }> | undefined {
3636
return findCategoryConfig(VIEW_KIND.RANGE, key, configs);
3737
}
@@ -44,7 +44,7 @@ export function findRangeCategoryConfig(
4444
*/
4545
export function findSelectCategoryConfig(
4646
key: Category["key"],
47-
configs: CategoryConfig[]
47+
configs: CategoryConfig[],
4848
): Extract<CategoryConfig, { viewKind?: VIEW_KIND.SELECT }> | undefined {
4949
return findCategoryConfig(VIEW_KIND.SELECT, key, configs);
5050
}

src/common/categories/models/range/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function assertIsRange(value: unknown): asserts value is SelectedRange {
2222
export function buildNextRangeFilterState(
2323
nextCategorySelectedFilter: SelectedFilter,
2424
selectedValue: CategoryValueKey,
25-
selected: boolean
25+
selected: boolean,
2626
): void {
2727
if (selected) {
2828
// Assert that the selected value is a range.
@@ -43,7 +43,7 @@ export function buildNextRangeFilterState(
4343
* @returns The selected filter (i.e. the set of selected values) for the given category.
4444
*/
4545
export function getRangeSelectedValue(
46-
categorySelectedFilter?: SelectedFilter
46+
categorySelectedFilter?: SelectedFilter,
4747
): SelectedRange {
4848
return isSelectedRange(categorySelectedFilter?.value)
4949
? categorySelectedFilter?.value

src/common/categories/models/select/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { CategoryValueKey, SelectedFilter } from "../../../entities";
99
export function buildNextSelectFilterState(
1010
nextCategorySelectedFilter: SelectedFilter,
1111
selectedValue: CategoryValueKey,
12-
selected: boolean
12+
selected: boolean,
1313
): void {
1414
if (selected) {
1515
// Set the selected value.
1616
nextCategorySelectedFilter.value.push(selectedValue);
1717
} else {
1818
// Remove the selected value from the selected set of values.
1919
nextCategorySelectedFilter.value = nextCategorySelectedFilter.value.filter(
20-
(value: CategoryValueKey) => value !== selectedValue
20+
(value: CategoryValueKey) => value !== selectedValue,
2121
);
2222
}
2323
}

0 commit comments

Comments
 (0)