Skip to content

Commit 023fe6c

Browse files
committed
fix: resolve lint errors, remove unused file, and clean up code
- Fix no-base-to-string error in OperatorFilter with explicit type checks - Disable react-hooks/rules-of-hooks for e2e tests (Playwright fixture use) - Remove unused chipLabels.ts flagged by knip - Auto-fix Array<T> to T[] syntax and simplify tailwind class - Remove eslint-disable comments made redundant by config override - Add popover level/spacing to DataTableFloatingBar - Remove unused color prop from InterviewsTable export button
1 parent 0dfc76d commit 023fe6c

File tree

8 files changed

+22
-62
lines changed

8 files changed

+22
-62
lines changed

app/dashboard/_components/InterviewsTable/InterviewsTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ export const InterviewsTable = ({
179179
);
180180
setShowExportModal(true);
181181
}}
182-
color="primary"
183182
icon={<FileUp className="size-4" />}
184183
>
185184
Export Selected

components/DataTable/DataTableFloatingBar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export function DataTableFloatingBar<TData>({
2828
{selectedCount > 0 && (
2929
<MotionSurface
3030
key="floating-bar"
31+
level="popover"
32+
spacing="sm"
3133
initial={{ y: 100, opacity: 0 }}
3234
animate={{ y: 0, opacity: 1 }}
3335
exit={{ y: 100, opacity: 0 }}

components/DataTable/filters/OperatorFilter.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ export default function OperatorFilter({
108108
size="sm"
109109
options={entityOptions}
110110
value={selectedEntity}
111-
onChange={(val) => setSelectedEntity(String(val ?? ''))}
111+
onChange={(val) => {
112+
if (typeof val === 'string' || typeof val === 'number') {
113+
setSelectedEntity(String(val));
114+
} else {
115+
setSelectedEntity('');
116+
}
117+
}}
112118
/>
113119
)}
114120
<div className="flex items-center gap-2">

components/DataTable/filters/chipLabels.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@ export default tseslint.config(
243243
},
244244
},
245245

246+
// E2E tests are not React — Playwright fixture `use()` triggers false positives
247+
{
248+
files: ['tests/e2e/**/*.ts'],
249+
rules: {
250+
'react-hooks/rules-of-hooks': 'off',
251+
},
252+
},
253+
246254
// Declaration files require `interface` for ambient type merging
247255
{
248256
files: ['**/*.d.ts'],

styles/shared/controlVariants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const interactiveStateVariants = cva({
206206
readOnly: cx('focus-within:border-input-contrast/70'),
207207
invalid: '',
208208
normal:
209-
'has-[input:focus-visible,textarea:focus-visible]:focus-styles outline-[var(--focus-color,currentColor)]',
209+
'has-[input:focus-visible,textarea:focus-visible]:focus-styles outline-(--focus-color,currentColor)',
210210
},
211211
},
212212
defaultVariants: {

tests/e2e/fixtures/interview-test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,11 @@ export const test = baseTest.extend<
9494
interview: async ({ page, captureInterview }, use) => {
9595
const interview = new InterviewFixture(page);
9696
interview.setCaptureFn(captureInterview);
97-
// eslint-disable-next-line react-hooks/rules-of-hooks
9897
await use(interview);
9998
},
10099

101100
stage: async ({ page }, use) => {
102101
const stage = new StageFixture(page);
103-
// eslint-disable-next-line react-hooks/rules-of-hooks
104102
await use(stage);
105103
},
106104
});

tests/e2e/fixtures/protocol-fixture.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ export class ProtocolFixture {
219219
* Useful for debugging sync issues.
220220
*/
221221
async getNetworkState(interviewId: string): Promise<{
222-
nodes: Array<{ _uid: string; type: string; attributes: Record<string, unknown> }>;
223-
edges: Array<{ _uid: string; type: string; from: string; to: string }>;
222+
nodes: { _uid: string; type: string; attributes: Record<string, unknown> }[];
223+
edges: { _uid: string; type: string; from: string; to: string }[];
224224
ego: { _uid: string; attributes: Record<string, unknown> };
225225
currentStep: number;
226226
}> {
@@ -234,8 +234,8 @@ export class ProtocolFixture {
234234
}
235235

236236
const network = interview.network as {
237-
nodes: Array<{ _uid: string; type: string; attributes: Record<string, unknown> }>;
238-
edges: Array<{ _uid: string; type: string; from: string; to: string }>;
237+
nodes: { _uid: string; type: string; attributes: Record<string, unknown> }[];
238+
edges: { _uid: string; type: string; from: string; to: string }[];
239239
ego: { _uid: string; attributes: Record<string, unknown> };
240240
};
241241

0 commit comments

Comments
 (0)