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
165 changes: 0 additions & 165 deletions .oxlintrc.json

This file was deleted.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ Local checks:
pnpm run check
```

`pnpm run lint` runs type-aware Oxlint with TypeScript and Effect diagnostics.
`pnpm install` patches Oxlint with `@effect/tsgo`; keep the exact
`@effect/tsgo`, `typescript`, `oxlint`, and `oxlint-tsgolint` versions aligned.
TypeScript remains an unpatched, typecheck-only path so Effect diagnostics are
not reported twice.

Infra deploy test:

```bash
Expand Down
3 changes: 1 addition & 2 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://unpkg.com/knip@6/schema.json",
"entry": ["stacks/**/*.ts"],
"ignoreDependencies": ["@effect/language-service"]
"entry": ["stacks/**/*.ts"]
}
154 changes: 154 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import { recommended, style } from "@effect/tsgo/oxlint-presets";
import { defineConfig } from "oxlint";

export default defineConfig({
extends: [recommended, style],
plugins: ["import", "vitest"],
options: {
reportUnusedDisableDirectives: "error",
denyWarnings: true,
typeAware: true,
typeCheck: true,
},
categories: {
correctness: "error",
suspicious: "error",
perf: "error",
},
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "node:crypto",
message: "Use Effect Crypto service and provide a platform layer at the boundary.",
},
{
name: "crypto",
message: "Use Effect Crypto service and provide a platform layer at the boundary.",
},
{
name: "node:fs",
message: "Use Effect FileSystem service and provide a platform layer at the boundary.",
},
{
name: "fs",
message: "Use Effect FileSystem service and provide a platform layer at the boundary.",
},
{
name: "node:path",
message: "Use Effect Path service and provide a platform layer at the boundary.",
},
{
name: "path",
message: "Use Effect Path service and provide a platform layer at the boundary.",
},
{
name: "bun",
message: "Use Effect services and provide a platform layer at the boundary.",
},
{
name: "@opencode-ai/sdk/v1",
message:
"Import from '@opencode-ai/sdk/v2' instead of v1 for better type safety and features.",
},
{
name: "@opencode-ai/sdk",
message:
"Import from '@opencode-ai/sdk/v2' instead of the root SDK package for better type safety and features.",
},
],
},
],

"eslint/default-case-last": "error",
"eslint/eqeqeq": "error",
"eslint/max-params": ["error", 3],
"eslint/no-console": "error",
"eslint/no-else-return": "error",
"eslint/no-param-reassign": "error",
"eslint/no-regex-spaces": "error",
"eslint/no-self-compare": "error",
"eslint/no-var": "error",

"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
"import/no-commonjs": "error",
"import/no-cycle": "error",
"import/no-duplicates": "error",
"import/no-dynamic-require": "error",
"import/no-unassigned-import": "error",

"typescript/consistent-type-assertions": [
"error",
{
assertionStyle: "never",
},
],
"typescript/consistent-type-imports": [
"error",
{
prefer: "type-imports",
fixStyle: "separate-type-imports",
},
],
"typescript/explicit-module-boundary-types": [
"error",
{
allowHigherOrderFunctions: false,
},
],
"typescript/no-confusing-void-expression": "error",
"typescript/no-deprecated": "error",
"typescript/no-explicit-any": "error",
"typescript/no-import-type-side-effects": "error",
"typescript/no-misused-promises": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-assertion": "error",
"typescript/no-require-imports": "error",
"typescript/no-unnecessary-condition": "error",
"typescript/no-unsafe-argument": "error",
"typescript/no-unsafe-assignment": "error",
"typescript/no-unsafe-call": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/no-unsafe-return": "error",
"typescript/only-throw-error": "error",
"typescript/prefer-nullish-coalescing": "error",
"typescript/prefer-promise-reject-errors": "error",
"typescript/require-await": "error",
"typescript/restrict-plus-operands": "error",
"typescript/return-await": "error",
"typescript/strict-void-return": "error",
"typescript/switch-exhaustiveness-check": [
"error",
{
considerDefaultExhaustiveForUnions: true,
},
],
"typescript/use-unknown-in-catch-callback-variable": "error",

"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-instanceof-array": "error",
"unicorn/no-useless-promise-resolve-reject": "error",
"unicorn/no-useless-undefined": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-modern-math-apis": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-string-slice": "error",
"unicorn/throw-new-error": "error",

"vitest/expect-expect": [
"error",
{
additionalTestBlockFunctions: ["it.effect"],
assertFunctionNames: ["assert", "assertType", "expect", "expectTypeOf"],
},
],
"vitest/no-standalone-expect": [
"error",
{
additionalTestBlockFunctions: ["it.effect"],
},
],
},
});
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"type": "module",
"module": "alchemy.run.ts",
"scripts": {
"prepare": "lefthook install || true && effect-tsgo patch",
"prepare": "effect-tsgo patch --no-typescript --oxlint && (lefthook install || true)",
"test:unit": "vitest run test/unit",
"test:e2e": "vitest run test/e2e",
"typecheck": "tsc --noEmit",
"knip": "knip",
"lint": "oxlint",
"lint:fix": "oxlint --fix",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
"format": "oxfmt",
"format:fix": "oxfmt --write .",
"deploy:dev": "alchemy deploy",
Expand All @@ -22,20 +22,20 @@
"dependencies": {
"@effect/platform-browser": "4.0.0-beta.102",
"@effect/platform-node": "4.0.0-beta.102",
"@opencode-ai/sdk": "^1.18.11",
"@opencode-ai/sdk": "^1.18.15",
"alchemy": "2.0.0-beta.67",
"effect": "4.0.0-beta.102"
},
"devDependencies": {
"@effect/tsgo": "^0.24.3",
"@effect/tsgo": "0.36.1",
"@effect/vitest": "4.0.0-beta.102",
"@types/node": "^26.1.2",
"knip": "^6.31.0",
"@types/node": "^26.2.0",
"knip": "^6.32.0",
"lefthook": "^2.1.10",
"oxfmt": "^0.61.0",
"oxlint": "^1.76.0",
"oxlint-tsgolint": "^7.0.2001",
"typescript": "^7.0.2",
"oxfmt": "^0.62.0",
"oxlint": "1.77.0",
"oxlint-tsgolint": "7.0.2001",
"typescript": "7.0.2",
"vitest": "^4.1.10"
},
"packageManager": "pnpm@11.18.0"
Expand Down
Loading