@effect/language-service 0.80.0 → 0.81.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 +67 -55
- package/cli.js +1848 -274
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +107 -3
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +107 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +107 -3
- package/transform.js.map +1 -1
package/package.json
CHANGED
package/transform.js
CHANGED
|
@@ -5269,6 +5269,7 @@ var anyUnknownInErrorContext = createDiagnostic({
|
|
|
5269
5269
|
name: "anyUnknownInErrorContext",
|
|
5270
5270
|
code: 28,
|
|
5271
5271
|
description: "Detects 'any' or 'unknown' types in Effect error or requirements channels",
|
|
5272
|
+
group: "correctness",
|
|
5272
5273
|
severity: "off",
|
|
5273
5274
|
fixable: false,
|
|
5274
5275
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5374,6 +5375,7 @@ var catchAllToMapError = createDiagnostic({
|
|
|
5374
5375
|
name: "catchAllToMapError",
|
|
5375
5376
|
code: 39,
|
|
5376
5377
|
description: "Suggests using Effect.mapError instead of Effect.catchAll when the callback only wraps the error with Effect.fail",
|
|
5378
|
+
group: "style",
|
|
5377
5379
|
severity: "suggestion",
|
|
5378
5380
|
fixable: true,
|
|
5379
5381
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5473,6 +5475,7 @@ var catchUnfailableEffect = createDiagnostic({
|
|
|
5473
5475
|
name: "catchUnfailableEffect",
|
|
5474
5476
|
code: 2,
|
|
5475
5477
|
description: "Warns when using error handling on Effects that never fail (error type is 'never')",
|
|
5478
|
+
group: "antipattern",
|
|
5476
5479
|
severity: "suggestion",
|
|
5477
5480
|
fixable: false,
|
|
5478
5481
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5524,6 +5527,7 @@ var classSelfMismatch = createDiagnostic({
|
|
|
5524
5527
|
name: "classSelfMismatch",
|
|
5525
5528
|
code: 20,
|
|
5526
5529
|
description: "Ensures Self type parameter matches the class name in Service/Tag/Schema classes",
|
|
5530
|
+
group: "correctness",
|
|
5527
5531
|
severity: "error",
|
|
5528
5532
|
fixable: true,
|
|
5529
5533
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5664,6 +5668,7 @@ var deterministicKeys = createDiagnostic({
|
|
|
5664
5668
|
name: "deterministicKeys",
|
|
5665
5669
|
code: 25,
|
|
5666
5670
|
description: "Enforces deterministic naming for service/tag/error identifiers based on class names",
|
|
5671
|
+
group: "style",
|
|
5667
5672
|
severity: "off",
|
|
5668
5673
|
fixable: true,
|
|
5669
5674
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5783,6 +5788,7 @@ var duplicatePackage = createDiagnostic({
|
|
|
5783
5788
|
name: "duplicatePackage",
|
|
5784
5789
|
code: 6,
|
|
5785
5790
|
description: "Detects when multiple versions of the same Effect package are loaded",
|
|
5791
|
+
group: "correctness",
|
|
5786
5792
|
severity: "warning",
|
|
5787
5793
|
fixable: false,
|
|
5788
5794
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5814,6 +5820,7 @@ var effectFnIife = createDiagnostic({
|
|
|
5814
5820
|
name: "effectFnIife",
|
|
5815
5821
|
code: 46,
|
|
5816
5822
|
description: "Effect.fn or Effect.fnUntraced is called as an IIFE (Immediately Invoked Function Expression). Use Effect.gen instead.",
|
|
5823
|
+
group: "antipattern",
|
|
5817
5824
|
severity: "warning",
|
|
5818
5825
|
fixable: true,
|
|
5819
5826
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5918,6 +5925,7 @@ var effectFnOpportunity = createDiagnostic({
|
|
|
5918
5925
|
name: "effectFnOpportunity",
|
|
5919
5926
|
code: 41,
|
|
5920
5927
|
description: "Suggests using Effect.fn for functions that returns an Effect",
|
|
5928
|
+
group: "style",
|
|
5921
5929
|
severity: "suggestion",
|
|
5922
5930
|
fixable: true,
|
|
5923
5931
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6512,6 +6520,7 @@ var effectGenUsesAdapter = createDiagnostic({
|
|
|
6512
6520
|
name: "effectGenUsesAdapter",
|
|
6513
6521
|
code: 23,
|
|
6514
6522
|
description: "Warns when using the deprecated adapter parameter in Effect.gen",
|
|
6523
|
+
group: "antipattern",
|
|
6515
6524
|
severity: "warning",
|
|
6516
6525
|
fixable: false,
|
|
6517
6526
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6552,6 +6561,7 @@ var effectInFailure = createDiagnostic({
|
|
|
6552
6561
|
name: "effectInFailure",
|
|
6553
6562
|
code: 49,
|
|
6554
6563
|
description: "Warns when an Effect is used inside an Effect failure channel",
|
|
6564
|
+
group: "antipattern",
|
|
6555
6565
|
severity: "warning",
|
|
6556
6566
|
fixable: false,
|
|
6557
6567
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6618,6 +6628,7 @@ var effectInVoidSuccess = createDiagnostic({
|
|
|
6618
6628
|
name: "effectInVoidSuccess",
|
|
6619
6629
|
code: 14,
|
|
6620
6630
|
description: "Detects nested Effects in void success channels that may cause unexecuted effects",
|
|
6631
|
+
group: "antipattern",
|
|
6621
6632
|
severity: "warning",
|
|
6622
6633
|
fixable: false,
|
|
6623
6634
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6669,6 +6680,7 @@ var effectMapVoid = createDiagnostic({
|
|
|
6669
6680
|
name: "effectMapVoid",
|
|
6670
6681
|
code: 40,
|
|
6671
6682
|
description: "Suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {})",
|
|
6683
|
+
group: "style",
|
|
6672
6684
|
severity: "suggestion",
|
|
6673
6685
|
fixable: true,
|
|
6674
6686
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6735,6 +6747,7 @@ var effectSucceedWithVoid = createDiagnostic({
|
|
|
6735
6747
|
name: "effectSucceedWithVoid",
|
|
6736
6748
|
code: 47,
|
|
6737
6749
|
description: "Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0)",
|
|
6750
|
+
group: "style",
|
|
6738
6751
|
severity: "suggestion",
|
|
6739
6752
|
fixable: true,
|
|
6740
6753
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6788,6 +6801,7 @@ var extendsNativeError = createDiagnostic({
|
|
|
6788
6801
|
name: "extendsNativeError",
|
|
6789
6802
|
code: 50,
|
|
6790
6803
|
description: "Warns when a class directly extends the native Error class",
|
|
6804
|
+
group: "effectNative",
|
|
6791
6805
|
severity: "off",
|
|
6792
6806
|
fixable: false,
|
|
6793
6807
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6840,6 +6854,7 @@ var floatingEffect = createDiagnostic({
|
|
|
6840
6854
|
name: "floatingEffect",
|
|
6841
6855
|
code: 3,
|
|
6842
6856
|
description: "Ensures Effects are yielded or assigned to variables, not left floating",
|
|
6857
|
+
group: "correctness",
|
|
6843
6858
|
severity: "error",
|
|
6844
6859
|
fixable: false,
|
|
6845
6860
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6893,6 +6908,7 @@ var genericEffectServices = createDiagnostic({
|
|
|
6893
6908
|
name: "genericEffectServices",
|
|
6894
6909
|
code: 10,
|
|
6895
6910
|
description: "Prevents services with type parameters that cannot be discriminated at runtime",
|
|
6911
|
+
group: "correctness",
|
|
6896
6912
|
severity: "warning",
|
|
6897
6913
|
fixable: false,
|
|
6898
6914
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6942,6 +6958,7 @@ var globalErrorInEffectCatch = createDiagnostic({
|
|
|
6942
6958
|
name: "globalErrorInEffectCatch",
|
|
6943
6959
|
code: 36,
|
|
6944
6960
|
description: "Warns when catch callbacks return global Error type instead of typed errors",
|
|
6961
|
+
group: "antipattern",
|
|
6945
6962
|
severity: "warning",
|
|
6946
6963
|
fixable: false,
|
|
6947
6964
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7004,6 +7021,7 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
7004
7021
|
name: "globalErrorInEffectFailure",
|
|
7005
7022
|
code: 35,
|
|
7006
7023
|
description: "Warns when the global Error type is used in an Effect failure channel",
|
|
7024
|
+
group: "antipattern",
|
|
7007
7025
|
severity: "warning",
|
|
7008
7026
|
fixable: false,
|
|
7009
7027
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7054,11 +7072,54 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
7054
7072
|
})
|
|
7055
7073
|
});
|
|
7056
7074
|
|
|
7075
|
+
// src/diagnostics/globalFetch.ts
|
|
7076
|
+
var globalFetch = createDiagnostic({
|
|
7077
|
+
name: "globalFetch",
|
|
7078
|
+
code: 53,
|
|
7079
|
+
description: "Warns when using the global fetch function instead of the Effect HTTP client",
|
|
7080
|
+
group: "effectNative",
|
|
7081
|
+
severity: "off",
|
|
7082
|
+
fixable: false,
|
|
7083
|
+
supportedEffect: ["v3", "v4"],
|
|
7084
|
+
apply: fn("globalFetch.apply")(function* (sourceFile, report) {
|
|
7085
|
+
const ts = yield* service(TypeScriptApi);
|
|
7086
|
+
const typeChecker = yield* service(TypeCheckerApi);
|
|
7087
|
+
const typeParser = yield* service(TypeParser);
|
|
7088
|
+
const fetchSymbol = typeChecker.resolveName("fetch", void 0, ts.SymbolFlags.Value, false);
|
|
7089
|
+
if (!fetchSymbol) return;
|
|
7090
|
+
const effectVersion = typeParser.supportedEffect();
|
|
7091
|
+
const packageName = effectVersion === "v3" ? "@effect/platform" : "effect/unstable/http";
|
|
7092
|
+
const messageText = `Prefer using HttpClient from ${packageName} instead of the global 'fetch' function.`;
|
|
7093
|
+
const nodeToVisit = [];
|
|
7094
|
+
const appendNodeToVisit = (node) => {
|
|
7095
|
+
nodeToVisit.push(node);
|
|
7096
|
+
return void 0;
|
|
7097
|
+
};
|
|
7098
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
7099
|
+
while (nodeToVisit.length > 0) {
|
|
7100
|
+
const node = nodeToVisit.shift();
|
|
7101
|
+
if (ts.isCallExpression(node)) {
|
|
7102
|
+
const symbol3 = typeChecker.getSymbolAtLocation(node.expression);
|
|
7103
|
+
const resolvedSymbol = symbol3 && symbol3.flags & ts.SymbolFlags.Alias ? typeChecker.getAliasedSymbol(symbol3) : symbol3;
|
|
7104
|
+
if (resolvedSymbol === fetchSymbol) {
|
|
7105
|
+
report({
|
|
7106
|
+
location: node.expression,
|
|
7107
|
+
messageText,
|
|
7108
|
+
fixes: []
|
|
7109
|
+
});
|
|
7110
|
+
}
|
|
7111
|
+
}
|
|
7112
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
7113
|
+
}
|
|
7114
|
+
})
|
|
7115
|
+
});
|
|
7116
|
+
|
|
7057
7117
|
// src/diagnostics/importFromBarrel.ts
|
|
7058
7118
|
var importFromBarrel = createDiagnostic({
|
|
7059
7119
|
name: "importFromBarrel",
|
|
7060
7120
|
code: 12,
|
|
7061
7121
|
description: "Suggests importing from specific module paths instead of barrel exports",
|
|
7122
|
+
group: "style",
|
|
7062
7123
|
severity: "off",
|
|
7063
7124
|
fixable: true,
|
|
7064
7125
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7201,6 +7262,7 @@ var instanceOfSchema = createDiagnostic({
|
|
|
7201
7262
|
name: "instanceOfSchema",
|
|
7202
7263
|
code: 45,
|
|
7203
7264
|
description: "Suggests using Schema.is instead of instanceof for Effect Schema types",
|
|
7265
|
+
group: "effectNative",
|
|
7204
7266
|
severity: "off",
|
|
7205
7267
|
fixable: true,
|
|
7206
7268
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7266,6 +7328,7 @@ var layerMergeAllWithDependencies = createDiagnostic({
|
|
|
7266
7328
|
name: "layerMergeAllWithDependencies",
|
|
7267
7329
|
code: 37,
|
|
7268
7330
|
description: "Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires",
|
|
7331
|
+
group: "antipattern",
|
|
7269
7332
|
severity: "warning",
|
|
7270
7333
|
fixable: true,
|
|
7271
7334
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7381,6 +7444,7 @@ var leakingRequirements = createDiagnostic({
|
|
|
7381
7444
|
name: "leakingRequirements",
|
|
7382
7445
|
code: 8,
|
|
7383
7446
|
description: "Detects implementation services leaked in service methods",
|
|
7447
|
+
group: "antipattern",
|
|
7384
7448
|
severity: "suggestion",
|
|
7385
7449
|
fixable: false,
|
|
7386
7450
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7537,6 +7601,7 @@ var missedPipeableOpportunity = createDiagnostic({
|
|
|
7537
7601
|
name: "missedPipeableOpportunity",
|
|
7538
7602
|
code: 26,
|
|
7539
7603
|
description: "Enforces the use of pipeable style for nested function calls",
|
|
7604
|
+
group: "style",
|
|
7540
7605
|
severity: "off",
|
|
7541
7606
|
fixable: true,
|
|
7542
7607
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7719,6 +7784,7 @@ var missingEffectContext = createDiagnostic({
|
|
|
7719
7784
|
name: "missingEffectContext",
|
|
7720
7785
|
code: 1,
|
|
7721
7786
|
description: "Reports missing service requirements in Effect context channel",
|
|
7787
|
+
group: "correctness",
|
|
7722
7788
|
severity: "error",
|
|
7723
7789
|
fixable: false,
|
|
7724
7790
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7770,6 +7836,7 @@ var missingEffectError = createDiagnostic({
|
|
|
7770
7836
|
name: "missingEffectError",
|
|
7771
7837
|
code: 1,
|
|
7772
7838
|
description: "Reports missing error types in Effect error channel",
|
|
7839
|
+
group: "correctness",
|
|
7773
7840
|
severity: "error",
|
|
7774
7841
|
fixable: true,
|
|
7775
7842
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7913,6 +7980,7 @@ var missingEffectServiceDependency = createDiagnostic({
|
|
|
7913
7980
|
name: "missingEffectServiceDependency",
|
|
7914
7981
|
code: 22,
|
|
7915
7982
|
description: "Checks that Effect.Service dependencies satisfy all required layer inputs",
|
|
7983
|
+
group: "style",
|
|
7916
7984
|
severity: "off",
|
|
7917
7985
|
fixable: false,
|
|
7918
7986
|
supportedEffect: ["v3"],
|
|
@@ -8009,6 +8077,7 @@ var missingLayerContext = createDiagnostic({
|
|
|
8009
8077
|
name: "missingLayerContext",
|
|
8010
8078
|
code: 38,
|
|
8011
8079
|
description: "Reports missing service requirements in Layer context channel",
|
|
8080
|
+
group: "correctness",
|
|
8012
8081
|
severity: "error",
|
|
8013
8082
|
fixable: false,
|
|
8014
8083
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8060,6 +8129,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
8060
8129
|
name: "missingReturnYieldStar",
|
|
8061
8130
|
code: 7,
|
|
8062
8131
|
description: "Suggests using 'return yield*' for Effects with never success for better type narrowing",
|
|
8132
|
+
group: "correctness",
|
|
8063
8133
|
severity: "error",
|
|
8064
8134
|
fixable: true,
|
|
8065
8135
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8112,6 +8182,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
|
|
|
8112
8182
|
name: "missingStarInYieldEffectGen",
|
|
8113
8183
|
code: 4,
|
|
8114
8184
|
description: "Enforces using 'yield*' instead of 'yield' when yielding Effects in generators",
|
|
8185
|
+
group: "correctness",
|
|
8115
8186
|
severity: "error",
|
|
8116
8187
|
fixable: true,
|
|
8117
8188
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8189,6 +8260,7 @@ var multipleEffectProvide = createDiagnostic({
|
|
|
8189
8260
|
name: "multipleEffectProvide",
|
|
8190
8261
|
code: 18,
|
|
8191
8262
|
description: "Warns against chaining Effect.provide calls which can cause service lifecycle issues",
|
|
8263
|
+
group: "antipattern",
|
|
8192
8264
|
severity: "warning",
|
|
8193
8265
|
fixable: true,
|
|
8194
8266
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8291,7 +8363,11 @@ var moduleAlternativesV3 = /* @__PURE__ */ new Map([
|
|
|
8291
8363
|
["path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
8292
8364
|
["node:path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
8293
8365
|
["child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
8294
|
-
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }]
|
|
8366
|
+
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
8367
|
+
["http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
8368
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
8369
|
+
["https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }],
|
|
8370
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }]
|
|
8295
8371
|
]);
|
|
8296
8372
|
var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
8297
8373
|
["fs", { alternative: "FileSystem", module: "fs", package: "effect" }],
|
|
@@ -8305,12 +8381,17 @@ var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
|
8305
8381
|
["path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
8306
8382
|
["node:path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
8307
8383
|
["child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
8308
|
-
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }]
|
|
8384
|
+
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
8385
|
+
["http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
8386
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
8387
|
+
["https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }],
|
|
8388
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }]
|
|
8309
8389
|
]);
|
|
8310
8390
|
var nodeBuiltinImport = createDiagnostic({
|
|
8311
8391
|
name: "nodeBuiltinImport",
|
|
8312
8392
|
code: 52,
|
|
8313
8393
|
description: "Warns when importing Node.js built-in modules that have Effect-native counterparts",
|
|
8394
|
+
group: "effectNative",
|
|
8314
8395
|
severity: "off",
|
|
8315
8396
|
fixable: false,
|
|
8316
8397
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8354,6 +8435,7 @@ var nonObjectEffectServiceType = createDiagnostic({
|
|
|
8354
8435
|
name: "nonObjectEffectServiceType",
|
|
8355
8436
|
code: 24,
|
|
8356
8437
|
description: "Ensures Effect.Service types are objects, not primitives",
|
|
8438
|
+
group: "correctness",
|
|
8357
8439
|
severity: "error",
|
|
8358
8440
|
fixable: false,
|
|
8359
8441
|
supportedEffect: ["v3"],
|
|
@@ -9138,6 +9220,7 @@ var outdatedApi = createDiagnostic({
|
|
|
9138
9220
|
name: "outdatedApi",
|
|
9139
9221
|
code: 48,
|
|
9140
9222
|
description: "Detects usage of APIs that have been removed or renamed in Effect v4",
|
|
9223
|
+
group: "correctness",
|
|
9141
9224
|
severity: "warning",
|
|
9142
9225
|
fixable: false,
|
|
9143
9226
|
supportedEffect: ["v4"],
|
|
@@ -10276,6 +10359,7 @@ var outdatedEffectCodegen = createDiagnostic({
|
|
|
10276
10359
|
name: "outdatedEffectCodegen",
|
|
10277
10360
|
code: 19,
|
|
10278
10361
|
description: "Detects when generated code is outdated and needs to be regenerated",
|
|
10362
|
+
group: "correctness",
|
|
10279
10363
|
severity: "warning",
|
|
10280
10364
|
fixable: true,
|
|
10281
10365
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10324,6 +10408,7 @@ var overriddenSchemaConstructor = createDiagnostic({
|
|
|
10324
10408
|
name: "overriddenSchemaConstructor",
|
|
10325
10409
|
code: 30,
|
|
10326
10410
|
description: "Prevents overriding constructors in Schema classes which breaks decoding behavior",
|
|
10411
|
+
group: "correctness",
|
|
10327
10412
|
severity: "error",
|
|
10328
10413
|
fixable: true,
|
|
10329
10414
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10463,6 +10548,7 @@ var preferSchemaOverJson = createDiagnostic({
|
|
|
10463
10548
|
name: "preferSchemaOverJson",
|
|
10464
10549
|
code: 44,
|
|
10465
10550
|
description: "Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify which may throw",
|
|
10551
|
+
group: "effectNative",
|
|
10466
10552
|
severity: "suggestion",
|
|
10467
10553
|
fixable: false,
|
|
10468
10554
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10575,6 +10661,7 @@ var redundantSchemaTagIdentifier = createDiagnostic({
|
|
|
10575
10661
|
name: "redundantSchemaTagIdentifier",
|
|
10576
10662
|
code: 42,
|
|
10577
10663
|
description: "Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest",
|
|
10664
|
+
group: "style",
|
|
10578
10665
|
severity: "suggestion",
|
|
10579
10666
|
fixable: true,
|
|
10580
10667
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10627,6 +10714,7 @@ var returnEffectInGen = createDiagnostic({
|
|
|
10627
10714
|
name: "returnEffectInGen",
|
|
10628
10715
|
code: 11,
|
|
10629
10716
|
description: "Warns when returning an Effect in a generator causes nested Effect<Effect<...>>",
|
|
10717
|
+
group: "antipattern",
|
|
10630
10718
|
severity: "suggestion",
|
|
10631
10719
|
fixable: true,
|
|
10632
10720
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10698,6 +10786,7 @@ var runEffectInsideEffect = createDiagnostic({
|
|
|
10698
10786
|
name: "runEffectInsideEffect",
|
|
10699
10787
|
code: 32,
|
|
10700
10788
|
description: "Suggests using Runtime methods instead of Effect.run* inside Effect contexts",
|
|
10789
|
+
group: "antipattern",
|
|
10701
10790
|
severity: "suggestion",
|
|
10702
10791
|
fixable: true,
|
|
10703
10792
|
supportedEffect: ["v3"],
|
|
@@ -10824,6 +10913,7 @@ var schemaStructWithTag = createDiagnostic({
|
|
|
10824
10913
|
name: "schemaStructWithTag",
|
|
10825
10914
|
code: 34,
|
|
10826
10915
|
description: "Suggests using Schema.TaggedStruct instead of Schema.Struct with _tag field",
|
|
10916
|
+
group: "style",
|
|
10827
10917
|
severity: "suggestion",
|
|
10828
10918
|
fixable: true,
|
|
10829
10919
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10918,9 +11008,10 @@ var schemaSyncInEffect = createDiagnostic({
|
|
|
10918
11008
|
name: "schemaSyncInEffect",
|
|
10919
11009
|
code: 43,
|
|
10920
11010
|
description: "Suggests using Effect-based Schema methods instead of sync methods inside Effect generators",
|
|
11011
|
+
group: "antipattern",
|
|
10921
11012
|
severity: "suggestion",
|
|
10922
11013
|
fixable: false,
|
|
10923
|
-
supportedEffect: ["v3"
|
|
11014
|
+
supportedEffect: ["v3"],
|
|
10924
11015
|
apply: fn("schemaSyncInEffect.apply")(function* (sourceFile, report) {
|
|
10925
11016
|
const ts = yield* service(TypeScriptApi);
|
|
10926
11017
|
const typeParser = yield* service(TypeParser);
|
|
@@ -10969,6 +11060,7 @@ var schemaUnionOfLiterals = createDiagnostic({
|
|
|
10969
11060
|
name: "schemaUnionOfLiterals",
|
|
10970
11061
|
code: 33,
|
|
10971
11062
|
description: "Simplifies Schema.Union of multiple Schema.Literal calls into single Schema.Literal",
|
|
11063
|
+
group: "style",
|
|
10972
11064
|
severity: "off",
|
|
10973
11065
|
fixable: true,
|
|
10974
11066
|
supportedEffect: ["v3"],
|
|
@@ -11046,6 +11138,7 @@ var scopeInLayerEffect = createDiagnostic({
|
|
|
11046
11138
|
name: "scopeInLayerEffect",
|
|
11047
11139
|
code: 13,
|
|
11048
11140
|
description: "Suggests using Layer.scoped instead of Layer.effect when Scope is in requirements",
|
|
11141
|
+
group: "antipattern",
|
|
11049
11142
|
severity: "warning",
|
|
11050
11143
|
fixable: true,
|
|
11051
11144
|
supportedEffect: ["v3"],
|
|
@@ -11143,6 +11236,7 @@ var serviceNotAsClass = createDiagnostic({
|
|
|
11143
11236
|
name: "serviceNotAsClass",
|
|
11144
11237
|
code: 51,
|
|
11145
11238
|
description: "Warns when ServiceMap.Service is used as a variable instead of a class declaration",
|
|
11239
|
+
group: "style",
|
|
11146
11240
|
severity: "off",
|
|
11147
11241
|
fixable: true,
|
|
11148
11242
|
supportedEffect: ["v4"],
|
|
@@ -11220,6 +11314,7 @@ var strictBooleanExpressions = createDiagnostic({
|
|
|
11220
11314
|
name: "strictBooleanExpressions",
|
|
11221
11315
|
code: 17,
|
|
11222
11316
|
description: "Enforces boolean types in conditional expressions for type safety",
|
|
11317
|
+
group: "style",
|
|
11223
11318
|
severity: "off",
|
|
11224
11319
|
fixable: false,
|
|
11225
11320
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11293,6 +11388,7 @@ var strictEffectProvide = createDiagnostic({
|
|
|
11293
11388
|
name: "strictEffectProvide",
|
|
11294
11389
|
code: 27,
|
|
11295
11390
|
description: "Warns when using Effect.provide with layers outside of application entry points",
|
|
11391
|
+
group: "antipattern",
|
|
11296
11392
|
severity: "off",
|
|
11297
11393
|
fixable: false,
|
|
11298
11394
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11346,6 +11442,7 @@ var tryCatchInEffectGen = createDiagnostic({
|
|
|
11346
11442
|
name: "tryCatchInEffectGen",
|
|
11347
11443
|
code: 15,
|
|
11348
11444
|
description: "Discourages try/catch in Effect generators in favor of Effect error handling",
|
|
11445
|
+
group: "antipattern",
|
|
11349
11446
|
severity: "suggestion",
|
|
11350
11447
|
fixable: false,
|
|
11351
11448
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11405,6 +11502,7 @@ var unknownInEffectCatch = createDiagnostic({
|
|
|
11405
11502
|
name: "unknownInEffectCatch",
|
|
11406
11503
|
code: 31,
|
|
11407
11504
|
description: "Warns when catch callbacks return unknown instead of typed errors",
|
|
11505
|
+
group: "antipattern",
|
|
11408
11506
|
severity: "warning",
|
|
11409
11507
|
fixable: false,
|
|
11410
11508
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11468,6 +11566,7 @@ var unnecessaryEffectGen = createDiagnostic({
|
|
|
11468
11566
|
name: "unnecessaryEffectGen",
|
|
11469
11567
|
code: 5,
|
|
11470
11568
|
description: "Suggests removing Effect.gen when it contains only a single return statement",
|
|
11569
|
+
group: "style",
|
|
11471
11570
|
severity: "suggestion",
|
|
11472
11571
|
fixable: true,
|
|
11473
11572
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11514,6 +11613,7 @@ var unnecessaryFailYieldableError = createDiagnostic({
|
|
|
11514
11613
|
name: "unnecessaryFailYieldableError",
|
|
11515
11614
|
code: 29,
|
|
11516
11615
|
description: "Suggests yielding yieldable errors directly instead of wrapping with Effect.fail",
|
|
11616
|
+
group: "style",
|
|
11517
11617
|
severity: "suggestion",
|
|
11518
11618
|
fixable: true,
|
|
11519
11619
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11575,6 +11675,7 @@ var unnecessaryPipe = createDiagnostic({
|
|
|
11575
11675
|
name: "unnecessaryPipe",
|
|
11576
11676
|
code: 9,
|
|
11577
11677
|
description: "Removes pipe calls with no arguments",
|
|
11678
|
+
group: "style",
|
|
11578
11679
|
severity: "suggestion",
|
|
11579
11680
|
fixable: true,
|
|
11580
11681
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11623,6 +11724,7 @@ var unnecessaryPipeChain = createDiagnostic({
|
|
|
11623
11724
|
name: "unnecessaryPipeChain",
|
|
11624
11725
|
code: 16,
|
|
11625
11726
|
description: "Simplifies chained pipe calls into a single pipe call",
|
|
11727
|
+
group: "style",
|
|
11626
11728
|
severity: "suggestion",
|
|
11627
11729
|
fixable: true,
|
|
11628
11730
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11700,6 +11802,7 @@ var unsupportedServiceAccessors = createDiagnostic({
|
|
|
11700
11802
|
name: "unsupportedServiceAccessors",
|
|
11701
11803
|
code: 21,
|
|
11702
11804
|
description: "Warns about service accessors that need codegen due to generic/complex signatures",
|
|
11805
|
+
group: "correctness",
|
|
11703
11806
|
severity: "warning",
|
|
11704
11807
|
fixable: true,
|
|
11705
11808
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11777,6 +11880,7 @@ var diagnostics = [
|
|
|
11777
11880
|
leakingRequirements,
|
|
11778
11881
|
unnecessaryPipe,
|
|
11779
11882
|
genericEffectServices,
|
|
11883
|
+
globalFetch,
|
|
11780
11884
|
returnEffectInGen,
|
|
11781
11885
|
tryCatchInEffectGen,
|
|
11782
11886
|
importFromBarrel,
|