@effect/tsgo 0.0.18 → 0.0.19

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
@@ -66,7 +66,16 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
66
66
  <tr><td><code>unknownInEffectCatch</code></td><td>⚠️</td><td></td><td>Warns when catch callbacks return unknown instead of typed errors</td><td>✓</td><td>✓</td></tr>
67
67
  <tr><td colspan="6"><strong>Effect-native</strong> <em>Prefer Effect-native APIs and abstractions when available.</em></td></tr>
68
68
  <tr><td><code>extendsNativeError</code></td><td>➖</td><td></td><td>Warns when a class directly extends the native Error class</td><td>✓</td><td>✓</td></tr>
69
- <tr><td><code>globalFetch</code></td><td>➖</td><td></td><td>Warns when using the global fetch function instead of the Effect HTTP client</td><td>✓</td><td>✓</td></tr>
69
+ <tr><td><code>globalConsole</code></td><td>➖</td><td></td><td>Warns when using console methods outside Effect generators instead of Effect.log/Logger</td><td>✓</td><td>✓</td></tr>
70
+ <tr><td><code>globalConsoleInEffect</code></td><td>➖</td><td></td><td>Warns when using console methods inside Effect generators instead of Effect.log/Logger</td><td>✓</td><td>✓</td></tr>
71
+ <tr><td><code>globalDate</code></td><td>➖</td><td></td><td>Warns when using Date.now() or new Date() outside Effect generators instead of Clock/DateTime</td><td>✓</td><td>✓</td></tr>
72
+ <tr><td><code>globalDateInEffect</code></td><td>➖</td><td></td><td>Warns when using Date.now() or new Date() inside Effect generators instead of Clock/DateTime</td><td>✓</td><td>✓</td></tr>
73
+ <tr><td><code>globalFetch</code></td><td>➖</td><td></td><td>Warns when using the global fetch function outside Effect generators instead of the Effect HTTP client</td><td>✓</td><td>✓</td></tr>
74
+ <tr><td><code>globalFetchInEffect</code></td><td>➖</td><td></td><td>Warns when using the global fetch function inside Effect generators instead of the Effect HTTP client</td><td>✓</td><td>✓</td></tr>
75
+ <tr><td><code>globalRandom</code></td><td>➖</td><td></td><td>Warns when using Math.random() outside Effect generators instead of the Random service</td><td>✓</td><td>✓</td></tr>
76
+ <tr><td><code>globalRandomInEffect</code></td><td>➖</td><td></td><td>Warns when using Math.random() inside Effect generators instead of the Random service</td><td>✓</td><td>✓</td></tr>
77
+ <tr><td><code>globalTimers</code></td><td>➖</td><td></td><td>Warns when using setTimeout/setInterval outside Effect generators instead of Effect.sleep/Schedule</td><td>✓</td><td>✓</td></tr>
78
+ <tr><td><code>globalTimersInEffect</code></td><td>➖</td><td></td><td>Warns when using setTimeout/setInterval inside Effect generators instead of Effect.sleep/Schedule</td><td>✓</td><td>✓</td></tr>
70
79
  <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>
71
80
  <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>
72
81
  <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>
@@ -197344,7 +197344,7 @@ var FileReadError = class extends TaggedError("FileReadError") {
197344
197344
  //#endregion
197345
197345
  //#region package.json
197346
197346
  var name = "@effect/tsgo";
197347
- var version = "0.0.18";
197347
+ var version = "0.0.19";
197348
197348
 
197349
197349
  //#endregion
197350
197350
  //#region src/setup/consts.ts
@@ -198134,7 +198134,16 @@ var presets$1 = [{
198134
198134
  "description": "Enable all Effect-native diagnostics at warning level.",
198135
198135
  "diagnosticSeverity": {
198136
198136
  "extendsNativeError": "warning",
198137
+ "globalConsole": "warning",
198138
+ "globalConsoleInEffect": "warning",
198139
+ "globalDate": "warning",
198140
+ "globalDateInEffect": "warning",
198137
198141
  "globalFetch": "warning",
198142
+ "globalFetchInEffect": "warning",
198143
+ "globalRandom": "warning",
198144
+ "globalRandomInEffect": "warning",
198145
+ "globalTimers": "warning",
198146
+ "globalTimersInEffect": "warning",
198138
198147
  "instanceOfSchema": "warning",
198139
198148
  "nodeBuiltinImport": "warning",
198140
198149
  "preferSchemaOverJson": "warning"
@@ -198701,20 +198710,169 @@ var rules = [
198701
198710
  }]
198702
198711
  }
198703
198712
  },
198713
+ {
198714
+ "name": "globalConsole",
198715
+ "group": "effectNative",
198716
+ "description": "Warns when using console methods outside Effect generators instead of Effect.log/Logger",
198717
+ "defaultSeverity": "off",
198718
+ "fixable": false,
198719
+ "supportedEffect": ["v3", "v4"],
198720
+ "codes": [377064],
198721
+ "preview": {
198722
+ "sourceText": "\nconsole.log(\"preview\")\n",
198723
+ "diagnostics": [{
198724
+ "start": 1,
198725
+ "end": 23,
198726
+ "text": "Prefer using Effect.log or Logger instead of console.log. effect(globalConsole)"
198727
+ }]
198728
+ }
198729
+ },
198730
+ {
198731
+ "name": "globalConsoleInEffect",
198732
+ "group": "effectNative",
198733
+ "description": "Warns when using console methods inside Effect generators instead of Effect.log/Logger",
198734
+ "defaultSeverity": "off",
198735
+ "fixable": false,
198736
+ "supportedEffect": ["v3", "v4"],
198737
+ "codes": [377065],
198738
+ "preview": {
198739
+ "sourceText": "import { Effect } from \"effect\"\n\nexport const preview = Effect.gen(function*() {\n console.log(\"hello\")\n})\n",
198740
+ "diagnostics": [{
198741
+ "start": 83,
198742
+ "end": 103,
198743
+ "text": "Prefer using Effect.log or Logger instead of console.log inside Effect generators. effect(globalConsoleInEffect)"
198744
+ }]
198745
+ }
198746
+ },
198747
+ {
198748
+ "name": "globalDate",
198749
+ "group": "effectNative",
198750
+ "description": "Warns when using Date.now() or new Date() outside Effect generators instead of Clock/DateTime",
198751
+ "defaultSeverity": "off",
198752
+ "fixable": false,
198753
+ "supportedEffect": ["v3", "v4"],
198754
+ "codes": [377066, 377068],
198755
+ "preview": {
198756
+ "sourceText": "\nexport const preview = Date.now()\n",
198757
+ "diagnostics": [{
198758
+ "start": 24,
198759
+ "end": 34,
198760
+ "text": "Prefer using Clock or DateTime from Effect instead of Date.now(). effect(globalDate)"
198761
+ }]
198762
+ }
198763
+ },
198764
+ {
198765
+ "name": "globalDateInEffect",
198766
+ "group": "effectNative",
198767
+ "description": "Warns when using Date.now() or new Date() inside Effect generators instead of Clock/DateTime",
198768
+ "defaultSeverity": "off",
198769
+ "fixable": false,
198770
+ "supportedEffect": ["v3", "v4"],
198771
+ "codes": [377067, 377069],
198772
+ "preview": {
198773
+ "sourceText": "import { Effect } from \"effect\"\n\nexport const preview = Effect.gen(function*() {\n const now = Date.now()\n return now\n})\n",
198774
+ "diagnostics": [{
198775
+ "start": 95,
198776
+ "end": 105,
198777
+ "text": "Prefer using Clock or DateTime from Effect instead of Date.now() inside Effect generators. effect(globalDateInEffect)"
198778
+ }]
198779
+ }
198780
+ },
198704
198781
  {
198705
198782
  "name": "globalFetch",
198706
198783
  "group": "effectNative",
198707
- "description": "Warns when using the global fetch function instead of the Effect HTTP client",
198784
+ "description": "Warns when using the global fetch function outside Effect generators instead of the Effect HTTP client",
198708
198785
  "defaultSeverity": "off",
198709
198786
  "fixable": false,
198710
198787
  "supportedEffect": ["v3", "v4"],
198711
198788
  "codes": [377061],
198712
198789
  "preview": {
198713
- "sourceText": "\nimport { Effect } from \"effect\"\n\nvoid Effect\n\nexport const preview = fetch(\"https://example.com\")\n",
198790
+ "sourceText": "\nexport const preview = fetch(\"https://example.com\")\n",
198714
198791
  "diagnostics": [{
198715
- "start": 70,
198716
- "end": 75,
198717
- "text": "Prefer using HttpClient from effect/unstable/http instead of the global 'fetch' function. effect(globalFetch)"
198792
+ "start": 24,
198793
+ "end": 29,
198794
+ "text": "Prefer using HttpClient from @effect/platform instead of the global 'fetch' function. effect(globalFetch)"
198795
+ }]
198796
+ }
198797
+ },
198798
+ {
198799
+ "name": "globalFetchInEffect",
198800
+ "group": "effectNative",
198801
+ "description": "Warns when using the global fetch function inside Effect generators instead of the Effect HTTP client",
198802
+ "defaultSeverity": "off",
198803
+ "fixable": false,
198804
+ "supportedEffect": ["v3", "v4"],
198805
+ "codes": [377063],
198806
+ "preview": {
198807
+ "sourceText": "import { Effect } from \"effect\"\n\nexport const preview = Effect.gen(function*() {\n return yield* Effect.promise(() => fetch(\"https://example.com\"))\n})\n",
198808
+ "diagnostics": []
198809
+ }
198810
+ },
198811
+ {
198812
+ "name": "globalRandom",
198813
+ "group": "effectNative",
198814
+ "description": "Warns when using Math.random() outside Effect generators instead of the Random service",
198815
+ "defaultSeverity": "off",
198816
+ "fixable": false,
198817
+ "supportedEffect": ["v3", "v4"],
198818
+ "codes": [377070],
198819
+ "preview": {
198820
+ "sourceText": "\nexport const preview = Math.random()\n",
198821
+ "diagnostics": [{
198822
+ "start": 24,
198823
+ "end": 37,
198824
+ "text": "Prefer using the Random service from Effect instead of Math.random(). effect(globalRandom)"
198825
+ }]
198826
+ }
198827
+ },
198828
+ {
198829
+ "name": "globalRandomInEffect",
198830
+ "group": "effectNative",
198831
+ "description": "Warns when using Math.random() inside Effect generators instead of the Random service",
198832
+ "defaultSeverity": "off",
198833
+ "fixable": false,
198834
+ "supportedEffect": ["v3", "v4"],
198835
+ "codes": [377071],
198836
+ "preview": {
198837
+ "sourceText": "import { Effect } from \"effect\"\n\nexport const preview = Effect.gen(function*() {\n const r = Math.random()\n return r\n})\n",
198838
+ "diagnostics": [{
198839
+ "start": 93,
198840
+ "end": 106,
198841
+ "text": "Prefer using the Random service from Effect instead of Math.random() inside Effect generators. effect(globalRandomInEffect)"
198842
+ }]
198843
+ }
198844
+ },
198845
+ {
198846
+ "name": "globalTimers",
198847
+ "group": "effectNative",
198848
+ "description": "Warns when using setTimeout/setInterval outside Effect generators instead of Effect.sleep/Schedule",
198849
+ "defaultSeverity": "off",
198850
+ "fixable": false,
198851
+ "supportedEffect": ["v3", "v4"],
198852
+ "codes": [377072],
198853
+ "preview": {
198854
+ "sourceText": "\nsetTimeout(() => {}, 100)\n",
198855
+ "diagnostics": [{
198856
+ "start": 1,
198857
+ "end": 26,
198858
+ "text": "Prefer using Effect.sleep or Schedule from Effect instead of setTimeout. effect(globalTimers)"
198859
+ }]
198860
+ }
198861
+ },
198862
+ {
198863
+ "name": "globalTimersInEffect",
198864
+ "group": "effectNative",
198865
+ "description": "Warns when using setTimeout/setInterval inside Effect generators instead of Effect.sleep/Schedule",
198866
+ "defaultSeverity": "off",
198867
+ "fixable": false,
198868
+ "supportedEffect": ["v3", "v4"],
198869
+ "codes": [377073],
198870
+ "preview": {
198871
+ "sourceText": "import { Effect } from \"effect\"\n\nexport const preview = Effect.gen(function*() {\n setTimeout(() => {}, 100)\n})\n",
198872
+ "diagnostics": [{
198873
+ "start": 83,
198874
+ "end": 108,
198875
+ "text": "Prefer using Effect.sleep or Schedule from Effect instead of setTimeout inside Effect generators. effect(globalTimersInEffect)"
198718
198876
  }]
198719
198877
  }
198720
198878
  },
@@ -198796,7 +198954,11 @@ var rules = [
198796
198954
  "codes": [377049],
198797
198955
  "preview": {
198798
198956
  "sourceText": "import { ServiceMap } from \"effect\"\n\nexport class RenamedService\n extends ServiceMap.Service<RenamedService, {}>()(\"CustomIdentifier\") {}\n",
198799
- "diagnostics": []
198957
+ "diagnostics": [{
198958
+ "start": 116,
198959
+ "end": 134,
198960
+ "text": "Key should be 'effect-v4-tests/preview/RenamedService'. effect(deterministicKeys)"
198961
+ }]
198800
198962
  }
198801
198963
  },
198802
198964
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/tsgo",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
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.0.18",
26
- "@effect/tsgo-win32-arm64": "0.0.18",
27
- "@effect/tsgo-linux-x64": "0.0.18",
28
- "@effect/tsgo-linux-arm64": "0.0.18",
29
- "@effect/tsgo-linux-arm": "0.0.18",
30
- "@effect/tsgo-darwin-x64": "0.0.18",
31
- "@effect/tsgo-darwin-arm64": "0.0.18"
25
+ "@effect/tsgo-win32-x64": "0.0.19",
26
+ "@effect/tsgo-win32-arm64": "0.0.19",
27
+ "@effect/tsgo-linux-x64": "0.0.19",
28
+ "@effect/tsgo-linux-arm64": "0.0.19",
29
+ "@effect/tsgo-linux-arm": "0.0.19",
30
+ "@effect/tsgo-darwin-x64": "0.0.19",
31
+ "@effect/tsgo-darwin-arm64": "0.0.19"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@effect/platform-node": "^4.0.0-beta.40",