Skip to content

Commit dbd63c9

Browse files
committed
turn on more lint rules
1 parent 32f3c1b commit dbd63c9

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

.oxlintrc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@
6060
"radix": "error",
6161

6262
"@typescript-eslint/no-explicit-any": "error",
63+
"@typescript-eslint/consistent-type-assertions": "error",
64+
"prefer-const": "error",
65+
"import/no-nodejs-modules": "error",
66+
"react/no-this-in-sfc": "error",
67+
"@typescript-eslint/no-invalid-void-type": "error",
68+
"unicorn/relative-url-style": "error",
69+
70+
// suspicious rules (cherry-picked)
71+
"no-extra-bind": "error",
72+
"no-unneeded-ternary": "error",
73+
"no-useless-concat": "error",
74+
"no-useless-constructor": "error",
75+
"import/no-absolute-path": "error",
76+
"import/no-self-import": "error",
77+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
78+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
79+
"@typescript-eslint/no-unnecessary-template-expression": "error",
80+
"@typescript-eslint/no-confusing-non-null-assertion": "error",
6381

6482
// TypeScript rules (currently disabled but available)
6583
"@typescript-eslint/no-floating-promises": "off",
@@ -80,6 +98,12 @@
8098
"import/no-default-export": "off"
8199
}
82100
},
101+
{
102+
"files": ["**/*.spec.ts", "**/*.config.ts", "**/*.config.mjs", "tools/**/*"],
103+
"rules": {
104+
"import/no-nodejs-modules": "off"
105+
}
106+
},
83107
{
84108
// catch unawaited Playwright calls in e2e tests
85109
"files": ["test/e2e/**/*.ts"],

app/forms/disk-create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ const SnapshotSelectField = ({ control }: { control: Control<DiskCreateForm> })
432432
const formattedSize = filesize(i.size, { base: 2, output: 'object' })
433433
return {
434434
value: i.id,
435-
selectedLabel: `${i.name}`,
435+
selectedLabel: i.name,
436436
label: (
437437
<>
438438
<div>{i.name}</div>

app/forms/firewall-rules-common.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const icmpTypeItems = [
301301
...Object.entries(ICMP_TYPES).map(([type, name]) => ({
302302
value: type,
303303
label: `${type} - ${name}`,
304-
selectedLabel: `${type}`,
304+
selectedLabel: type,
305305
})),
306306
]
307307

app/ui/lib/DateField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function DateSegment({
117117
placeholder = segment.placeholder
118118
}
119119

120-
const readOnly = segmentProps['aria-readonly'] ? true : false
120+
const readOnly = !!segmentProps['aria-readonly']
121121

122122
return (
123123
<div
@@ -135,7 +135,7 @@ function DateSegment({
135135
)}
136136
// Segment props turns this into a focusable element
137137
// @ts-expect-error
138-
disabled={readOnly ? true : false}
138+
disabled={readOnly}
139139
>
140140
{/* Always reserve space for the placeholder, to prevent layout shift when editing. */}
141141
<span

mock-api/msw/handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ export const handlers = makeHandlers({
665665
name,
666666
description,
667667
instance_id: instanceId,
668-
primary: i === 0 ? true : false,
668+
primary: i === 0,
669669
mac: '00:00:00:00:00:00',
670670
ip_stack: ip_config
671671
? resolveIpStack(ip_config)

mock-api/msw/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const paginated = <P extends PaginateOptions, I extends { id: string }>(
7777

7878
return {
7979
items: items.slice(startIndex, startIndex + limit),
80-
next_page: `${items[startIndex + limit].id}`,
80+
next_page: items[startIndex + limit].id,
8181
}
8282
}
8383

0 commit comments

Comments
 (0)