@shekohex/oxc-effect
v0.2.1
Published
Oxlint rules for declarative Effect TypeScript composition and repository-wide style consistency.
Maintainers
Readme
OXC Effect
@shekohex/oxc-effect is an Oxlint JS plugin for Effect TypeScript. It enforces flat composition, explicit sequencing, readable control flow, and code shapes that are easier to remediate mechanically.
Targets Effect v4 only. Effect v3 APIs and rule aliases are not supported.
All former Biome Grit rules are implemented with Oxlint's ESLint-compatible plugin API. The plugin uses eslintCompatPlugin and createOnce, so it runs through Oxlint's optimized JS plugin path while remaining ESLint-compatible.
Install
npm install -D @shekohex/oxc-effectyarn add -D @shekohex/oxc-effectpnpm add -D @shekohex/oxc-effectoxlint and @oxlint/plugins are runtime dependencies, so the package CLI works without separate setup.
effect ^4.0.0-beta.0 is a required peer dependency. @effect/atom-react ^4.0.0-beta.0 is optional and only needed for React Atom projects.
Configure Oxlint
Use the full preset from .oxlintrc.json:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"extends": [
"./node_modules/@shekohex/oxc-effect/configs/full.jsonc"
]
}Available presets:
configs/full.jsonc: every ruleconfigs/core.jsonc: Effect composition and control-flow rulesconfigs/web.jsonc: React and Effect Atom rulesconfigs/ts-type.jsonc: type-modeling and boundary rules
Oxlint does not support npm shared-config names in extends. Use explicit node_modules file path shown above.
Select Rules
Register plugin directly when using custom subset:
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"jsPlugins": [
{
"name": "effect",
"specifier": "@shekohex/oxc-effect"
}
],
"rules": {
"effect/no-effect-gen-callback-alias": "error",
"effect/no-effect-fn-callback-alias": "error",
"effect/prefer-effect-fn": "error",
"effect/no-return-in-arrow": "warn"
}
}Oxlint JS plugins are currently alpha. Pin package versions when adopting them in CI.
CLI
Package ships zero-setup CLI. It writes temporary Oxlint config with selected preset and runs bundled Oxlint binary.
npx @shekohex/oxc-effect check src/file.ts
npx @shekohex/oxc-effect check src/messages --preset=core
npx @shekohex/oxc-effect check src/messages --preset=core --guide-on-linting
npx @shekohex/oxc-effect guidecheck runs Oxlint. --preset accepts full, core, web, or ts-type. --guide prints remediation guide before linting. --guide-on-linting prints it only when Oxlint exits non-zero. guide --print prints packaged guide content.
Agent Guide
Package includes remediation guidance at docs/linting.md.
npx @shekohex/oxc-effect guide
npx @shekohex/oxc-effect guide --printnode -p "require.resolve('@shekohex/oxc-effect/agent-guide')"Severity
Most rules are errors. Shape guidance remains warnings:
no-effect-succeed-variableno-flatmap-ladderno-option-effect-branchprefer-assert-in-effect-testprefer-effect-asyncprefer-effect-cacheprefer-effect-child-processprefer-effect-date-timeprefer-effect-http-clientprefer-effect-schedulingprefer-effect-test-layerprefer-schema-jsonno-return-in-arrowno-return-in-callbackwarn-effect-sync-wrapper
Biome allowed one Grit rule to emit different severities. Oxlint severity belongs to rule configuration, so former no-match-effect-branch implementation is represented as error rule no-match-effect-branch and warning rule no-option-effect-branch.
Rule Options
Every rule supports ignoredPathFragments. Diagnostics are skipped when current file path contains any configured fragment.
{
"rules": {
"effect/no-switch-statement": [
"error",
{
"ignoredPathFragments": ["/generated/", ".stories."]
}
],
"effect/prefer-effect-http-client": "off"
}
}Use native severity to control activation:
"off": disabled"warn": enabled as warning"error": enabled as error
Development
corepack yarn install --immutable
corepack yarn test
corepack yarn buildTests execute real Oxlint processes against TypeScript and TSX fixtures. Every exported rule has direct invalid-case coverage; complex structural rules also retain valid fixtures and edge-case coverage.
Layout
plugin.js: published Oxlint plugin entrypointlib/ast.js: shared ESTree traversal and matching helpersrules/*.js: converted rule modulesconfigs/*.jsonc: published Oxlint presetsbin/oxc-effect.mjs: zero-setup CLIdocs/linting.md: remediation guidetests/rules: real Oxlint integration tests
Tooling
Use this rule pack with @effect/tsgo, @typescript/native-preview, and @effect/language-service. Oxlint enforces code shape, Tsgo provides compile feedback, and Effect language service provides project-aware diagnostics.
Publishing
Repository is Projen-managed. Edit .projenrc.ts, then run corepack yarn tsx .projenrc.ts when changing generated package metadata or workflows.
release.yml uses npm provenance and GitHub OIDC from the npm environment. Release Please opens a release PR after releasable commits reach master; merging that PR publishes the resulting package.
Because npm Trusted Publishers require an existing package, bootstrap 0.0.7 once from a trusted local machine:
- Run
corepack yarn build. - Authenticate with npm using
npm login. - Publish the generated tarball with
npm publish dist/js/shekohex-oxc-effect-0.0.7.tgz --access public. - On npmjs.com, configure GitHub Actions as trusted publisher with repository
shekohex/oxc-effect-linting-rules, workflowrelease.yml, and environmentnpm. - Future Release Please versions authenticate through OIDC only; no npm token or GitHub secret is required.
