oxlint.config.ts
This file
Path
oxlint.config.ts
141 lines · 5.0 KiB · TypeScript
Last changed by
Merge lint/ignore-config-folder into mainoscabrielbefore adoption4e6ca2b
History of this fileTake it
The walk stopped after 200 commits: lines older than 10c8b54 point at it.
Merge lint/ignore-config-folder into mainoscabrielbefore adoption4e6ca2b
line 1why, one step back1import { Brand } from "@repo/brand";Merge branch 'build/906-platform-root-page'oscabrielbefore adoption10c8b54
lines 2–19why, one step back2import { defineConfig } from "oxlint";3import core from "ultracite/oxlint/core";4import react from "ultracite/oxlint/react";5import tanstack from "ultracite/oxlint/tanstack";6import vitest from "ultracite/oxlint/vitest";78const V3_OR_HOST_BOUND =9 "Effect v4 only: no v3 @effect/platform or @effect/cli, no effect/unstable/*, and no effect/workflow or effect/cluster (AGENTS.md principle 9).";1011export default defineConfig({12 extends: [core, vitest],13 ignorePatterns: [14 ...(core.ignorePatterns ?? []),15 ".claude/**",16 ".codex/**",17 "tools/oxlint/anti-slop/**",18 "**/worker-configuration.d.ts",19 "examples/**",Merge lint/ignore-config-folder into mainoscabrielbefore adoption4e6ca2b
lines 20–21why, one step back20 // Imports the published rules package, which this repo never installs; the platform checks it.21 `${Brand.configDir}/**`,Merge branch 'build/906-platform-root-page'oscabrielbefore adoption10c8b54
lines 22–36why, one step back22 "apps/web/src/components/ui/**",23 "apps/web/src/routeTree.gen.ts",24 ],25 jsPlugins: [26 { name: "anti-slop", specifier: "./tools/oxlint/anti-slop/index.ts" },27 {28 name: "anti-slop-effect",29 specifier: "./tools/oxlint/anti-slop/effect/index.ts",30 },31 ],32 options: {33 typeAware: true,34 },35 overrides: [36 {Merge build/comments-ops into mainoscabrielbefore adoptione4c407e
line 37why, one step back37 // An override declares its plugins so its rule options stick.Merge branch 'build/906-platform-root-page'oscabrielbefore adoption10c8b54
lines 38–49why, one step back38 files: ["apps/web/**/*.{ts,tsx}"],39 plugins: react.plugins ?? [],40 rules: {41 ...react.rules,42 ...tanstack.rules,43 },44 },45 ...(tanstack.overrides ?? []).map((override) => ({46 ...override,47 files: override.files.map((glob) => `apps/web/${glob}`),48 })),49 {Merge build/comments-ops into mainoscabrielbefore adoptione4c407e
line 50why, one step back50 // Without `plugins` here, oxlint keeps Ultracite's override options and drops ours.Merge branch 'build/906-platform-root-page'oscabrielbefore adoption10c8b54
lines 51–141why, one step back51 files: [52 "**/*.{test,spec,test-d,spec-d}.{ts,tsx,js,jsx,mts,cts,mjs,cjs}",53 "**/__tests__/**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}",54 ],55 plugins: ["vitest"],56 rules: {57 // `@effect/vitest` test blocks: `it.effect(…, () => Effect.gen(…))`.58 "vitest/no-standalone-expect": [59 "error",60 {61 additionalTestBlockFunctions: [62 "it.effect",63 "it.effect.each",64 "it.effect.only",65 "it.effect.skip",66 "it.flakyTest",67 "it.layer",68 "it.live",69 "it.live.each",70 "it.prop",71 "layer",72 ],73 },74 ],75 },76 },77 ],78 rules: {79 "anti-slop-effect/no-manual-effect-error-tag": "error",80 "anti-slop-effect/no-manual-tag-comparison": "error",81 "anti-slop-effect/no-manual-tagged-construction": "error",82 "anti-slop-effect/no-service-constructor-imports": "error",83 "anti-slop-effect/prefer-effect-match": "error",84 "anti-slop/no-array-filter-map": "error",85 "anti-slop/no-chained-type-assertions": "error",86 "anti-slop/no-conditional-empty-object-spread": "error",87 "anti-slop/no-known-value-widening": "error",88 "anti-slop/no-module-mocking": "error",89 "anti-slop/no-object-parameters": "error",90 "anti-slop/no-reduce-accumulator-copy": "error",91 "anti-slop/no-reflect-apply": "error",92 "anti-slop/no-reflect-get": "error",93 "anti-slop/no-runtime-typeof": "error",94 "anti-slop/no-shape-in-symbol-names": "error",95 "anti-slop/no-unknown-parameters": "error",96 "anti-slop/no-unknown-returns": "error",97 "anti-slop/no-unknown-type-aliases": "error",98 "anti-slop/no-unsafe-dictionary-type": "error",99 "anti-slop/no-widen-then-assert": "error",100 "anti-slop/require-readable-spacing": "error",101 "anti-slop/require-safety-comment-for-type-assertion": "error",102 // Effect: `Effect.gen(function* () {…})`; `Effect.fn("name")` names spans.103 "func-names": ["error", "always", { generators: "never" }],104 // Effect: Schema classes, tagged errors and services are all classes.105 "max-classes-per-file": "off",106 // Effect: `const X = Schema…` beside `type X = typeof X.Type`. tsc still107 // catches a real redeclaration.108 "no-redeclare": "off",109 "no-restricted-imports": [110 "error",111 {112 paths: [113 { message: V3_OR_HOST_BOUND, name: "@effect/platform" },114 { message: V3_OR_HOST_BOUND, name: "@effect/cli" },115 { message: V3_OR_HOST_BOUND, name: "effect/workflow" },116 { message: V3_OR_HOST_BOUND, name: "effect/cluster" },117 ],118 patterns: [119 {120 group: [121 "@effect/platform/*",122 "@effect/cli/*",123 "effect/unstable/*",124 "effect/workflow/*",125 "effect/cluster/*",126 ],127 message: V3_OR_HOST_BOUND,128 },129 ],130 },131 ],132 "oxc/no-accumulating-spread": "error",133 // Effect: its `asyncFunction` diagnostic bans `async`; promises appear only134 // where a library takes them, as plain promise-returning functions.135 "typescript/promise-function-async": "off",136 // Effect: `Effect.forEach(xs, f, { concurrency })` is not a `thisArg`.137 "unicorn/no-array-method-this-argument": "off",138 // Effect: `Schema.TaggedError<X>()(…)` returns a class, not an error.139 "unicorn/throw-new-error": "off",140 },141});