@effect/tsgo 0.7.5 → 0.9.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
@@ -58,6 +58,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
58
58
  <tr><td><code>globalErrorInEffectCatch</code></td><td>⚠️</td><td></td><td>Warns when catch callbacks return global Error type instead of typed errors</td><td>✓</td><td>✓</td></tr>
59
59
  <tr><td><code>globalErrorInEffectFailure</code></td><td>⚠️</td><td></td><td>Warns when the global Error type is used in an Effect failure channel</td><td>✓</td><td>✓</td></tr>
60
60
  <tr><td><code>layerMergeAllWithDependencies</code></td><td>⚠️</td><td>🔧</td><td>Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires</td><td>✓</td><td>✓</td></tr>
61
+ <tr><td><code>lazyEffect</code></td><td>💡</td><td></td><td>Suggests avoiding exported zero-argument functions and service members that lazily return Effect or Stream values</td><td></td><td>✓</td></tr>
61
62
  <tr><td><code>lazyPromiseInEffectSync</code></td><td>⚠️</td><td></td><td>Warns when Effect.sync lazily returns a Promise instead of using an async Effect constructor</td><td>✓</td><td>✓</td></tr>
62
63
  <tr><td><code>leakingRequirements</code></td><td>💡</td><td></td><td>Detects implementation services leaked in service methods</td><td>✓</td><td>✓</td></tr>
63
64
  <tr><td><code>multipleEffectProvide</code></td><td>⚠️</td><td>🔧</td><td>Warns against chaining Effect.provide calls which can cause service lifecycle issues</td><td>✓</td><td>✓</td></tr>
@@ -86,7 +87,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
86
87
  <tr><td><code>instanceOfSchema</code></td><td>➖</td><td>🔧</td><td>Suggests using Schema.is instead of instanceof for Effect Schema types</td><td>✓</td><td>✓</td></tr>
87
88
  <tr><td><code>newPromise</code></td><td>➖</td><td></td><td>Warns when constructing promises with new Promise instead of using Effect APIs</td><td>✓</td><td>✓</td></tr>
88
89
  <tr><td><code>nodeBuiltinImport</code></td><td>➖</td><td></td><td>Warns when importing Node.js built-in modules that have Effect-native counterparts</td><td>✓</td><td>✓</td></tr>
89
- <tr><td><code>preferSchemaOverJson</code></td><td>💡</td><td></td><td>Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify</td><td>✓</td><td>✓</td></tr>
90
+ <tr><td><code>preferSchemaOverJson</code></td><td>➖</td><td></td><td>Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify</td><td>✓</td><td>✓</td></tr>
90
91
  <tr><td><code>processEnv</code></td><td>➖</td><td></td><td>Warns when reading process.env outside Effect generators instead of using Effect Config</td><td>✓</td><td>✓</td></tr>
91
92
  <tr><td><code>processEnvInEffect</code></td><td>➖</td><td></td><td>Warns when reading process.env inside Effect generators instead of using Effect Config</td><td>✓</td><td>✓</td></tr>
92
93
  <tr><td><code>unsafeEffectTypeAssertion</code></td><td>➖</td><td>🔧</td><td>Detects unsafe type assertions that narrow Effect, Stream, or Layer error or requirements channels</td><td>✓</td><td>✓</td></tr>
@@ -112,6 +113,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
112
113
  <tr><td><code>unnecessaryFailYieldableError</code></td><td>💡</td><td>🔧</td><td>Suggests yielding yieldable errors directly instead of wrapping with Effect.fail</td><td>✓</td><td>✓</td></tr>
113
114
  <tr><td><code>unnecessaryPipe</code></td><td>💡</td><td>🔧</td><td>Removes pipe calls with no arguments</td><td>✓</td><td>✓</td></tr>
114
115
  <tr><td><code>unnecessaryPipeChain</code></td><td>💡</td><td>🔧</td><td>Simplifies chained pipe calls into a single pipe call</td><td>✓</td><td>✓</td></tr>
116
+ <tr><td><code>unnecessaryTypeofType</code></td><td>💡</td><td>🔧</td><td>Suggests replacing typeof Schema.Type style annotations with the matching named type when available</td><td>✓</td><td>✓</td></tr>
115
117
  </tbody>
116
118
  </table>
117
119
 
@@ -199259,7 +199259,7 @@ var FileReadError = class extends TaggedError("FileReadError") {
199259
199259
  //#endregion
199260
199260
  //#region package.json
199261
199261
  var name = "@effect/tsgo";
199262
- var version = "0.7.5";
199262
+ var version = "0.9.0";
199263
199263
 
199264
199264
  //#endregion
199265
199265
  //#region src/setup/consts.ts
@@ -200503,6 +200503,23 @@ var rules = [
200503
200503
  }]
200504
200504
  }
200505
200505
  },
200506
+ {
200507
+ "name": "lazyEffect",
200508
+ "group": "antipattern",
200509
+ "description": "Suggests avoiding exported zero-argument functions and service members that lazily return Effect or Stream values",
200510
+ "defaultSeverity": "suggestion",
200511
+ "fixable": false,
200512
+ "supportedEffect": ["v4"],
200513
+ "codes": [377091],
200514
+ "preview": {
200515
+ "sourceText": "import { Effect } from \"effect\"\n\nexport interface PreviewService {\n preview: () => Effect.Effect<void>\n}\n",
200516
+ "diagnostics": [{
200517
+ "start": 69,
200518
+ "end": 76,
200519
+ "text": "Interface 'PreviewService' member 'preview' returns a lazy Effect or Stream. Effect and Stream are already lazy, so wrapping them in a zero-argument function adds unnecessary indirection. effect(lazyEffect)"
200520
+ }]
200521
+ }
200522
+ },
200506
200523
  {
200507
200524
  "name": "lazyPromiseInEffectSync",
200508
200525
  "group": "antipattern",
@@ -200970,7 +200987,7 @@ var rules = [
200970
200987
  "name": "preferSchemaOverJson",
200971
200988
  "group": "effectNative",
200972
200989
  "description": "Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify",
200973
- "defaultSeverity": "suggestion",
200990
+ "defaultSeverity": "off",
200974
200991
  "fixable": false,
200975
200992
  "supportedEffect": ["v3", "v4"],
200976
200993
  "codes": [377026],
@@ -200979,7 +200996,7 @@ var rules = [
200979
200996
  "diagnostics": [{
200980
200997
  "start": 142,
200981
200998
  "end": 158,
200982
- "text": "This code uses `JSON.parse` or `JSON.stringify`. Effect Schema provides Effect-aware APIs for JSON parsing and stringifying. effect(preferSchemaOverJson)"
200999
+ "text": "This code uses `JSON.parse` or `JSON.stringify`. Use `Schema.UnknownFromJsonString` for unknown shapes, `Schema.fromJsonString(schema)` for known ones, or `Schema.toCodecJson(schema)` when working with JSON values instead of strings. effect(preferSchemaOverJson)"
200983
201000
  }]
200984
201001
  }
200985
201002
  },
@@ -201217,7 +201234,7 @@ var rules = [
201217
201234
  "diagnostics": [{
201218
201235
  "start": 246,
201219
201236
  "end": 255,
201220
- "text": "This generator applies the same trailing `Effect.mapError(...)` to every yielded effect. Hoist it once at the generator result: `Effect.gen(...).pipe(Effect.mapError(...))`, or the trailing pipe arguments of generator-form `Effect.fn(...)`. effect(redundantMapError)"
201237
+ "text": "This generator applies the same inline `Effect.mapError(...)` to every yielded effect. Keep that `Effect.mapError(...)` inline and hoist it once to the generator result: `Effect.gen(...).pipe(Effect.mapError(...))`, or `Effect.fn(function*(){ ... }, Effect.mapError(...))`. effect(redundantMapError)"
201221
201238
  }]
201222
201239
  }
201223
201240
  },
@@ -201394,6 +201411,23 @@ var rules = [
201394
201411
  "text": "This expression contains chained `pipe` calls that can be simplified to a single `pipe` call. effect(unnecessaryPipeChain)"
201395
201412
  }]
201396
201413
  }
201414
+ },
201415
+ {
201416
+ "name": "unnecessaryTypeofType",
201417
+ "group": "style",
201418
+ "description": "Suggests replacing typeof Schema.Type style annotations with the matching named type when available",
201419
+ "defaultSeverity": "suggestion",
201420
+ "fixable": true,
201421
+ "supportedEffect": ["v3", "v4"],
201422
+ "codes": [377090],
201423
+ "preview": {
201424
+ "sourceText": "import { Schema } from \"effect\"\n\nexport namespace UsersRepo {\n export const User = Schema.Struct({ id: Schema.Number })\n export type User = typeof User.Type\n}\n\nexport const preview: typeof UsersRepo.User.Type = { id: 1 }\n",
201425
+ "diagnostics": [{
201426
+ "start": 184,
201427
+ "end": 210,
201428
+ "text": "This `typeof ... .Type` query can be replaced with `UsersRepo.User`. effect(unnecessaryTypeofType)"
201429
+ }]
201430
+ }
201397
201431
  }
201398
201432
  ];
201399
201433
  var metadata_default = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/tsgo",
3
- "version": "0.7.5",
3
+ "version": "0.9.0",
4
4
  "description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,13 +22,13 @@
22
22
  "README.md"
23
23
  ],
24
24
  "optionalDependencies": {
25
- "@effect/tsgo-win32-x64": "0.7.5",
26
- "@effect/tsgo-win32-arm64": "0.7.5",
27
- "@effect/tsgo-linux-x64": "0.7.5",
28
- "@effect/tsgo-linux-arm64": "0.7.5",
29
- "@effect/tsgo-linux-arm": "0.7.5",
30
- "@effect/tsgo-darwin-x64": "0.7.5",
31
- "@effect/tsgo-darwin-arm64": "0.7.5"
25
+ "@effect/tsgo-win32-x64": "0.9.0",
26
+ "@effect/tsgo-win32-arm64": "0.9.0",
27
+ "@effect/tsgo-linux-x64": "0.9.0",
28
+ "@effect/tsgo-linux-arm64": "0.9.0",
29
+ "@effect/tsgo-linux-arm": "0.9.0",
30
+ "@effect/tsgo-darwin-x64": "0.9.0",
31
+ "@effect/tsgo-darwin-arm64": "0.9.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@effect/platform-node": "^4.0.0-beta.66",