Skip to content
Draft
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
647 changes: 219 additions & 428 deletions client/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
"@types/react-dom": "^18.0.0",
"@types/react-syntax-highlighter": "^13.5.2",
"@types/react-table": "^7.7.5",
"@typescript-eslint/eslint-plugin": "^8.57.2",
"@typescript-eslint/parser": "^8.57.2",
"@typescript-eslint/eslint-plugin": "^8.64.0",
"@typescript-eslint/parser": "^8.64.0",
"@vitejs/plugin-react": "^5.1.4",
"autoprefixer": "^10.4.7",
"eslint": "^9.39.4",
Expand All @@ -106,7 +106,7 @@
"source-map-explorer": "^2.5.3",
"storybook": "^9.1.20",
"tailwindcss": "^3.4.19",
"typescript": "^5.3.2",
"typescript": "^6.0.3",
"vite": "^7.3.5",
"vite-plugin-commonjs": "^0.10.4",
"vite-plugin-svgr": "^4.5.0",
Expand Down
9 changes: 8 additions & 1 deletion client/src/utils/collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export function filterNullOrUndefined<T>(
return array.filter((it) => it !== null && it !== undefined) as T[];
}

// `Array.isArray` is typed as `arg is any[]`, which can't narrow a
// `readonly T[]` out of the union — readonly arrays aren't assignable to
// `any[]`, so they survive into the else branch and widen the return type.
function isReadonlyArray<T>(value: readonly T[] | T): value is readonly T[] {
return Array.isArray(value);
}

export function arrayFromArrayOrSingleItem<T>(array: readonly T[] | T): T[] {
return Array.isArray(array) ? [...array] : [array];
return isReadonlyArray(array) ? [...array] : [array];
}
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,12 @@ export default function ItemInvestigation(props: {
try {
return getFieldValueForRole(
{
// eslint-disable-next-line custom-rules/no-casting-in-getFieldValueForRole
// The cast is load-bearing under TS 6: `getFieldValueForRole` is
// generic, and without it the `ThreadItemType` member of `item.type`
// has no overlap with the inferred parameter type. `no-unnecessary-
// type-assertion` disagrees because it compares against the
// already-inferred contextual type; tsc fails if the cast is removed.
// eslint-disable-next-line custom-rules/no-casting-in-getFieldValueForRole, @typescript-eslint/no-unnecessary-type-assertion
type: item.type as Parameters<
typeof getFieldValueForRole
>[0]['type'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function ItemTypePreview<T extends ItemTypeKind>(props: {
case 'CONTENT':
return <ContentTypePreview roles={roles as ItemTypeRoles<'CONTENT'>} />;
case 'THREAD':
return <ThreadTypePreview roles={roles as ItemTypeRoles<'THREAD'>} />;
return <ThreadTypePreview roles={roles} />;
case 'USER':
return <UserTypePreview roles={roles as ItemTypeRoles<'USER'>} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ export default function NCMECReviewUser(
}

const {
moderatorSafetyBlurLevel = 2 as BlurStrength,
moderatorSafetyBlurLevel = 2,
moderatorSafetyGrayscale = true,
moderatorSafetyMuteVideo = true,
moderatorSafetySepia = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ export default function RuleForm() {
const out: Record<string, Record<string, unknown>> = {};
for (const action of rule?.actions ?? []) {
if ('configuredParameters' in action && action.configuredParameters) {
out[action.id] = action.configuredParameters as Record<string, unknown>;
out[action.id] = action.configuredParameters;
}
}
return out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
GQLSignalPricingStructureType,
GQLSignalType,
} from '../../../../graphql/generated';
import { RuleFormConditionSet, RuleFormLeafCondition } from '../types';
import { RuleFormLeafCondition } from '../types';
import { initialState, RuleFormState } from './RuleForm';
import { RuleFormReducerActionType, updateInput } from './RuleFormReducers';
import {
Expand Down Expand Up @@ -86,7 +86,7 @@ describe('updateInput signal eligibility', () => {
conditions: [
{ input: oldInput, signal: custom1, eligibleSignals: [custom1] },
],
} as RuleFormConditionSet,
},
};

const result = updateInput(state, {
Expand Down Expand Up @@ -117,7 +117,7 @@ describe('updateInput signal eligibility', () => {
conditions: [
{ input: oldInput, signal: custom2, eligibleSignals: [custom2] },
],
} as RuleFormConditionSet,
},
};

const result = updateInput(state, {
Expand Down
3 changes: 1 addition & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
"allowJs": true,
"allowSyntheticDefaultImports": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"downlevelIteration": true,
"paths": {
"@/*": ["./src/*"]
}
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"prettier": "^3.8.3",
"@parcel/watcher": "^2.5.6",
"ts-node": "^10.9.2",
"typescript": "^5.9.0"
"typescript": "^6.0.3"
}
}
Loading
Loading