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

Update eslint npm packages #6095

Merged
merged 8 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/hash-ai-worker-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"@types/papaparse": "5.3.15",
"@types/sanitize-html": "2.13.0",
"@vitest/coverage-istanbul": "2.1.8",
"eslint": "9.17.0",
"eslint": "9.19.0",
"rimraf": "6.0.1",
"typescript": "5.7.3",
"vite-tsconfig-paths": "5.1.4",
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"@types/mime-types": "2.1.4",
"@types/nodemailer": "6.4.17",
"@vitest/coverage-istanbul": "2.1.8",
"eslint": "9.17.0",
"eslint": "9.19.0",
"rimraf": "6.0.1",
"typescript": "5.7.3",
"vitest": "2.1.8",
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"@types/react-window": "1.8.8",
"@types/url-regex-safe": "1.0.2",
"@welldone-software/why-did-you-render": "8.0.3",
"eslint": "9.17.0",
"eslint": "9.19.0",
"graphology-types": "0.24.8",
"rimraf": "6.0.1",
"sass": "1.83.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ export const useCreateGetCellContent = (
kind: GridCellKind.Custom,
allowOverlay: true,
readonly: true,
copyData: String(row.permittedDataTypes),
copyData: row.permittedDataTypes
.map((type) => type.schema.title)
.join(", "),
data: {
kind: "chip-cell",
chips: row.permittedDataTypes.map((type) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const TypeButton = ({
title={entityTypeTitle}
version={currentVersion}
newVersionConfig={
readonly && newVersion
!readonly && newVersion
? {
newVersion,
onUpdateVersion: onUpgradeClicked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1047,12 +1047,17 @@ export const EntityResultTable = memo(
*/
const baseUrl = extractBaseUrl(field);

const valueA = a.data.properties[baseUrl];
const valueB = b.data.properties[baseUrl];

if (typeof valueA === "number" && typeof valueB === "number") {
return (valueA - valueB) * direction;
}

return (
(a.data.properties[baseUrl]
?.toString()
.localeCompare(
b.data.properties[baseUrl]?.toString() ?? "",
) ?? 0) * direction
stringifyPropertyValue(valueA).localeCompare(
stringifyPropertyValue(valueB),
) * direction
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,7 @@ export const DraftEntitiesFilters: FunctionComponent<{
web.kind === "user"
? web.accountId === authenticatedUser.accountId
? "My Web"
: web.displayName
? web.displayName
: "Unknown User"
: (web.displayName ?? "Unknown User")
: web.name;

return { label, web };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ export const DraftEntityWeb: FunctionComponent<{ entity: Entity }> = ({
return web.kind === "user"
? web.accountId === authenticatedUser.accountId
? "My Web"
: web.displayName
? web.displayName
: "Unknown User"
: (web.displayName ?? "Unknown User")
: web.name;
}, [web, authenticatedUser]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const ConvertQuickNoteToPageModal: FunctionComponent<
const innerSubmit = handleSubmit(async (data) => {
const { parentPage } = data;

// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- don't want an empty string here
const title = !data.title ? defaultTitle : data.title;

const prevFractionalIndex =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entit
import { zeroedGraphResolveDepths } from "@local/hash-isomorphic-utils/graph-queries";
import { systemEntityTypes } from "@local/hash-isomorphic-utils/ontology-type-ids";
import { simplifyProperties } from "@local/hash-isomorphic-utils/simplify-properties";
import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value";
import type { UserProperties } from "@local/hash-isomorphic-utils/system-types/user";
import {
extractEntityUuidFromEntityId,
Expand Down Expand Up @@ -138,7 +139,7 @@ export const MentionDisplay: FunctionComponent<MentionDisplayProps> = ({

const propertyValue = entity?.properties[propertyTypeBaseUrl];

return propertyValue?.toString();
return stringifyPropertyValue(propertyValue);
}
}, [mention, entityId, entitySubgraph, entity, entityLabel]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {
PropertyTypeWithMetadata,
} from "@local/hash-graph-types/ontology";
import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label";
import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value";
import type { EntityRootType, Subgraph } from "@local/hash-subgraph";
import type { ListItemButtonProps } from "@mui/material";
import {
Expand Down Expand Up @@ -268,7 +269,7 @@ export const MentionSuggesterEntity = forwardRef<
>
{item.kind === "outgoing-link"
? item.targetEntityLabel
: item.propertyValue?.toString()}
: stringifyPropertyValue(item.propertyValue)}
</ListItemSecondaryText>
</ListItemButton>
))}
Expand Down
4 changes: 3 additions & 1 deletion apps/hash-frontend/src/pages/shared/claims-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ export const ClaimsTable = memo(
* We know we are only setting it as a string, so we can throw an error if it is not.
*/
if (typeof claimText === "object") {
throw new Error(`Claim text is not a string: ${claimText}`);
throw new Error(
`Claim text is not a string: ${JSON.stringify(claimText)}`,
);
}

const objectText =
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-frontend/src/pages/shared/format-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const formatValue = (
if (index < value.length - 1) {
valueParts.push({
text: ", ",
color: customColors.gray[50],
color: customColors.gray[60],
type: "rightLabel",
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import type {
EntityTypeWithMetadata,
} from "@local/hash-graph-types/ontology";
import { generateEntityLabel } from "@local/hash-isomorphic-utils/generate-entity-label";
import { stringifyPropertyValue } from "@local/hash-isomorphic-utils/stringify-property-value";
import type { EntityRootType, Subgraph } from "@local/hash-subgraph";
import { extractEntityUuidFromEntityId } from "@local/hash-subgraph";
import {
Expand Down Expand Up @@ -64,7 +65,7 @@ const stringifyEntityPropertyValue = (value: EntityPropertyValue): string => {
} else if (typeof value === "undefined") {
return "Undefined";
} else {
return String(value);
return stringifyPropertyValue(value);
}
};

Expand Down
4 changes: 1 addition & 3 deletions apps/hash-frontend/src/shared/use-user-or-org.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ export const useUserOrOrg = (
...zeroedGraphResolveDepths,
...params.graphResolveDepths,
},
temporalAxes: params.temporalAxes
? params.temporalAxes
: currentTimeInstantTemporalAxes,
temporalAxes: params.temporalAxes ?? currentTimeInstantTemporalAxes,
includeDrafts: false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-integration-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@local/tsconfig": "0.0.0-private",
"@sentry/cli": "^2.39.1",
"@types/dotenv-flow": "3.3.3",
"eslint": "9.17.0",
"eslint": "9.19.0",
"rimraf": "6.0.1",
"typescript": "5.7.3",
"wait-on": "8.0.2"
Expand Down
2 changes: 1 addition & 1 deletion apps/hash-realtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/node": "22.12.0",
"@types/set-interval-async": "1.0.3",
"eslint": "9.17.0",
"eslint": "9.19.0",
"typescript": "5.7.3"
}
}
2 changes: 1 addition & 1 deletion apps/hash-search-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@local/eslint": "0.0.0-private",
"@local/tsconfig": "0.0.0-private",
"@types/node": "22.12.0",
"eslint": "9.17.0",
"eslint": "9.19.0",
"typescript": "5.7.3"
}
}
2 changes: 1 addition & 1 deletion apps/hashdotdev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@types/unist": "3.0.3",
"babel-loader": "9.2.1",
"chalk": "5.4.1",
"eslint": "9.17.0",
"eslint": "9.19.0",
"execa": "7.2.0",
"tsx": "4.19.2",
"typescript": "5.7.3"
Expand Down
8 changes: 4 additions & 4 deletions apps/hashdotdev/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const FRONTEND_URL = process.env.NEXT_PUBLIC_FRONTEND_URL
? process.env.NEXT_PUBLIC_FRONTEND_URL
: process.env.NEXT_PUBLIC_VERCEL_URL
export const FRONTEND_URL =
process.env.NEXT_PUBLIC_FRONTEND_URL ??
(process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: "http://localhost:3000";
: "http://localhost:3000");

export const SITE_DESCRIPTION =
"Open-source resources and tools for" +
Expand Down
2 changes: 1 addition & 1 deletion apps/hashdotdev/src/pages/roadmap.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const UseCases: FunctionComponent = () => (
/** @todo: make clickable when docs pages exist for each item */
// <Link key={name} href={href}>
<Box
key={name?.toString()}
key={id}
sx={{
display: "flex",
flexDirection: "column",
Expand Down
5 changes: 3 additions & 2 deletions apps/hashdotdev/src/pages/roadmap/technology-tree-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ export const TechnologyTreeNode: FunctionComponent<{
{useCaseNames.length > 1
? useCaseNames
.slice(0, -1)
.map((item) => (
<Fragment key={item?.toString()}>{item}, </Fragment>
.map((item, index) => (
// eslint-disable-next-line react/no-array-index-key
<Fragment key={index}>{item}, </Fragment>
))
.concat(
<Fragment key="last">
Expand Down
2 changes: 1 addition & 1 deletion apps/plugin-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"copy-webpack-plugin": "11.0.0",
"css-loader": "6.11.0",
"dotenv-flow": "3.3.0",
"eslint": "9.17.0",
"eslint": "9.19.0",
"file-loader": "6.2.0",
"fs-extra": "11.3.0",
"html-loader": "4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,10 @@ export const RowsByLocation = (props: CommonRowsProps) => {
<RowByLocation
domainOptions={domainOptions}
key={
rule.restrictToDomain
? rule.restrictToDomain
: rule.entityTypeIds.length
? "anywhere-saved-rule"
: "draft-rule-no-domain"
rule.restrictToDomain ??
(rule.entityTypeIds.length
? "anywhere-saved-rule"
: "draft-rule-no-domain")
}
inferenceConfig={inferenceConfig}
setInferenceConfig={setInferenceConfig}
Expand Down
2 changes: 1 addition & 1 deletion blocks/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@types/lodash.debounce": "4.0.9",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/ai-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/ai-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/ai-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/callout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/react-dom": "19.0.3",
"@types/react-is": "19.0.0",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@types/prismjs": "1.26.5",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/countdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/react-datepicker": "4.19.6",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/divider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@types/lodash": "4.17.15",
"@types/react-dom": "19.0.3",
"block-scripts": "0.0.14",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.0.10",
"react": "19.0.0",
"react-dom": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/faq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@local/eslint": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/heading/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@local/tsconfig": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion blocks/how-to/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@local/eslint": "0.0.0-private",
"@types/react-dom": "19.0.3",
"block-scripts": "0.3.4",
"eslint": "9.17.0",
"eslint": "9.19.0",
"mock-block-dock": "0.1.9",
"prettier": "3.4.2",
"react": "19.0.0",
Expand Down
Loading
Loading