@effect/tsgo 0.8.0 → 0.10.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 +3 -1
- package/dist/effect-tsgo.js +37 -3
- package/package.json +8 -8
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
|
|
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>
|
|
@@ -100,6 +101,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
|
|
|
100
101
|
<tr><td><code>effectSucceedWithVoid</code></td><td>💡</td><td>🔧</td><td>Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0)</td><td>✓</td><td>✓</td></tr>
|
|
101
102
|
<tr><td><code>missedPipeableOpportunity</code></td><td>➖</td><td>🔧</td><td>Suggests using .pipe() for nested function calls</td><td>✓</td><td>✓</td></tr>
|
|
102
103
|
<tr><td><code>missingEffectServiceDependency</code></td><td>➖</td><td></td><td>Checks that Effect.Service dependencies satisfy all required layer inputs</td><td>✓</td><td></td></tr>
|
|
104
|
+
<tr><td><code>multipleCatchTag</code></td><td>💡</td><td></td><td>Suggests collapsing consecutive Effect.catchTag transformations into a single Effect.catchTags call when semantics stay equivalent</td><td></td><td>✓</td></tr>
|
|
103
105
|
<tr><td><code>nestedEffectGenYield</code></td><td>➖</td><td></td><td>Warns when yielding a nested bare Effect.gen inside an existing Effect generator context</td><td>✓</td><td>✓</td></tr>
|
|
104
106
|
<tr><td><code>redundantMapError</code></td><td>💡</td><td></td><td>Suggests hoisting a repeated trailing Effect.mapError from every yield in an Effect generator</td><td>✓</td><td>✓</td></tr>
|
|
105
107
|
<tr><td><code>redundantSchemaTagIdentifier</code></td><td>💡</td><td>🔧</td><td>Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest</td><td>✓</td><td>✓</td></tr>
|
package/dist/effect-tsgo.js
CHANGED
|
@@ -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.
|
|
199262
|
+
var version = "0.10.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. Effect is already lazy, so wrapping it 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": "
|
|
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`.
|
|
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
|
},
|
|
@@ -201187,6 +201204,23 @@ var rules = [
|
|
|
201187
201204
|
}]
|
|
201188
201205
|
}
|
|
201189
201206
|
},
|
|
201207
|
+
{
|
|
201208
|
+
"name": "multipleCatchTag",
|
|
201209
|
+
"group": "style",
|
|
201210
|
+
"description": "Suggests collapsing consecutive Effect.catchTag transformations into a single Effect.catchTags call when semantics stay equivalent",
|
|
201211
|
+
"defaultSeverity": "suggestion",
|
|
201212
|
+
"fixable": false,
|
|
201213
|
+
"supportedEffect": ["v4"],
|
|
201214
|
+
"codes": [377092],
|
|
201215
|
+
"preview": {
|
|
201216
|
+
"sourceText": "import { Data, Effect, pipe } from \"effect\"\n\nclass NotFound extends Data.TaggedError(\"NotFound\")<{}> {}\nclass Unauthorized extends Data.TaggedError(\"Unauthorized\")<{}> {}\n\ndeclare const program: Effect.Effect<string, NotFound | Unauthorized>\n\nexport const preview = pipe(\n program,\n Effect.catchTag(\"NotFound\", () => Effect.succeed(\"missing\")),\n Effect.catchTag(\"Unauthorized\", () => Effect.succeed(\"denied\"))\n)\n",
|
|
201217
|
+
"diagnostics": [{
|
|
201218
|
+
"start": 285,
|
|
201219
|
+
"end": 300,
|
|
201220
|
+
"text": "These 2 consecutive `catchTag` transformations can be collapsed into a single `catchTags` call. effect(multipleCatchTag)"
|
|
201221
|
+
}]
|
|
201222
|
+
}
|
|
201223
|
+
},
|
|
201190
201224
|
{
|
|
201191
201225
|
"name": "nestedEffectGenYield",
|
|
201192
201226
|
"group": "style",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/tsgo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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.
|
|
26
|
-
"@effect/tsgo-win32-arm64": "0.
|
|
27
|
-
"@effect/tsgo-linux-x64": "0.
|
|
28
|
-
"@effect/tsgo-linux-arm64": "0.
|
|
29
|
-
"@effect/tsgo-linux-arm": "0.
|
|
30
|
-
"@effect/tsgo-darwin-x64": "0.
|
|
31
|
-
"@effect/tsgo-darwin-arm64": "0.
|
|
25
|
+
"@effect/tsgo-win32-x64": "0.10.0",
|
|
26
|
+
"@effect/tsgo-win32-arm64": "0.10.0",
|
|
27
|
+
"@effect/tsgo-linux-x64": "0.10.0",
|
|
28
|
+
"@effect/tsgo-linux-arm64": "0.10.0",
|
|
29
|
+
"@effect/tsgo-linux-arm": "0.10.0",
|
|
30
|
+
"@effect/tsgo-darwin-x64": "0.10.0",
|
|
31
|
+
"@effect/tsgo-darwin-arm64": "0.10.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@effect/platform-node": "^4.0.0-beta.66",
|