Skip to content

Shared Oxlint config: @uinaf/oxlint-config on the Cloudflare base #21

Backlog

Description

@altaywtf

One shared Oxlint config for every TypeScript repo in uinaf, altaywtf and putdotio: @uinaf/oxlint-config, built on @cloudflare/oxlint-config and adding our own rules.

Decisions

Decision Evidence
Base: @cloudflare/oxlint-config 0.2.0, pinned exactly, bumped by Renovate It extends @nkzw/oxlint-config 4.1.0 with ~25 stricter rules (no-unsafe-*, no-non-null-assertion, no-unsafe-type-assertion, consistent-type-imports, switch-exhaustiveness-check). Those match our rules on casts and non-null assertions. uinaf/infra and altaywtf/dotfiles already run it with no-comments
Package home: a new repo, uinaf/oxlint-config, published to npm as @uinaf/oxlint-config No repo owns a shared lint config today. This plugin repo tracks the plan until that repo exists; a config package needs its own release cycle
Our layer: @uinaf/oxlint-plugin-no-comments, plus the anti-slop rules nkzw lacks, plus an Effect entry nkzw already ships 12 of anti-slop's 18 generic rules as quality/*. Still missing: no-module-mocking, no-runtime-typeof, no-shape-in-symbol-names, no-unknown-parameters, require-readable-spacing, require-safety-comment-for-type-assertion, and the 5 anti-slop-effect/* rules. no-comments already accepts SAFETY: comments
Entry points: plain Oxlint (oxlint.config.ts) and Vite+ (lint in vite.config.ts) Both upstreams ship a /vite-plus entry; most of our repos lint through vp
Export env, ignorePatterns and options for repos to spread Oxlint reads these only from the root config, so they drop out through extends
Load plugins with import.meta.resolve Same as nkzw; works under strict pnpm without consumer peer installs
Rollout: switch failing rules off in one commit, then re-enable them one rule per commit The migration path both upstreams document; keeps each repo's PR reviewable

Repo lifecycle

stateDiagram-v2
    [*] --> Ready: Vite+ 1.7+ or Oxlint 1.94+, config in oxlint.config.ts or vite.config.ts
    Ready --> Adopted: extends @uinaf/oxlint-config, failing rules off
    Adopted --> Tightened: failing rules re-enabled one per commit
    Tightened --> Done: no local rule overrides except documented exceptions
    Ready --> Blocked: needs work outside lint (e.g. Renovate never runs)
    Blocked --> Ready
Loading

Parts

Part Owner Done when
[x] Create uinaf/oxlint-config: Cloudflare base, no-comments, ported anti-slop rules, Effect entry, both entry points uinaf Published as @uinaf/oxlint-config (1.0.4 since uinaf/oxlint-config#13, with no-comments 1.2.0 from #32) with provenance, released by CI through npm trusted publishing (pnpm publish since 1.0.4, so catalog: specifiers resolve); its CI lints itself with it
Renovate: group @uinaf/oxlint-config and @cloudflare/oxlint-config with the Oxlint toolchain uinaf/.github A base bump and an Oxlint bump arrive in one PR
Wave 1, uinaf: infra, design, altay-dot-wtf, mirel-guvenlik, react-json-logic, skillcheck, uinaf-dot-dev, workspace-kit, oxlint-plugin-no-comments uinaf Each repo is Done in the lifecycle above
Wave 2, altaywtf: dotfiles Tightened (altaywtf/dotfiles#627), off: no-unknown-parameters, no-runtime-typeof (pre-install converge code can't use Schema); puterminator Tightened (altaywtf/puterminator#51), off: no-unsafe-*, no-explicit-any, no-instanceof (need payload schemas), curly (no formatter), consistent-function-scoping, prefer-structured-clone (JSON round-trips intended), no-misused-spread, unbound-method. Both on 1.0.4 (altaywtf/dotfiles#630, altaywtf/puterminator#53) altaywtf Each repo is Done
Wave 3, put.io libraries: putio-cli, putio-mcp, putio-sdk-typescript, pas-js, putio-sockjs, rokit, taizn (replace vendored anti-slop; keep @effect/tsgo presets) put.io Each repo is Done; vendored anti-slop deleted. Part B: putio-sockjs Done (putdotio/putio-sockjs#130; file-scoped exceptions for the untyped socket payload, public Custom.value and smoke-script output); rokit Tightened (putdotio/rokit#140) and taizn Tightened (putdotio/taizn#152): decoder rules (no-runtime-typeof, unknown-input, no-unsafe-*), no-instanceof and anti-slop-effect/* stay off (need schemas or non-equivalent refactors). None of the three vendored anti-slop or used tsgo. Part A: putio-sdk-typescript Done (putdotio/putio-sdk-typescript#306; file-scoped exceptions: no-empty-object-type in exported response types, no-unsafe-type-assertion and no-misused-promises in the type-erased operation tree, no-unsafe-call in public isErrorLocalizer, no-instanceof for a private class and Web API bodies, no-namespace in specs, no-console in scripts, catch-error-name where it conflicts with no-unknown-parameters); putio-cli Done (putdotio/putio-cli#201; file-scoped no-unsafe-type-assertion for SAFETY casts, no-instanceof for platform bodies and state.ts until #202, no-console in scripts, only-throw-error in the smoke script, one no-unsafe-argument disable in src/cli.ts); pas-js Done (putdotio/pas-js#111; file-scoped decoder rules and type assertions in cookie and retry-queue code, no-unsafe-dictionary-type on public properties, no-console in scripts). Vendored anti-slop deleted from the SDK and CLI
Wave 4, put.io apps: putio-web (keeps @shadcn/lint; Tightened, #1738, #1739; #1740 open with runtime fixes; off: React Compiler rules (no compiler; findings sit in the video players), no-instanceof (DOM, event and Response narrowing), type-assertion, unknown-input and no-unsafe-* rules (need API schemas); no-console off only in scripts, e2e, configs and three logging sinks), putio-tv-legacy (Tightened, #168 open: merging deploys tv.put.io), putio-tv-native-legacy (Tightened, #173) put.io Each repo is Done; React Compiler, instanceof and no-console findings fixed or documented

Wave 1 status

Repo State PR Rules still off
infra Done uinaf/infra#969 no-runtime-typeof in workloads/executor/oauth-compat.mjs only: untyped OAuth query values, no schema library
oxlint-plugin-no-comments Done #23 unknown-input rules in src/rules/no-comments.ts (rule options) and test/no-comments.test.ts (AST walk) only
workspace-kit Adopted uinaf/workspace-kit#129 curly (drops line coverage under the 90% gate); unknown-input, no-unsafe-* and type-assertion rules (need config and JSON schemas)
design Adopted uinaf/design#204, #205, #207 type-assertion, unknown-input, no-runtime-typeof and no-unsafe-dictionary-type (need JSON and CSS schemas); no-known-value-widening (countByRule is published API); consistent-function-scoping (15 nested helpers)
altay-dot-wtf Adopted uinaf/altay-dot-wtf#116, #118, #120 type-assertion, unknown-input, no-runtime-typeof, no-unsafe-*, no-explicit-any, no-chained-type-assertions, no-object-parameters (need front matter, X API and satori types); no-console (Worker's X fallback signal); no-floating-promises off in node:test files
uinaf-dot-dev Adopted uinaf/uinaf-dot-dev#172, #174, #176 type-assertion, unknown-input and no-runtime-typeof (need GitHub API and Astro props schemas); no-floating-promises off in node:test files; no-console off in scripts/**

Wave 1 repo states:

Repo State Rules still off
mirel-guvenlik Done none; anti-slop/no-runtime-typeof runs with allowInTypeGuards for the locale walker
react-json-logic, #153 Tightened no-console, react/refs, exported-type rules, decoder rules
skillcheck Tightened no-console (CLI), decoder rules (no-runtime-typeof, no-unsafe-*, type assertions, unknown params/returns), named-contract rules

All wave 1 repos run 1.0.4, pinned exactly: infra#974, design#210, altay-dot-wtf#122, mirel-guvenlik#120, react-json-logic#155, skillcheck#145, uinaf-dot-dev#178, workspace-kit#132, #33. Their minimumReleaseAgeExclude names both packages without a version. None repeats the vite-plus jsPlugin or prefer-vite-plus-imports; the shared /vite-plus entry carries both.

Removable on 1.0.2

Repo Workaround to delete
putdotio/putio-web no-comments allow for ^@jsxImportSource and ^webpack[A-Z][A-Za-z]*: removed in putdotio/putio-web#1741
putdotio/putio-tv-legacy, putdotio/putio-tv-native-legacy no-comments allow for ^gitleaks:allow$ removed in putdotio/putio-tv-legacy#172, putdotio/putio-tv-native-legacy#174
altaywtf/puterminator catch-error-name ignore: ["^cause$"]; root react-hooks/rules-of-hooks off removed in altaywtf/puterminator#52
putdotio/putio-sdk-typescript file-scoped catch-error-name off removed in putdotio/putio-sdk-typescript#307
putdotio/taizn array-callback-return and unicorn/prefer-top-level-await off removed in putdotio/taizn#153
altaywtf/dotfiles no-comments allow for ^trufflehog:ignore$; no-manual-tagged-construction off in the PlatformError.systemError test removed in altaywtf/dotfiles#629

Removable on 1.0.3

1.0.3 turns react/rules-of-hooks off in test and e2e files (uinaf/oxlint-config#12): **/*.{test,spec,integration,e2e}.*, **/__tests__/**, **/e2e/**.

Repo Workaround to delete
putdotio/putio-tv-legacy react/rules-of-hooks off in e2e/** removed in putdotio/putio-tv-legacy#172
putdotio/putio-tv-native-legacy react/rules-of-hooks off in src/lib/sentry/diagnostics.test.ts removed in putdotio/putio-tv-native-legacy#174

Changed in 1.0.4

Consumer config

Vite+ (vite.config.ts):

import uinaf, { env, ignorePatterns } from "@uinaf/oxlint-config/vite-plus";
import { defineConfig } from "vite-plus";

export default defineConfig({
  lint: { extends: [uinaf], env, ignorePatterns },
});

Plain Oxlint (oxlint.config.ts; install oxlint and tsrs):

import uinaf, { env, ignorePatterns, options } from "@uinaf/oxlint-config";
import { defineConfig } from "oxlint";

export default defineConfig({ extends: [uinaf], env, ignorePatterns, options });

Effect: import @uinaf/oxlint-config/effect/vite-plus or @uinaf/oxlint-config/effect instead; the rest is the same.

Open checks

  • Does Vite+'s lint.extends pass the base's options (type-aware) through? Yes, on Vite+ 1.8.0; repos need not restate them. Proof: test/consumer.test.ts lints a floating promise through extends alone and expects typescript/no-floating-promises. Controls: the same file stays silent with the rule on and no typeAware, and with the config's options emptied. Plain Oxlint still needs options at the root.
  • How many findings does the Cloudflare base raise per repo? Measure on infra, putio-cli and putio-web before wave 1 to size the work.
  • putio-mcp has never had a Renovate run and is on Vite+ 1.5.x; it stays Blocked until the app runs there.
  • Cloudflare pins nkzw exactly, so nkzw fixes arrive only when Cloudflare releases. Revisit if Cloudflare stalls; switching to nkzw directly costs about 89 lines.
  • tsgo compatibility: @effect/tsgo 0.74.1 supports Oxlint 1.93–1.95 and Vite+ 1.8.0 bundles 1.94. Recheck on each Vite+ bump.

Schema rules still off, one tracking issue per repo: infra#980, design#214, altay-dot-wtf#127, react-json-logic#159, skillcheck#149, uinaf-dot-dev#182, workspace-kit#135, #37, dotfiles#634, puterminator#57, pas-js#116, putio-sockjs#135, rokit#144, taizn#158, putio-web#1746, putio-tv-legacy#176, putio-tv-native-legacy#178. putio-sdk-typescript, putio-cli and mirel-guvenlik have none.

Related: uinaf/.github#113, uinaf/.github#115, putdotio/.github#81

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions