@effect/tsgo 0.61.0 → 0.62.0

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
@@ -6,13 +6,13 @@ This project targets **Effect V4** (codename: "smol") primarily and also Effect
6
6
  <!-- supported-components:start -->
7
7
  ## Supported Package Versions
8
8
 
9
- The following target package versions are supported by `@effect/tsgo@0.61.0`:
9
+ The following target package versions are supported by `@effect/tsgo@0.62.0`:
10
10
 
11
11
  | Component | Supported versions |
12
12
  |---|---|
13
- | TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261026.1` |
13
+ | TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261027.1` |
14
14
  | tsrs | `0.20.0-ts7.1.0-beta` |
15
- | Oxlint | `1.87.0`, `1.88.0`, `1.89.0` |
15
+ | Oxlint | `1.88.0`, `1.89.0`, `1.90.0` |
16
16
  | oxlint-tsgolint | `7.0.2004`, `7.0.2005` |
17
17
  <!-- supported-components:end -->
18
18
 
@@ -177,6 +177,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
177
177
  <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>
178
178
  <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>
179
179
  <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>
180
+ <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/map-const-to-as.md"><code>mapConstToAs</code></a></td><td>Suggests using Effect.as instead of Effect.map when the callback ignores its input and returns a constant</td></tr>
180
181
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/map-some-to-as-some.md"><code>mapSomeToAsSome</code></a></td><td>Suggests using Effect.asSome instead of Effect.map when the mapper only wraps the success value with Option.some</td></tr>
181
182
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/match-effect-to-map-both.md"><code>matchEffectToMapBoth</code></a></td><td>Suggests Effect.mapBoth when Effect.matchEffect only transforms the failure and success channels</td></tr>
182
183
  <tr><td><a href="https://github.com/Effect-TS/tsgo/blob/main/docs/rules/match-effect-to-match.md"><code>matchEffectToMatch</code></a></td><td>Suggests Effect.match or Effect.matchCause when both Effect.matchEffect handlers only return Effect.succeed</td></tr>
@@ -52769,7 +52769,7 @@ const runWith = (command, config) => {
52769
52769
  //#endregion
52770
52770
  //#region package.json
52771
52771
  var name = "@effect/tsgo";
52772
- var version = "0.61.0";
52772
+ var version = "0.62.0";
52773
52773
 
52774
52774
  //#endregion
52775
52775
  //#region src/metadata.json
@@ -52847,6 +52847,7 @@ var presets$1 = [
52847
52847
  "lazyEffect": "suggestion",
52848
52848
  "lazyPromiseInEffectSync": "warning",
52849
52849
  "leakingRequirements": "suggestion",
52850
+ "mapConstToAs": "suggestion",
52850
52851
  "mapSomeToAsSome": "suggestion",
52851
52852
  "matchEffectToMapBoth": "suggestion",
52852
52853
  "matchEffectToMatch": "suggestion",
@@ -52941,6 +52942,7 @@ var presets$1 = [
52941
52942
  "lazyEffect": "error",
52942
52943
  "lazyPromiseInEffectSync": "error",
52943
52944
  "leakingRequirements": "error",
52945
+ "mapConstToAs": "error",
52944
52946
  "mapSomeToAsSome": "error",
52945
52947
  "matchEffectToMapBoth": "error",
52946
52948
  "matchEffectToMatch": "error",
@@ -53106,6 +53108,7 @@ var presets$1 = [
53106
53108
  "flatMapIgnoredParamToAndThen": "warning",
53107
53109
  "flatMapToMap": "warning",
53108
53110
  "flatMapToTap": "warning",
53111
+ "mapConstToAs": "warning",
53109
53112
  "mapSomeToAsSome": "warning",
53110
53113
  "matchEffectToMapBoth": "warning",
53111
53114
  "matchEffectToMatch": "warning",
@@ -54789,6 +54792,23 @@ var rules = [
54789
54792
  }]
54790
54793
  }
54791
54794
  },
54795
+ {
54796
+ "name": "mapConstToAs",
54797
+ "group": "style",
54798
+ "description": "Suggests using Effect.as instead of Effect.map when the callback ignores its input and returns a constant",
54799
+ "defaultSeverity": "suggestion",
54800
+ "fixable": true,
54801
+ "supportedEffect": ["v3", "v4"],
54802
+ "codes": [377152],
54803
+ "preview": {
54804
+ "sourceText": "import { Effect } from \"effect\"\n\nconst saveUser = (name: string): Effect.Effect<number> => Effect.succeed(name.length)\n\nexport const saved = saveUser(\"alice\").pipe(Effect.map(() => \"saved\"))\n",
54805
+ "diagnostics": [{
54806
+ "start": 164,
54807
+ "end": 174,
54808
+ "text": "`Effect.as` expresses replacing the success value with a constant directly. effect(mapConstToAs)"
54809
+ }]
54810
+ }
54811
+ },
54792
54812
  {
54793
54813
  "name": "mapSomeToAsSome",
54794
54814
  "group": "style",
@@ -55442,9 +55462,9 @@ var tags = {
55442
55462
  "typescript": {
55443
55463
  "latest": "7.0.2",
55444
55464
  "beta": "7.1.0-beta",
55445
- "next": "7.1.0-dev.20261026.1"
55465
+ "next": "7.1.0-dev.20261027.1"
55446
55466
  },
55447
- "oxlint": { "latest": "1.89.0" },
55467
+ "oxlint": { "latest": "1.90.0" },
55448
55468
  "oxlint-tsgolint": { "latest": "7.0.2005" },
55449
55469
  "tsrs": { "latest": "0.20.0-ts7.1.0-beta" }
55450
55470
  };
@@ -55458,8 +55478,8 @@ var components = {
55458
55478
  "gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a",
55459
55479
  "provider": "typescript"
55460
55480
  },
55461
- "7.1.0-dev.20261026.1": {
55462
- "gitHead": "8a62bbe746909624b69b6e671026b454da2f02cf",
55481
+ "7.1.0-dev.20261027.1": {
55482
+ "gitHead": "49e69830214c55a8cc361aa3c4e7412d0afd02fe",
55463
55483
  "provider": "typescript"
55464
55484
  }
55465
55485
  },
@@ -55474,9 +55494,9 @@ var components = {
55474
55494
  }
55475
55495
  },
55476
55496
  "oxlint": {
55477
- "1.87.0": { "gitHead": "2bd08ebe8f36fcf1954a675ffdeb4c6d0129f609" },
55478
55497
  "1.88.0": { "gitHead": "6941b4ed45ead21c45bc2164cb80a180eed85b43" },
55479
- "1.89.0": { "gitHead": "07ed78f4abde4020ca7919381ffea4da8616b78a" }
55498
+ "1.89.0": { "gitHead": "07ed78f4abde4020ca7919381ffea4da8616b78a" },
55499
+ "1.90.0": { "gitHead": "9b6fff42fa6edf0bec55861b6f0764c7b9acd86b" }
55480
55500
  },
55481
55501
  "tsrs": { "0.20.0-ts7.1.0-beta": {
55482
55502
  "gitHead": "d197eeea709616d61930c2bd5eac048471e404b8",
@@ -166,6 +166,7 @@ export const recommended = {
166
166
  "effecttsgo/lazy-effect": "warn",
167
167
  "effecttsgo/lazy-promise-in-effect-sync": "warn",
168
168
  "effecttsgo/leaking-requirements": "warn",
169
+ "effecttsgo/map-const-to-as": "warn",
169
170
  "effecttsgo/map-some-to-as-some": "warn",
170
171
  "effecttsgo/match-effect-to-map-both": "warn",
171
172
  "effecttsgo/match-effect-to-match": "warn",
@@ -265,6 +266,7 @@ export const strict = {
265
266
  "effecttsgo/lazy-effect": "error",
266
267
  "effecttsgo/lazy-promise-in-effect-sync": "error",
267
268
  "effecttsgo/leaking-requirements": "error",
269
+ "effecttsgo/map-const-to-as": "error",
268
270
  "effecttsgo/map-some-to-as-some": "error",
269
271
  "effecttsgo/match-effect-to-map-both": "error",
270
272
  "effecttsgo/match-effect-to-match": "error",
@@ -346,6 +348,7 @@ export const style = {
346
348
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
347
349
  "effecttsgo/flat-map-to-map": "warn",
348
350
  "effecttsgo/flat-map-to-tap": "warn",
351
+ "effecttsgo/map-const-to-as": "warn",
349
352
  "effecttsgo/map-some-to-as-some": "warn",
350
353
  "effecttsgo/match-effect-to-map-both": "warn",
351
354
  "effecttsgo/match-effect-to-match": "warn",
@@ -48,6 +48,7 @@
48
48
  "effecttsgo/lazy-effect": "warn",
49
49
  "effecttsgo/lazy-promise-in-effect-sync": "warn",
50
50
  "effecttsgo/leaking-requirements": "warn",
51
+ "effecttsgo/map-const-to-as": "warn",
51
52
  "effecttsgo/map-some-to-as-some": "warn",
52
53
  "effecttsgo/match-effect-to-map-both": "warn",
53
54
  "effecttsgo/match-effect-to-match": "warn",
@@ -48,6 +48,7 @@
48
48
  "effecttsgo/lazy-effect": "error",
49
49
  "effecttsgo/lazy-promise-in-effect-sync": "error",
50
50
  "effecttsgo/leaking-requirements": "error",
51
+ "effecttsgo/map-const-to-as": "error",
51
52
  "effecttsgo/map-some-to-as-some": "error",
52
53
  "effecttsgo/match-effect-to-map-both": "error",
53
54
  "effecttsgo/match-effect-to-match": "error",
@@ -30,6 +30,7 @@
30
30
  "effecttsgo/flat-map-ignored-param-to-and-then": "warn",
31
31
  "effecttsgo/flat-map-to-map": "warn",
32
32
  "effecttsgo/flat-map-to-tap": "warn",
33
+ "effecttsgo/map-const-to-as": "warn",
33
34
  "effecttsgo/map-some-to-as-some": "warn",
34
35
  "effecttsgo/match-effect-to-map-both": "warn",
35
36
  "effecttsgo/match-effect-to-match": "warn",
@@ -837,6 +837,18 @@
837
837
  },
838
838
  "type": "object"
839
839
  },
840
+ "AwaitThenableConfig": {
841
+ "additionalProperties": false,
842
+ "properties": {
843
+ "allowMixedPromiseArrays": {
844
+ "default": false,
845
+ "description": "Allow Promise aggregators such as `Promise.all` to receive mixed arrays or\niterables containing at least one potentially Promise-like value.\nInputs containing only synchronous values are still reported.",
846
+ "markdownDescription": "Allow Promise aggregators such as `Promise.all` to receive mixed arrays or\niterables containing at least one potentially Promise-like value.\nInputs containing only synchronous values are still reported.",
847
+ "type": "boolean"
848
+ }
849
+ },
850
+ "type": "object"
851
+ },
840
852
  "BanConfigValue": {
841
853
  "anyOf": [
842
854
  {
@@ -2416,6 +2428,9 @@
2416
2428
  "effecttsgo/leaking-requirements": {
2417
2429
  "$ref": "#/definitions/RuleNoConfig"
2418
2430
  },
2431
+ "effecttsgo/map-const-to-as": {
2432
+ "$ref": "#/definitions/RuleNoConfig"
2433
+ },
2419
2434
  "effecttsgo/map-some-to-as-some": {
2420
2435
  "$ref": "#/definitions/RuleNoConfig"
2421
2436
  },
@@ -7800,7 +7815,24 @@
7800
7815
  ]
7801
7816
  },
7802
7817
  "typescript/await-thenable": {
7803
- "$ref": "#/definitions/RuleNoConfig"
7818
+ "anyOf": [
7819
+ {
7820
+ "$ref": "#/definitions/RuleNoConfig"
7821
+ },
7822
+ {
7823
+ "items": [
7824
+ {
7825
+ "$ref": "#/definitions/AllowWarnDeny"
7826
+ },
7827
+ {
7828
+ "$ref": "#/definitions/AwaitThenableConfig"
7829
+ }
7830
+ ],
7831
+ "maxItems": 2,
7832
+ "minItems": 2,
7833
+ "type": "array"
7834
+ }
7835
+ ]
7804
7836
  },
7805
7837
  "typescript/ban-ts-comment": {
7806
7838
  "anyOf": [
@@ -8586,6 +8618,9 @@
8586
8618
  "typescript/no-unsafe-declaration-merging": {
8587
8619
  "$ref": "#/definitions/RuleNoConfig"
8588
8620
  },
8621
+ "typescript/no-unsafe-enum-assignment": {
8622
+ "$ref": "#/definitions/RuleNoConfig"
8623
+ },
8589
8624
  "typescript/no-unsafe-enum-comparison": {
8590
8625
  "$ref": "#/definitions/RuleNoConfig"
8591
8626
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/tsgo",
3
- "version": "0.61.0",
3
+ "version": "0.62.0",
4
4
  "type": "module",
5
5
  "description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
6
6
  "license": "MIT",
@@ -41,13 +41,13 @@
41
41
  "schema.json"
42
42
  ],
43
43
  "optionalDependencies": {
44
- "@effect/tsgo-win32-x64": "0.61.0",
45
- "@effect/tsgo-win32-arm64": "0.61.0",
46
- "@effect/tsgo-linux-x64": "0.61.0",
47
- "@effect/tsgo-linux-arm64": "0.61.0",
48
- "@effect/tsgo-linux-arm": "0.61.0",
49
- "@effect/tsgo-darwin-x64": "0.61.0",
50
- "@effect/tsgo-darwin-arm64": "0.61.0"
44
+ "@effect/tsgo-win32-arm64": "0.62.0",
45
+ "@effect/tsgo-win32-x64": "0.62.0",
46
+ "@effect/tsgo-linux-x64": "0.62.0",
47
+ "@effect/tsgo-linux-arm64": "0.62.0",
48
+ "@effect/tsgo-linux-arm": "0.62.0",
49
+ "@effect/tsgo-darwin-x64": "0.62.0",
50
+ "@effect/tsgo-darwin-arm64": "0.62.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@effect/platform-node": "^4.0.2",
package/schema.json CHANGED
@@ -2644,6 +2644,11 @@
2644
2644
  "default": "suggestion",
2645
2645
  "description": "Detects implementation services leaked in service methods"
2646
2646
  },
2647
+ "mapConstToAs": {
2648
+ "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2649
+ "default": "suggestion",
2650
+ "description": "Suggests using Effect.as instead of Effect.map when the callback ignores its input and returns a constant"
2651
+ },
2647
2652
  "mapSomeToAsSome": {
2648
2653
  "$ref": "#/definitions/effectLanguageServicePluginSeverityDefinition",
2649
2654
  "default": "suggestion",