@effect/tsgo 0.70.0 → 0.73.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,12 +5,12 @@ A wrapper for both [TSRS](https://github.com/oxc-project/tsrs) and [TypeScript-G
5
5
  <!-- supported-components:start -->
6
6
  ## Supported Package Versions
7
7
 
8
- The following target package versions are supported by `@effect/tsgo@0.70.0`:
8
+ The following target package versions are supported by `@effect/tsgo@0.73.2`:
9
9
 
10
10
  | Component | Supported versions |
11
11
  |---|---|
12
- | TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261116.1` |
13
- | tsrs | `0.25.0-ts7.1.0-beta` |
12
+ | TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261118.1` |
13
+ | tsrs | `7.1.0-beta.tsrs2`, `7.1.0-beta.tsrs3` |
14
14
  | Oxlint | `1.91.0`, `1.92.0`, `1.93.0`, `1.94.0` |
15
15
  | oxlint-tsgolint | `7.0.2005`, `7.0.2006`, `7.0.2007` |
16
16
  <!-- supported-components:end -->
@@ -52,9 +52,10 @@ effect-tsgo --tsrs-lint=latest vp lint # with a tsrs version or tag
52
52
 
53
53
  Every argument after the tool is passed through unchanged, so the commands work as drop-in replacements in `package.json` scripts and editor settings that launch `tsc`.
54
54
 
55
- - `tsc` and `tsrs` run the requested version or tag; without one they run the build of the installed `typescript`/`@typescript/native` (>= 7) or `tsrs` version when this release ships it, and otherwise the latest supported version. They do not require TypeScript or tsrs to be installed.
56
- - `oxlint` runs the CLI of the installed `oxlint` package (installed directly or through `vite-plus`) with the Effect-patched native binding and, when `oxlint-tsgolint` is installed, the Effect-patched `tsgolint` of the installed versions. It does not accept a version.
57
- - `vp` runs the CLI of the installed `vite-plus` package, so that the Oxlint it starts (for `vp check`, `vp lint`, and scripts run through `vp run`) uses the Effect-patched binding and `tsgolint` of the oxlint version vite-plus resolves. It does not accept a version.
55
+ - `tsc` and `tsrs` run the requested version or tag; without one they run the build of the installed `typescript`/`@typescript/native` (>= 7) or `tsrs` (installed directly or through `vite-plus`) version when this release ships it, and otherwise the latest supported version. They do not require TypeScript or tsrs to be installed.
56
+ - `oxlint` runs the CLI of the installed `oxlint` package (installed directly or through `vite-plus`) with the Effect-patched native binding and, when `oxlint-tsgolint` is installed, the Effect-patched `tsgolint` of the installed versions. Without `oxlint-tsgolint` but with `tsrs` installed, the type-aware rules run on the Effect-patched build of that `tsrs` version. It does not accept a version.
57
+ - `vp` runs the CLI of the installed `vite-plus` package, so that the Oxlint it starts (for `vp check`, `vp lint`, and scripts run through `vp run`) uses the Effect-patched binding and type-aware linter of the versions vite-plus resolves: `tsgolint` up to Vite+ 1.6, and from Vite+ 1.7.0, which lints with its own `tsrs`, the Effect-patched build of that `tsrs` version. It does not accept a version.
58
+ - `oxlint` and `vp` also set `TSRS_BINARY` to the Effect-patched build of the installed `tsrs` version when this release ships it, so every `tsrs` started through tsrs's launcher under them, such as `vp exec tsrs`, is the patched one.
58
59
  - `--tsrs-lint[=<version|tag>]`, in front of `oxlint` or `vp`, runs Oxlint's type-aware rules, including the Effect ones, on the Effect-patched `tsrs` (`tsrs --lint`, tsrs's port of tsgolint) instead of the patched `tsgolint`; `oxlint-tsgolint` does not need to be installed. The tsrs version is picked as for `effect-tsgo tsrs`: the requested version or tag, else the installed `tsrs` version when this release ships it, else the latest supported one. tsrs does not support tsgolint's Go profiling variables (`OXLINT_TSGOLINT_TRACE`, `OXLINT_TSGOLINT_CPU`, `OXLINT_TSGOLINT_HEAP`, `OXLINT_TSGOLINT_ALLOCS`).
59
60
  - `oxlint` and `vp` work under Node.js and Bun: they preload `@effect/tsgo/oxlint-bridge` through `NODE_OPTIONS` and `BUN_OPTIONS`, in front of any options already set there, so every process they start loads the patched Oxlint binding in place of the stock one and every other native addon unchanged.
60
61
  - As with `patch`, the packaged `tsrs` and `oxlint` builds do not support Linux musl.
@@ -159,6 +160,8 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
159
160
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/prefer-schema-over-json.md"><code>preferSchemaOverJson</code></a></td><td>Deprecated: use globalJsonInEffect and globalJson instead. Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify inside Effect code</td></tr>
160
161
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/process-env.md"><code>processEnv</code></a></td><td>Warns when reading process.env outside Effect generators instead of using Effect Config</td></tr>
161
162
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/process-env-in-effect.md"><code>processEnvInEffect</code></a></td><td>Warns when reading process.env inside Effect generators instead of using Effect Config</td></tr>
163
+ <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/promise-all-in-effect.md"><code>promiseAllInEffect</code></a></td><td>Warns when Promise.all or Promise.allSettled fans out over an array inside Effect code instead of Effect.forEach or Effect.all with a concurrency option</td></tr>
164
+ <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/promise-race-in-effect.md"><code>promiseRaceInEffect</code></a></td><td>Warns when Promise.race or Promise.any races a list of promises inside Effect code, leaving the losing promises running</td></tr>
162
165
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/schema-sync.md"><code>schemaSync</code></a></td><td>Suggests Effect-based Schema decoding and encoding instead of synchronous methods</td></tr>
163
166
  <tr><td colspan="2"><strong>Style</strong> <em>Cleanup, consistency, and idiomatic Effect code.</em></td></tr>
164
167
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/acquire-release-disposable.md"><code>acquireReleaseDisposable</code></a></td><td>Suggests Effect.acquireDisposable when Effect.acquireRelease only invokes the acquired resource&#39;s disposal protocol</td></tr>
@@ -185,6 +188,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
185
188
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-conditional-to-filter-or-fail.md"><code>flatMapConditionalToFilterOrFail</code></a></td><td>Suggests Effect.filterOrFail or Effect.filterOrElse when Effect.flatMap conditionally passes its input through with Effect.succeed</td></tr>
186
189
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-identity-to-flatten.md"><code>flatMapIdentityToFlatten</code></a></td><td>Suggests Effect.flatten instead of Effect.flatMap when the callback is Effect&#39;s identity export referenced directly or an unannotated function returning its parameter</td></tr>
187
190
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-ignored-param-to-and-then.md"><code>flatMapIgnoredParamToAndThen</code></a></td><td>Suggests using Effect.andThen instead of Effect.flatMap when a zero-parameter callback returns an existing Effect value</td></tr>
191
+ <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-map-to-zip-with.md"><code>flatMapMapToZipWith</code></a></td><td>Suggests Effect.zipWith when Effect.flatMap only maps an independent effect with its parameter</td></tr>
188
192
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-provide-service-to-provide-service-effect.md"><code>flatMapProvideServiceToProvideServiceEffect</code></a></td><td>Suggests Effect.provideServiceEffect when a flatMap or andThen callback only forwards its parameter to Effect.provideService</td></tr>
189
193
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-to-map.md"><code>flatMapToMap</code></a></td><td>Suggests using Effect.map instead of Effect.flatMap when the callback only wraps its result with Effect.succeed</td></tr>
190
194
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/flat-map-to-tap.md"><code>flatMapToTap</code></a></td><td>Suggests Effect.tap when a flatMap or andThen callback runs an effect and returns its unchanged parameter</td></tr>
@@ -57911,7 +57911,7 @@ const runWith = (command, config) => {
57911
57911
  //#endregion
57912
57912
  //#region package.json
57913
57913
  var name = "@effect/tsgo";
57914
- var version = "0.70.0";
57914
+ var version = "0.73.2";
57915
57915
 
57916
57916
  //#endregion
57917
57917
  //#region src/metadata.json
@@ -57980,6 +57980,7 @@ var presets$1 = [
57980
57980
  "flatMapConditionalToFilterOrFail": "suggestion",
57981
57981
  "flatMapIdentityToFlatten": "suggestion",
57982
57982
  "flatMapIgnoredParamToAndThen": "suggestion",
57983
+ "flatMapMapToZipWith": "suggestion",
57983
57984
  "flatMapProvideServiceToProvideServiceEffect": "suggestion",
57984
57985
  "flatMapToMap": "suggestion",
57985
57986
  "flatMapToTap": "suggestion",
@@ -58085,6 +58086,7 @@ var presets$1 = [
58085
58086
  "flatMapConditionalToFilterOrFail": "error",
58086
58087
  "flatMapIdentityToFlatten": "error",
58087
58088
  "flatMapIgnoredParamToAndThen": "error",
58089
+ "flatMapMapToZipWith": "error",
58088
58090
  "flatMapProvideServiceToProvideServiceEffect": "error",
58089
58091
  "flatMapToMap": "error",
58090
58092
  "flatMapToTap": "error",
@@ -58241,6 +58243,8 @@ var presets$1 = [
58241
58243
  "preferEffectString": "warning",
58242
58244
  "processEnv": "warning",
58243
58245
  "processEnvInEffect": "warning",
58246
+ "promiseAllInEffect": "warning",
58247
+ "promiseRaceInEffect": "warning",
58244
58248
  "schemaSync": "warning"
58245
58249
  }
58246
58250
  },
@@ -58272,6 +58276,7 @@ var presets$1 = [
58272
58276
  "flatMapConditionalToFilterOrFail": "warning",
58273
58277
  "flatMapIdentityToFlatten": "warning",
58274
58278
  "flatMapIgnoredParamToAndThen": "warning",
58279
+ "flatMapMapToZipWith": "warning",
58275
58280
  "flatMapProvideServiceToProvideServiceEffect": "warning",
58276
58281
  "flatMapToMap": "warning",
58277
58282
  "flatMapToTap": "warning",
@@ -59600,6 +59605,40 @@ var rules = [
59600
59605
  }]
59601
59606
  }
59602
59607
  },
59608
+ {
59609
+ "name": "promiseAllInEffect",
59610
+ "group": "effectNative",
59611
+ "description": "Warns when Promise.all or Promise.allSettled fans out over an array inside Effect code instead of Effect.forEach or Effect.all with a concurrency option",
59612
+ "defaultSeverity": "off",
59613
+ "fixable": true,
59614
+ "supportedEffect": ["v3", "v4"],
59615
+ "codes": [377198],
59616
+ "preview": {
59617
+ "sourceText": "import { Effect } from \"effect\"\n\ndeclare const ids: ReadonlyArray<string>\ndeclare const fetchUser: (id: string) => Promise<{ readonly name: string }>\n\nexport const users = Effect.tryPromise(() => Promise.all(ids.map((id) => fetchUser(id))))\n",
59618
+ "diagnostics": [{
59619
+ "start": 196,
59620
+ "end": 207,
59621
+ "text": "`Promise.all` starts every promise at once with no concurrency bound, and they keep running when the fiber is interrupted. Use `Effect.forEach` with a concurrency option instead. effect(promiseAllInEffect)"
59622
+ }]
59623
+ }
59624
+ },
59625
+ {
59626
+ "name": "promiseRaceInEffect",
59627
+ "group": "effectNative",
59628
+ "description": "Warns when Promise.race or Promise.any races a list of promises inside Effect code, leaving the losing promises running",
59629
+ "defaultSeverity": "off",
59630
+ "fixable": true,
59631
+ "supportedEffect": ["v3", "v4"],
59632
+ "codes": [377212, 377213],
59633
+ "preview": {
59634
+ "sourceText": "import { Effect } from \"effect\"\n\ndeclare const mirrors: ReadonlyArray<string>\ndeclare const download: (url: string) => Promise<Uint8Array>\n\nexport const preview = Effect.tryPromise(() => Promise.any(mirrors.map((url) => download(url))))\n",
59635
+ "diagnostics": [{
59636
+ "start": 187,
59637
+ "end": 198,
59638
+ "text": "This Effect code races promises with `Promise.any`; the losing promises keep running and are not interrupted. Use `Effect.raceAll` over Effect values instead. effect(promiseRaceInEffect)"
59639
+ }]
59640
+ }
59641
+ },
59603
59642
  {
59604
59643
  "name": "schemaSync",
59605
59644
  "group": "effectNative",
@@ -60025,6 +60064,23 @@ var rules = [
60025
60064
  }]
60026
60065
  }
60027
60066
  },
60067
+ {
60068
+ "name": "flatMapMapToZipWith",
60069
+ "group": "style",
60070
+ "description": "Suggests Effect.zipWith when Effect.flatMap only maps an independent effect with its parameter",
60071
+ "defaultSeverity": "suggestion",
60072
+ "fixable": true,
60073
+ "supportedEffect": ["v3", "v4"],
60074
+ "codes": [377218],
60075
+ "preview": {
60076
+ "sourceText": "import { Effect } from \"effect\"\n\n// The quick fix rewrites this to Effect.zipWith(getUser, getConfig, (user, config) => `${user.name} (${config.locale})`).\n// Notes:\n// - The rule stays silent when the inner effect uses the outer result (e.g. `loadProfile(user.id)`),\n// because the second effect depends on the first and zipWith does not apply.\n// - When the combiner is exactly `[user, config]`, the fix suggests Effect.zip(getUser, getConfig).\n// - The rule stays silent when the mapper returns the outer value unchanged, because flatMapToTap covers that.\n\ndeclare const getUser: Effect.Effect<{ readonly name: string }>\ndeclare const getConfig: Effect.Effect<{ readonly locale: string }>\n\nexport const greeting = Effect.flatMap(getUser, (user) =>\n Effect.map(getConfig, (config) => `${user.name} (${config.locale})`))\n",
60077
+ "diagnostics": [{
60078
+ "start": 719,
60079
+ "end": 733,
60080
+ "text": "`Effect.zipWith` combines these two independent effects directly instead of `Effect.flatMap` nesting an `Effect.map` over an effect that does not use the outer result. effect(flatMapMapToZipWith)"
60081
+ }]
60082
+ }
60083
+ },
60028
60084
  {
60029
60085
  "name": "flatMapProvideServiceToProvideServiceEffect",
60030
60086
  "group": "style",
@@ -60967,11 +61023,11 @@ var tags = {
60967
61023
  "typescript": {
60968
61024
  "latest": "7.0.2",
60969
61025
  "beta": "7.1.0-beta",
60970
- "next": "7.1.0-dev.20261116.1"
61026
+ "next": "7.1.0-dev.20261118.1"
60971
61027
  },
60972
61028
  "oxlint": { "latest": "1.94.0" },
60973
61029
  "oxlint-tsgolint": { "latest": "7.0.2007" },
60974
- "tsrs": { "latest": "0.25.0-ts7.1.0-beta" }
61030
+ "tsrs": { "latest": "7.1.0-beta.tsrs3" }
60975
61031
  };
60976
61032
  var components = {
60977
61033
  "typescript": {
@@ -60983,8 +61039,8 @@ var components = {
60983
61039
  "gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a",
60984
61040
  "provider": "typescript"
60985
61041
  },
60986
- "7.1.0-dev.20261116.1": {
60987
- "gitHead": "6bdcb54d23f41bc7098c1f3488ac599c75b852ca",
61042
+ "7.1.0-dev.20261118.1": {
61043
+ "gitHead": "e086ad3b8205668290a81baed890c536047003db",
60988
61044
  "provider": "typescript"
60989
61045
  }
60990
61046
  },
@@ -61008,13 +61064,22 @@ var components = {
61008
61064
  "1.93.0": { "gitHead": "7d8e1f4953a694e9705117f674933925142ed457" },
61009
61065
  "1.94.0": { "gitHead": "229b69bf10a9c876f84287123fdf9d5e0747c96b" }
61010
61066
  },
61011
- "tsrs": { "0.25.0-ts7.1.0-beta": {
61012
- "gitHead": "0f82b670e4ff861840b1315f8610816229e73e3a",
61013
- "typescript": {
61014
- "version": "7.1.0-beta",
61015
- "gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a"
61067
+ "tsrs": {
61068
+ "7.1.0-beta.tsrs2": {
61069
+ "gitHead": "b12862d0636c21a98d53d01c6b29570ef5f604e7",
61070
+ "typescript": {
61071
+ "version": "7.1.0-beta",
61072
+ "gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a"
61073
+ }
61074
+ },
61075
+ "7.1.0-beta.tsrs3": {
61076
+ "gitHead": "eba9b2b796ef5e4a80b793e0b94b72bc7d4a9c05",
61077
+ "typescript": {
61078
+ "version": "7.1.0-beta",
61079
+ "gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a"
61080
+ }
61016
61081
  }
61017
- } }
61082
+ }
61018
61083
  };
61019
61084
 
61020
61085
  //#endregion
@@ -61165,24 +61230,18 @@ const discoverTsrs = (cwdRequire) => gen(function* () {
61165
61230
  binaryPath: path.join(path.dirname(platformPackage.packageJsonPath), tsrsExecutableName(process.platform))
61166
61231
  }];
61167
61232
  });
61168
- const discoverVitePlusOxlint = (cwdRequire) => gen(function* () {
61233
+ const packageScopes = (cwd) => gen(function* () {
61234
+ const path = yield* Path$2;
61235
+ const cwdRequire = node_module.createRequire(path.join(cwd, "noop.js"));
61169
61236
  const vitePlus = yield* optionally(readPackage(cwdRequire, "vite-plus"));
61170
- if (vitePlus === void 0) return [];
61171
- return yield* discoverOxlint(node_module.createRequire(vitePlus.packageJsonPath));
61237
+ return vitePlus === void 0 ? [cwdRequire] : [cwdRequire, node_module.createRequire(vitePlus.packageJsonPath)];
61172
61238
  });
61173
61239
  const discoverBinaries = (cwd, preferredTypescriptPackage) => gen(function* () {
61174
- const path = yield* Path$2;
61175
- const cwdRequire = node_module.createRequire(path.join(cwd, "noop.js"));
61176
- const typescript = yield* discoverTypeScript(cwdRequire, preferredTypescriptPackage);
61177
- const oxlint = yield* discoverOxlint(cwdRequire);
61178
- const vitePlusOxlint = yield* discoverVitePlusOxlint(cwdRequire);
61179
- const tsrs = yield* discoverTsrs(cwdRequire);
61180
- const discovered = [...new Map([
61181
- ...typescript,
61182
- ...oxlint,
61183
- ...vitePlusOxlint,
61184
- ...tsrs
61185
- ].map((binary) => [binary.binaryPath, binary])).values()];
61240
+ const scopes = yield* packageScopes(cwd);
61241
+ const typescript = yield* discoverTypeScript(scopes[0], preferredTypescriptPackage);
61242
+ const scoped = yield* forEach$1(scopes, (require) => zipWith(discoverOxlint(require), discoverTsrs(require), (oxlint, tsrs) => [...oxlint, ...tsrs]));
61243
+ const located = [...typescript, ...scoped.flat()];
61244
+ const discovered = [...new Map(located.map((binary) => [binary.binaryPath, binary])).values()];
61186
61245
  return yield* forEach$1(discovered, (binary) => hashFile(binary.binaryPath).pipe(map$2((fileHash) => ({
61187
61246
  ...binary,
61188
61247
  fileHash
@@ -61495,9 +61554,11 @@ const applyPlan = (plan) => gen(function* () {
61495
61554
  });
61496
61555
  const discoverSelected$1 = (cwd, components, preferredTypescriptPackage) => gen(function* () {
61497
61556
  const discovered = yield* discoverBinaries(cwd, preferredTypescriptPackage);
61498
- const selectedComponents = new Set(components);
61499
- if (selectedComponents.has("oxlint")) selectedComponents.add("oxlint-dts");
61500
- return yield* requireComponents(selectComponents(discovered, selectedComponents), selectedComponents);
61557
+ const required = new Set(components);
61558
+ if (required.has("oxlint")) required.add("oxlint-dts");
61559
+ const selected = new Set(required);
61560
+ if (selected.has("oxlint")) selected.add("oxlint-tsgolint");
61561
+ return yield* requireComponents(selectComponents(discovered, selected), required);
61501
61562
  });
61502
61563
  const changedTargets = (targets, skipped) => {
61503
61564
  const skippedPaths = new Set(skipped.map(({ target }) => target.binaryPath));
@@ -208701,7 +208762,13 @@ const getPatchCommand = (integrations) => {
208701
208762
  const typescript = integrations.includes("typescript");
208702
208763
  const oxlint = integrations.includes("oxlint");
208703
208764
  if (!typescript && !oxlint) return void 0;
208704
- return `effect-tsgo patch ${typescript ? "--typescript" : "--no-typescript"} ${oxlint ? "--oxlint" : "--no-oxlint"}`;
208765
+ return `effect-tsgo patch ${typescript ? "--typescript" : "--no-typescript"} ${oxlint ? "--oxlint" : "--no-oxlint"}${integrations.includes("tsrs") ? " --tsrs" : ""}`;
208766
+ };
208767
+ const vitePlusLintsWithTsrs = (spec) => {
208768
+ const match = /(\d+)\.(\d+)\.(\d+)/.exec(spec);
208769
+ if (match === null) return false;
208770
+ const major = Number(match[1]);
208771
+ return major > 1 || major === 1 && Number(match[2]) >= 7;
208705
208772
  };
208706
208773
  const splitCommands = (script) => {
208707
208774
  const ranges = [];
@@ -208852,7 +208919,8 @@ const updatePatchCommand = (script, integrations) => {
208852
208919
  const whitespaceStart = suffix.slice(0, relativeStart).search(/\s+$/);
208853
208920
  suffix = suffix.slice(0, whitespaceStart < 0 ? relativeStart : whitespaceStart) + suffix.slice(relativeEnd);
208854
208921
  }
208855
- updated = updated.slice(0, match.patchEnd) + flags + suffix + updated.slice(match.end);
208922
+ const matchFlags = /(?:^|\s)--tsrs(?:\s|$)/.test(suffix) ? flags.replace(/ --tsrs$/, "") : flags;
208923
+ updated = updated.slice(0, match.patchEnd) + matchFlags + suffix + updated.slice(match.end);
208856
208924
  }
208857
208925
  return {
208858
208926
  script: updated,
@@ -210318,7 +210386,7 @@ const create = (assessment, context, options) => gen(function* () {
210318
210386
  }) : assessment.packageJson.oxlintTsgolintVersion,
210319
210387
  prepareScript: true,
210320
210388
  managePrepareScript: true,
210321
- integrations
210389
+ integrations: useOxlint && exists$1(assessment.packageJson.vitePlusVersion, (dependency) => vitePlusLintsWithTsrs(dependency.version)) ? [...integrations.filter((integration) => integration !== "tsrs"), "tsrs"] : integrations.filter((integration) => integration !== "tsrs")
210322
210390
  },
210323
210391
  tsconfig: {
210324
210392
  schemaPath: useTypescript ? some(relativeSchemaPath.startsWith(".") ? relativeSchemaPath : `./${relativeSchemaPath}`) : none(),
@@ -210460,6 +210528,13 @@ const integrationFlags = {
210460
210528
  oxlint: Boolean$1("oxlint").pipe(withDefault(false), withDescription$1("Include the experimental Oxlint integration")),
210461
210529
  tsrs: Boolean$1("tsrs").pipe(withDefault(false), withDescription$1("Include the experimental tsrs integration (the installed tsrs package's binary)"))
210462
210530
  };
210531
+ const selectedComponents = (typescript, oxlint, tsrs) => {
210532
+ const components = /* @__PURE__ */ new Set();
210533
+ if (typescript) components.add("typescript");
210534
+ if (oxlint) components.add("oxlint");
210535
+ if (tsrs) components.add("tsrs");
210536
+ return components;
210537
+ };
210463
210538
  const ensureIntegrationSelected = (typescript, oxlint, tsrs = false) => typescript || oxlint || tsrs ? void_$1 : fail$5(new IntegrationSelectionError({ reason: "Select at least one integration to manage." }));
210464
210539
 
210465
210540
  //#endregion
@@ -210598,8 +210673,12 @@ const installedTypescriptVersion = (context) => gen(function* () {
210598
210673
  if (installed !== void 0 && isNativeTypescriptVersion$1(installed.version)) return installed.version;
210599
210674
  }
210600
210675
  });
210601
- const installedTsrsVersion = (context) => gen(function* () {
210602
- return (yield* findInstalledPackage(yield* projectRequire(context), "tsrs").pipe(mapError(toProxyError)))?.version;
210676
+ const installedTsrsVersion = (context, vitePlusFirst = false) => gen(function* () {
210677
+ const scopes = yield* packageScopes(context.cwd).pipe(mapError(toProxyError));
210678
+ for (const require of vitePlusFirst ? [...scopes].reverse() : scopes) {
210679
+ const installed = yield* findInstalledPackage(require, "tsrs").pipe(mapError(toProxyError));
210680
+ if (installed !== void 0) return installed.version;
210681
+ }
210603
210682
  });
210604
210683
  const requireArtifact = (artifactPath) => gen(function* () {
210605
210684
  if (!(yield* (yield* FileSystem).exists(artifactPath).pipe(mapError(toProxyError)))) return yield* new ProxyError({ reason: `Missing packaged artifact ${artifactPath}.` });
@@ -210626,12 +210705,26 @@ const resolveTsc = (context, invocation) => gen(function* () {
210626
210705
  };
210627
210706
  });
210628
210707
  const packagedTsrs = (context, requested) => gen(function* () {
210708
+ return yield* packagedTsrsBuild(context, yield* selectVersion("tsrs", "tsrs", requested, requested === void 0 ? yield* installedTsrsVersion(context) : void 0));
210709
+ });
210710
+ const packagedInstalledTsrs = (context, version) => gen(function* () {
210711
+ const versions = supportedVersions("tsrs");
210712
+ if (!versions.includes(version)) return yield* new UnsupportedProxyVersionError({
210713
+ packageName: "tsrs",
210714
+ version,
210715
+ source: "installed",
210716
+ supportedVersions: versions,
210717
+ tags: {}
210718
+ });
210719
+ return yield* packagedTsrsBuild(context, version);
210720
+ });
210721
+ const packagedTsrsBuild = (context, version) => gen(function* () {
210629
210722
  const fs = yield* FileSystem;
210630
210723
  const path = yield* Path$2;
210631
210724
  if (context.platform === "linux" && !context.isGlibc()) return yield* new ProxyError({ reason: `Linux musl is not supported by the packaged tsrs integration; it is built for ${tsrsReplacementTargets.join(", ")}.` });
210632
210725
  const target = tsrsTarget(context.platform, context.arch, true);
210633
210726
  if (target === void 0 || !tsrsReplacementTargets.includes(target)) return yield* new ProxyError({ reason: `The packaged tsrs integration is not available for ${context.platform}-${context.arch}; it is built for ${tsrsReplacementTargets.join(", ")}.` });
210634
- const executable = yield* requireArtifact(yield* tsrsExecutable(context, yield* selectVersion("tsrs", "tsrs", requested, requested === void 0 ? yield* installedTsrsVersion(context) : void 0)));
210727
+ const executable = yield* requireArtifact(yield* tsrsExecutable(context, version));
210635
210728
  const libraryPath = path.join(path.dirname(executable), "lib.d.ts");
210636
210729
  if (!(yield* fs.exists(libraryPath).pipe(mapError(toProxyError)))) return yield* new ProxyError({ reason: `Missing ${libraryPath}: tsrs needs its lib*.d.ts files next to the packaged binary ${executable}. Reinstall @effect/tsgo-${context.platform}-${context.arch}.` });
210637
210730
  yield* ensureExecutable(executable, context.platform);
@@ -210646,12 +210739,8 @@ const resolveTsrs = (context, invocation) => gen(function* () {
210646
210739
  };
210647
210740
  });
210648
210741
  const findOxlintInstallation = (cwd) => gen(function* () {
210649
- const path = yield* Path$2;
210650
210742
  const find = (require, packageName) => findInstalledPackage(require, packageName).pipe(mapError(toProxyError));
210651
- const cwdRequire = node_module.createRequire(path.join(cwd, "noop.js"));
210652
- const vitePlus = yield* find(cwdRequire, "vite-plus");
210653
- const scopes = [cwdRequire, ...vitePlus === void 0 ? [] : [node_module.createRequire(vitePlus.packageJsonPath)]];
210654
- for (const require of scopes) {
210743
+ for (const require of yield* packageScopes(cwd).pipe(mapError(toProxyError))) {
210655
210744
  const oxlint = yield* find(require, "oxlint");
210656
210745
  if (oxlint !== void 0) return {
210657
210746
  oxlint,
@@ -210693,15 +210782,22 @@ const packagedTsrsLint = (context, selection) => gen(function* () {
210693
210782
  executable: yield* packagedTsrs(context, selection.version)
210694
210783
  };
210695
210784
  });
210696
- const oxlintArtifacts = (context, installation, tsrsLint) => gen(function* () {
210785
+ const oxlintArtifacts = (context, installation, tsrsLint, installedTsrs = void 0) => gen(function* () {
210697
210786
  const target = yield* try_({
210698
210787
  try: () => experimentalOxlintTarget(context.platform, context.arch, context.platform === "linux" && context.isGlibc()),
210699
210788
  catch: (error) => new ProxyError({ reason: error instanceof Error ? error.message : String(error) })
210700
210789
  });
210701
210790
  const oxlintVersion = yield* supportedInstalledVersion("oxlint", installation.oxlint);
210791
+ const binding = yield* requireArtifact(yield* packagedComponentPath(context.packageDirectory, "oxlint", oxlintVersion, target.oxlintBinding));
210792
+ const tsrsIsLinter = tsrsLint === void 0 && installation.tsgolint === void 0 && installedTsrs !== void 0;
210793
+ const tsrsBinary = installedTsrs === void 0 ? void 0 : tsrsIsLinter ? yield* packagedInstalledTsrs(context, installedTsrs) : yield* packagedInstalledTsrs(context, installedTsrs).pipe(orElseSucceed(() => void 0));
210702
210794
  return {
210703
- binding: yield* requireArtifact(yield* packagedComponentPath(context.packageDirectory, "oxlint", oxlintVersion, target.oxlintBinding)),
210704
- linter: tsrsLint === void 0 ? yield* packagedTsgolint(context, installation, target) : yield* packagedTsrsLint(context, tsrsLint)
210795
+ binding,
210796
+ linter: tsrsLint !== void 0 ? yield* packagedTsrsLint(context, tsrsLint) : tsrsIsLinter ? {
210797
+ kind: "tsrs",
210798
+ executable: tsrsBinary
210799
+ } : yield* packagedTsgolint(context, installation, target),
210800
+ tsrsBinary
210705
210801
  };
210706
210802
  });
210707
210803
  const preloadPath = (bridge, platform) => {
@@ -210724,11 +210820,12 @@ const oxlintBridgeEnv = (context, artifacts) => gen(function* () {
210724
210820
  ...linterEnv(context.env, artifacts.linter),
210725
210821
  NODE_OPTIONS: prependOption(context.env.NODE_OPTIONS, `--require "${preload}"`, preload),
210726
210822
  BUN_OPTIONS: prependOption(context.env.BUN_OPTIONS, `"--preload=${preload}"`, preload),
210727
- EFFECT_TSGO_OXLINT_BINDING: artifacts.binding
210823
+ EFFECT_TSGO_OXLINT_BINDING: artifacts.binding,
210824
+ ...artifacts.tsrsBinary === void 0 ? {} : { TSRS_BINARY: artifacts.tsrsBinary }
210728
210825
  };
210729
210826
  });
210730
210827
  const oxlintCommand = (context, args, installation, tsrsLint = void 0) => gen(function* () {
210731
- const artifacts = yield* oxlintArtifacts(context, installation, tsrsLint);
210828
+ const artifacts = yield* oxlintArtifacts(context, installation, tsrsLint, yield* installedTsrsVersion(context));
210732
210829
  return {
210733
210830
  file: context.execPath,
210734
210831
  args: [yield* oxlintBinPath(installation.oxlint), ...args],
@@ -210753,7 +210850,7 @@ const resolveVitePlus = (context, invocation) => gen(function* () {
210753
210850
  if (vitePlus === void 0) return yield* new ProxyError({ reason: `Unable to resolve vite-plus from ${context.cwd}. Install vite-plus in the project.` });
210754
210851
  const installation = yield* findOxlintInstallation(context.cwd);
210755
210852
  if (installation === void 0) return yield* new ProxyError({ reason: `Unable to resolve the oxlint package of vite-plus from ${context.cwd}.` });
210756
- const artifacts = yield* oxlintArtifacts(context, installation, invocation.tsrsLint);
210853
+ const artifacts = yield* oxlintArtifacts(context, installation, invocation.tsrsLint, yield* installedTsrsVersion(context, true));
210757
210854
  return {
210758
210855
  file: context.execPath,
210759
210856
  args: [yield* packageBinPath(vitePlus, "vp"), ...invocation.args],
@@ -211073,16 +211170,6 @@ var ChmodBinaryError = class extends TaggedError$1("ChmodBinaryError") {
211073
211170
  return `Failed to set executable permissions on ${this.targetPath}.`;
211074
211171
  }
211075
211172
  };
211076
- const selectedComponents = (typescript, oxlint, tsrs) => {
211077
- const components = /* @__PURE__ */ new Set();
211078
- if (typescript) components.add("typescript");
211079
- if (oxlint) {
211080
- components.add("oxlint");
211081
- components.add("oxlint-tsgolint");
211082
- }
211083
- if (tsrs) components.add("tsrs");
211084
- return components;
211085
- };
211086
211173
  const discoverSelected = (components, preferredTypescriptPackage) => gen(function* () {
211087
211174
  return yield* requireComponents(selectComponents(yield* discoverBinaries(process.cwd(), preferredTypescriptPackage), components), components);
211088
211175
  });
@@ -31,6 +31,8 @@
31
31
  "effecttsgo/prefer-effect-string": "warn",
32
32
  "effecttsgo/process-env": "warn",
33
33
  "effecttsgo/process-env-in-effect": "warn",
34
+ "effecttsgo/promise-all-in-effect": "warn",
35
+ "effecttsgo/promise-race-in-effect": "warn",
34
36
  "effecttsgo/schema-sync": "warn"
35
37
  }
36
38
  }
@@ -102,6 +102,8 @@ export const effectNative = {
102
102
  "effecttsgo/prefer-effect-string": "warn",
103
103
  "effecttsgo/process-env": "warn",
104
104
  "effecttsgo/process-env-in-effect": "warn",
105
+ "effecttsgo/promise-all-in-effect": "warn",
106
+ "effecttsgo/promise-race-in-effect": "warn",
105
107
  "effecttsgo/schema-sync": "warn"
106
108
  }
107
109
  }
@@ -159,6 +161,7 @@ export const recommended = {
159
161
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "warn",
160
162
  "effecttsgo/flat-map-identity-to-flatten": "warn",
161
163
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
164
+ "effecttsgo/flat-map-map-to-zip-with": "warn",
162
165
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "warn",
163
166
  "effecttsgo/flat-map-to-map": "warn",
164
167
  "effecttsgo/flat-map-to-tap": "warn",
@@ -269,6 +272,7 @@ export const strict = {
269
272
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "error",
270
273
  "effecttsgo/flat-map-identity-to-flatten": "error",
271
274
  "effecttsgo/flat-map-ignored-param-to-and-then": "error",
275
+ "effecttsgo/flat-map-map-to-zip-with": "error",
272
276
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "error",
273
277
  "effecttsgo/flat-map-to-map": "error",
274
278
  "effecttsgo/flat-map-to-tap": "error",
@@ -370,6 +374,7 @@ export const style = {
370
374
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "warn",
371
375
  "effecttsgo/flat-map-identity-to-flatten": "warn",
372
376
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
377
+ "effecttsgo/flat-map-map-to-zip-with": "warn",
373
378
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "warn",
374
379
  "effecttsgo/flat-map-to-map": "warn",
375
380
  "effecttsgo/flat-map-to-tap": "warn",
@@ -39,6 +39,7 @@
39
39
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "warn",
40
40
  "effecttsgo/flat-map-identity-to-flatten": "warn",
41
41
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
42
+ "effecttsgo/flat-map-map-to-zip-with": "warn",
42
43
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "warn",
43
44
  "effecttsgo/flat-map-to-map": "warn",
44
45
  "effecttsgo/flat-map-to-tap": "warn",
@@ -39,6 +39,7 @@
39
39
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "error",
40
40
  "effecttsgo/flat-map-identity-to-flatten": "error",
41
41
  "effecttsgo/flat-map-ignored-param-to-and-then": "error",
42
+ "effecttsgo/flat-map-map-to-zip-with": "error",
42
43
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "error",
43
44
  "effecttsgo/flat-map-to-map": "error",
44
45
  "effecttsgo/flat-map-to-tap": "error",
@@ -30,6 +30,7 @@
30
30
  "effecttsgo/flat-map-conditional-to-filter-or-fail": "warn",
31
31
  "effecttsgo/flat-map-identity-to-flatten": "warn",
32
32
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
33
+ "effecttsgo/flat-map-map-to-zip-with": "warn",
33
34
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": "warn",
34
35
  "effecttsgo/flat-map-to-map": "warn",
35
36
  "effecttsgo/flat-map-to-tap": "warn",
@@ -2425,6 +2425,9 @@
2425
2425
  "effecttsgo/flat-map-ignored-param-to-and-then": {
2426
2426
  "$ref": "#/definitions/RuleNoConfig"
2427
2427
  },
2428
+ "effecttsgo/flat-map-map-to-zip-with": {
2429
+ "$ref": "#/definitions/RuleNoConfig"
2430
+ },
2428
2431
  "effecttsgo/flat-map-provide-service-to-provide-service-effect": {
2429
2432
  "$ref": "#/definitions/RuleNoConfig"
2430
2433
  },
@@ -2635,9 +2638,15 @@
2635
2638
  "effecttsgo/process-env-in-effect": {
2636
2639
  "$ref": "#/definitions/RuleNoConfig"
2637
2640
  },
2641
+ "effecttsgo/promise-all-in-effect": {
2642
+ "$ref": "#/definitions/RuleNoConfig"
2643
+ },
2638
2644
  "effecttsgo/promise-in-effect-success": {
2639
2645
  "$ref": "#/definitions/RuleNoConfig"
2640
2646
  },
2647
+ "effecttsgo/promise-race-in-effect": {
2648
+ "$ref": "#/definitions/RuleNoConfig"
2649
+ },
2641
2650
  "effecttsgo/provide-layer-succeed-to-provide-service": {
2642
2651
  "$ref": "#/definitions/RuleNoConfig"
2643
2652
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/tsgo",
3
- "version": "0.70.0",
3
+ "version": "0.73.2",
4
4
  "type": "module",
5
5
  "description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
6
6
  "license": "MIT",
@@ -42,13 +42,13 @@
42
42
  "schema.json"
43
43
  ],
44
44
  "optionalDependencies": {
45
- "@effect/tsgo-win32-x64": "0.70.0",
46
- "@effect/tsgo-win32-arm64": "0.70.0",
47
- "@effect/tsgo-linux-x64": "0.70.0",
48
- "@effect/tsgo-linux-arm64": "0.70.0",
49
- "@effect/tsgo-linux-arm": "0.70.0",
50
- "@effect/tsgo-darwin-x64": "0.70.0",
51
- "@effect/tsgo-darwin-arm64": "0.70.0"
45
+ "@effect/tsgo-win32-x64": "0.73.2",
46
+ "@effect/tsgo-win32-arm64": "0.73.2",
47
+ "@effect/tsgo-linux-x64": "0.73.2",
48
+ "@effect/tsgo-linux-arm64": "0.73.2",
49
+ "@effect/tsgo-linux-arm": "0.73.2",
50
+ "@effect/tsgo-darwin-x64": "0.73.2",
51
+ "@effect/tsgo-darwin-arm64": "0.73.2"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@effect/platform-node": "^4.1.2",
package/schema.json CHANGED
@@ -39,6 +39,9 @@
39
39
  "$ref": "#/definitions/referencesDefinition"
40
40
  }
41
41
  ]
42
+ },
43
+ {
44
+ "$ref": "#/definitions/referencesDefinition"
42
45
  }
43
46
  ],
44
47
  "allowTrailingCommas": true,
@@ -2571,6 +2574,11 @@
2571
2574
  "default": "suggestion",
2572
2575
  "description": "Suggests using Effect.andThen instead of Effect.flatMap when a zero-parameter callback returns an existing Effect value"
2573
2576
  },
2577
+ "flatMapMapToZipWith": {
2578
+ "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2579
+ "default": "suggestion",
2580
+ "description": "Suggests Effect.zipWith when Effect.flatMap only maps an independent effect with its parameter"
2581
+ },
2574
2582
  "flatMapProvideServiceToProvideServiceEffect": {
2575
2583
  "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2576
2584
  "default": "suggestion",
@@ -2921,11 +2929,21 @@
2921
2929
  "default": "off",
2922
2930
  "description": "Warns when reading process.env inside Effect generators instead of using Effect Config"
2923
2931
  },
2932
+ "promiseAllInEffect": {
2933
+ "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2934
+ "default": "off",
2935
+ "description": "Warns when Promise.all or Promise.allSettled fans out over an array inside Effect code instead of Effect.forEach or Effect.all with a concurrency option"
2936
+ },
2924
2937
  "promiseInEffectSuccess": {
2925
2938
  "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2926
2939
  "default": "warning",
2927
2940
  "description": "Detects Promise types in Effect success channels where they are not awaited"
2928
2941
  },
2942
+ "promiseRaceInEffect": {
2943
+ "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2944
+ "default": "off",
2945
+ "description": "Warns when Promise.race or Promise.any races a list of promises inside Effect code, leaving the losing promises running"
2946
+ },
2929
2947
  "provideLayerSucceedToProvideService": {
2930
2948
  "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2931
2949
  "default": "suggestion",
@@ -3624,6 +3642,9 @@
3624
3642
  "type": "string"
3625
3643
  }
3626
3644
  },
3645
+ "required": [
3646
+ "path"
3647
+ ],
3627
3648
  "type": "object"
3628
3649
  },
3629
3650
  "markdownDescription": "Referenced projects. Requires TypeScript version 3.0 or later.\n\n---\n\nProject references are a way to structure your TypeScript programs into smaller pieces.\nUsing Project References can greatly improve build and editor interaction times, enforce logical separation between components, and organize your code in new and improved ways.\n\nYou can read more about how references works in the [Project References](https://typescriptlang.org/docs/handbook/project-references.html) section of the handbook",