Skip to content
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 .github/workflows/lintBuildTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
path: node_modules
key: modules-${{ hashFiles('package-lock.json', 'patches/**') }}
- name: Typecheck
run: npx tsc
run: npx tsgo
- name: Lint
run: npm run lint
- name: Check formatting
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ deno.lock

.env
.eslintcache
*.tsbuildinfo

# System Files
.DS_Store
Expand Down
24 changes: 24 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@
"radix": "error",

"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"prefer-const": "error",
"import/no-nodejs-modules": "error",
"react/no-this-in-sfc": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"unicorn/relative-url-style": "error",

// suspicious rules (cherry-picked)
"no-extra-bind": "error",
"no-unneeded-ternary": "error",
"no-useless-concat": "error",
"no-useless-constructor": "error",
"import/no-absolute-path": "error",
"import/no-self-import": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unnecessary-template-expression": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",

// TypeScript rules (currently disabled but available)
"@typescript-eslint/no-floating-promises": "off",
Expand All @@ -80,6 +98,12 @@
"import/no-default-export": "off"
}
},
{
"files": ["**/*.spec.ts", "**/*.config.ts", "**/*.config.mjs", "tools/**/*"],
"rules": {
"import/no-nodejs-modules": "off"
}
},
{
// catch unawaited Playwright calls in e2e tests
"files": ["test/e2e/**/*.ts"],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ To debug end-to-end failures on CI, check out the branch with the failure and ru
| `npm test` | Vitest unit tests |
| `npm run e2ec` | Run Playwright E2E tests in Chrome only |
| `npm run lint` | ESLint |
| `npx tsc` | Check types |
| `npm run tsc` | Check types |
| `npm run ci` | Lint, tests (unit and e2e), and types |
| `npm run fmt` | Format everything. Rarely necessary thanks to editor integration |
| `npm run gen-api` | Generate API client (see [`docs/update-pinned-api.md`](docs/update-pinned-api.md)) |
Expand Down
2 changes: 1 addition & 1 deletion app/forms/disk-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ const SnapshotSelectField = ({ control }: { control: Control<DiskCreateForm> })
const formattedSize = filesize(i.size, { base: 2, output: 'object' })
return {
value: i.id,
selectedLabel: `${i.name}`,
selectedLabel: i.name,
label: (
<>
<div>{i.name}</div>
Expand Down
2 changes: 1 addition & 1 deletion app/forms/firewall-rules-common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ const icmpTypeItems = [
...Object.entries(ICMP_TYPES).map(([type, name]) => ({
value: type,
label: `${type} - ${name}`,
selectedLabel: `${type}`,
selectedLabel: type,
})),
]

Expand Down
3 changes: 2 additions & 1 deletion app/forms/firewall-rules-create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export default function CreateFirewallRuleForm() {

const updateRules = useApiMutation(api.vpcFirewallRulesUpdate, {
onSuccess(updatedRules) {
const newRule = updatedRules.rules[updatedRules.rules.length - 1]
// We just appended a rule, so the response list is non-empty
const newRule = updatedRules.rules.at(-1)!
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes nothing, it just came up when I did an audit of things that fail when we turn on noUncheckedIndexAccess and I changed it to use at because it's shorter

queryClient.invalidateEndpoint('vpcFirewallRulesView')
// prettier-ignore
addToast(<>Firewall rule <HL>{newRule.name}</HL> created</>)
Expand Down
4 changes: 2 additions & 2 deletions app/ui/lib/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function DateSegment({
placeholder = segment.placeholder
}

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

return (
<div
Expand All @@ -135,7 +135,7 @@ function DateSegment({
)}
// Segment props turns this into a focusable element
// @ts-expect-error
disabled={readOnly ? true : false}
disabled={readOnly}
>
{/* Always reserve space for the placeholder, to prevent layout shift when editing. */}
<span
Expand Down
2 changes: 1 addition & 1 deletion mock-api/msw/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ export const handlers = makeHandlers({
name,
description,
instance_id: instanceId,
primary: i === 0 ? true : false,
primary: i === 0,
mac: '00:00:00:00:00:00',
ip_stack: ip_config
? resolveIpStack(ip_config)
Expand Down
2 changes: 1 addition & 1 deletion mock-api/msw/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const paginated = <P extends PaginateOptions, I extends { id: string }>(

return {
items: items.slice(startIndex, startIndex + limit),
next_page: `${items[startIndex + limit].id}`,
next_page: items[startIndex + limit].id,
}
}

Expand Down
Loading
Loading