@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
|
@@ -5273,6 +5273,7 @@ var anyUnknownInErrorContext = createDiagnostic({
|
|
|
5273
5273
|
name: "anyUnknownInErrorContext",
|
|
5274
5274
|
code: 28,
|
|
5275
5275
|
description: "Detects 'any' or 'unknown' types in Effect error or requirements channels",
|
|
5276
|
+
group: "correctness",
|
|
5276
5277
|
severity: "off",
|
|
5277
5278
|
fixable: false,
|
|
5278
5279
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5378,6 +5379,7 @@ var catchAllToMapError = createDiagnostic({
|
|
|
5378
5379
|
name: "catchAllToMapError",
|
|
5379
5380
|
code: 39,
|
|
5380
5381
|
description: "Suggests using Effect.mapError instead of Effect.catchAll when the callback only wraps the error with Effect.fail",
|
|
5382
|
+
group: "style",
|
|
5381
5383
|
severity: "suggestion",
|
|
5382
5384
|
fixable: true,
|
|
5383
5385
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5477,6 +5479,7 @@ var catchUnfailableEffect = createDiagnostic({
|
|
|
5477
5479
|
name: "catchUnfailableEffect",
|
|
5478
5480
|
code: 2,
|
|
5479
5481
|
description: "Warns when using error handling on Effects that never fail (error type is 'never')",
|
|
5482
|
+
group: "antipattern",
|
|
5480
5483
|
severity: "suggestion",
|
|
5481
5484
|
fixable: false,
|
|
5482
5485
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5528,6 +5531,7 @@ var classSelfMismatch = createDiagnostic({
|
|
|
5528
5531
|
name: "classSelfMismatch",
|
|
5529
5532
|
code: 20,
|
|
5530
5533
|
description: "Ensures Self type parameter matches the class name in Service/Tag/Schema classes",
|
|
5534
|
+
group: "correctness",
|
|
5531
5535
|
severity: "error",
|
|
5532
5536
|
fixable: true,
|
|
5533
5537
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5668,6 +5672,7 @@ var deterministicKeys = createDiagnostic({
|
|
|
5668
5672
|
name: "deterministicKeys",
|
|
5669
5673
|
code: 25,
|
|
5670
5674
|
description: "Enforces deterministic naming for service/tag/error identifiers based on class names",
|
|
5675
|
+
group: "style",
|
|
5671
5676
|
severity: "off",
|
|
5672
5677
|
fixable: true,
|
|
5673
5678
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5787,6 +5792,7 @@ var duplicatePackage = createDiagnostic({
|
|
|
5787
5792
|
name: "duplicatePackage",
|
|
5788
5793
|
code: 6,
|
|
5789
5794
|
description: "Detects when multiple versions of the same Effect package are loaded",
|
|
5795
|
+
group: "correctness",
|
|
5790
5796
|
severity: "warning",
|
|
5791
5797
|
fixable: false,
|
|
5792
5798
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5818,6 +5824,7 @@ var effectFnIife = createDiagnostic({
|
|
|
5818
5824
|
name: "effectFnIife",
|
|
5819
5825
|
code: 46,
|
|
5820
5826
|
description: "Effect.fn or Effect.fnUntraced is called as an IIFE (Immediately Invoked Function Expression). Use Effect.gen instead.",
|
|
5827
|
+
group: "antipattern",
|
|
5821
5828
|
severity: "warning",
|
|
5822
5829
|
fixable: true,
|
|
5823
5830
|
supportedEffect: ["v3", "v4"],
|
|
@@ -5922,6 +5929,7 @@ var effectFnOpportunity = createDiagnostic({
|
|
|
5922
5929
|
name: "effectFnOpportunity",
|
|
5923
5930
|
code: 41,
|
|
5924
5931
|
description: "Suggests using Effect.fn for functions that returns an Effect",
|
|
5932
|
+
group: "style",
|
|
5925
5933
|
severity: "suggestion",
|
|
5926
5934
|
fixable: true,
|
|
5927
5935
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6516,6 +6524,7 @@ var effectGenUsesAdapter = createDiagnostic({
|
|
|
6516
6524
|
name: "effectGenUsesAdapter",
|
|
6517
6525
|
code: 23,
|
|
6518
6526
|
description: "Warns when using the deprecated adapter parameter in Effect.gen",
|
|
6527
|
+
group: "antipattern",
|
|
6519
6528
|
severity: "warning",
|
|
6520
6529
|
fixable: false,
|
|
6521
6530
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6556,6 +6565,7 @@ var effectInFailure = createDiagnostic({
|
|
|
6556
6565
|
name: "effectInFailure",
|
|
6557
6566
|
code: 49,
|
|
6558
6567
|
description: "Warns when an Effect is used inside an Effect failure channel",
|
|
6568
|
+
group: "antipattern",
|
|
6559
6569
|
severity: "warning",
|
|
6560
6570
|
fixable: false,
|
|
6561
6571
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6622,6 +6632,7 @@ var effectInVoidSuccess = createDiagnostic({
|
|
|
6622
6632
|
name: "effectInVoidSuccess",
|
|
6623
6633
|
code: 14,
|
|
6624
6634
|
description: "Detects nested Effects in void success channels that may cause unexecuted effects",
|
|
6635
|
+
group: "antipattern",
|
|
6625
6636
|
severity: "warning",
|
|
6626
6637
|
fixable: false,
|
|
6627
6638
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6673,6 +6684,7 @@ var effectMapVoid = createDiagnostic({
|
|
|
6673
6684
|
name: "effectMapVoid",
|
|
6674
6685
|
code: 40,
|
|
6675
6686
|
description: "Suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {})",
|
|
6687
|
+
group: "style",
|
|
6676
6688
|
severity: "suggestion",
|
|
6677
6689
|
fixable: true,
|
|
6678
6690
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6739,6 +6751,7 @@ var effectSucceedWithVoid = createDiagnostic({
|
|
|
6739
6751
|
name: "effectSucceedWithVoid",
|
|
6740
6752
|
code: 47,
|
|
6741
6753
|
description: "Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0)",
|
|
6754
|
+
group: "style",
|
|
6742
6755
|
severity: "suggestion",
|
|
6743
6756
|
fixable: true,
|
|
6744
6757
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6792,6 +6805,7 @@ var extendsNativeError = createDiagnostic({
|
|
|
6792
6805
|
name: "extendsNativeError",
|
|
6793
6806
|
code: 50,
|
|
6794
6807
|
description: "Warns when a class directly extends the native Error class",
|
|
6808
|
+
group: "effectNative",
|
|
6795
6809
|
severity: "off",
|
|
6796
6810
|
fixable: false,
|
|
6797
6811
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6844,6 +6858,7 @@ var floatingEffect = createDiagnostic({
|
|
|
6844
6858
|
name: "floatingEffect",
|
|
6845
6859
|
code: 3,
|
|
6846
6860
|
description: "Ensures Effects are yielded or assigned to variables, not left floating",
|
|
6861
|
+
group: "correctness",
|
|
6847
6862
|
severity: "error",
|
|
6848
6863
|
fixable: false,
|
|
6849
6864
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6897,6 +6912,7 @@ var genericEffectServices = createDiagnostic({
|
|
|
6897
6912
|
name: "genericEffectServices",
|
|
6898
6913
|
code: 10,
|
|
6899
6914
|
description: "Prevents services with type parameters that cannot be discriminated at runtime",
|
|
6915
|
+
group: "correctness",
|
|
6900
6916
|
severity: "warning",
|
|
6901
6917
|
fixable: false,
|
|
6902
6918
|
supportedEffect: ["v3", "v4"],
|
|
@@ -6946,6 +6962,7 @@ var globalErrorInEffectCatch = createDiagnostic({
|
|
|
6946
6962
|
name: "globalErrorInEffectCatch",
|
|
6947
6963
|
code: 36,
|
|
6948
6964
|
description: "Warns when catch callbacks return global Error type instead of typed errors",
|
|
6965
|
+
group: "antipattern",
|
|
6949
6966
|
severity: "warning",
|
|
6950
6967
|
fixable: false,
|
|
6951
6968
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7008,6 +7025,7 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
7008
7025
|
name: "globalErrorInEffectFailure",
|
|
7009
7026
|
code: 35,
|
|
7010
7027
|
description: "Warns when the global Error type is used in an Effect failure channel",
|
|
7028
|
+
group: "antipattern",
|
|
7011
7029
|
severity: "warning",
|
|
7012
7030
|
fixable: false,
|
|
7013
7031
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7058,11 +7076,54 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
7058
7076
|
})
|
|
7059
7077
|
});
|
|
7060
7078
|
|
|
7079
|
+
// src/diagnostics/globalFetch.ts
|
|
7080
|
+
var globalFetch = createDiagnostic({
|
|
7081
|
+
name: "globalFetch",
|
|
7082
|
+
code: 53,
|
|
7083
|
+
description: "Warns when using the global fetch function instead of the Effect HTTP client",
|
|
7084
|
+
group: "effectNative",
|
|
7085
|
+
severity: "off",
|
|
7086
|
+
fixable: false,
|
|
7087
|
+
supportedEffect: ["v3", "v4"],
|
|
7088
|
+
apply: fn("globalFetch.apply")(function* (sourceFile, report) {
|
|
7089
|
+
const ts = yield* service(TypeScriptApi);
|
|
7090
|
+
const typeChecker = yield* service(TypeCheckerApi);
|
|
7091
|
+
const typeParser = yield* service(TypeParser);
|
|
7092
|
+
const fetchSymbol = typeChecker.resolveName("fetch", void 0, ts.SymbolFlags.Value, false);
|
|
7093
|
+
if (!fetchSymbol) return;
|
|
7094
|
+
const effectVersion = typeParser.supportedEffect();
|
|
7095
|
+
const packageName = effectVersion === "v3" ? "@effect/platform" : "effect/unstable/http";
|
|
7096
|
+
const messageText = `Prefer using HttpClient from ${packageName} instead of the global 'fetch' function.`;
|
|
7097
|
+
const nodeToVisit = [];
|
|
7098
|
+
const appendNodeToVisit = (node) => {
|
|
7099
|
+
nodeToVisit.push(node);
|
|
7100
|
+
return void 0;
|
|
7101
|
+
};
|
|
7102
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
7103
|
+
while (nodeToVisit.length > 0) {
|
|
7104
|
+
const node = nodeToVisit.shift();
|
|
7105
|
+
if (ts.isCallExpression(node)) {
|
|
7106
|
+
const symbol3 = typeChecker.getSymbolAtLocation(node.expression);
|
|
7107
|
+
const resolvedSymbol = symbol3 && symbol3.flags & ts.SymbolFlags.Alias ? typeChecker.getAliasedSymbol(symbol3) : symbol3;
|
|
7108
|
+
if (resolvedSymbol === fetchSymbol) {
|
|
7109
|
+
report({
|
|
7110
|
+
location: node.expression,
|
|
7111
|
+
messageText,
|
|
7112
|
+
fixes: []
|
|
7113
|
+
});
|
|
7114
|
+
}
|
|
7115
|
+
}
|
|
7116
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
7117
|
+
}
|
|
7118
|
+
})
|
|
7119
|
+
});
|
|
7120
|
+
|
|
7061
7121
|
// src/diagnostics/importFromBarrel.ts
|
|
7062
7122
|
var importFromBarrel = createDiagnostic({
|
|
7063
7123
|
name: "importFromBarrel",
|
|
7064
7124
|
code: 12,
|
|
7065
7125
|
description: "Suggests importing from specific module paths instead of barrel exports",
|
|
7126
|
+
group: "style",
|
|
7066
7127
|
severity: "off",
|
|
7067
7128
|
fixable: true,
|
|
7068
7129
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7205,6 +7266,7 @@ var instanceOfSchema = createDiagnostic({
|
|
|
7205
7266
|
name: "instanceOfSchema",
|
|
7206
7267
|
code: 45,
|
|
7207
7268
|
description: "Suggests using Schema.is instead of instanceof for Effect Schema types",
|
|
7269
|
+
group: "effectNative",
|
|
7208
7270
|
severity: "off",
|
|
7209
7271
|
fixable: true,
|
|
7210
7272
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7270,6 +7332,7 @@ var layerMergeAllWithDependencies = createDiagnostic({
|
|
|
7270
7332
|
name: "layerMergeAllWithDependencies",
|
|
7271
7333
|
code: 37,
|
|
7272
7334
|
description: "Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires",
|
|
7335
|
+
group: "antipattern",
|
|
7273
7336
|
severity: "warning",
|
|
7274
7337
|
fixable: true,
|
|
7275
7338
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7385,6 +7448,7 @@ var leakingRequirements = createDiagnostic({
|
|
|
7385
7448
|
name: "leakingRequirements",
|
|
7386
7449
|
code: 8,
|
|
7387
7450
|
description: "Detects implementation services leaked in service methods",
|
|
7451
|
+
group: "antipattern",
|
|
7388
7452
|
severity: "suggestion",
|
|
7389
7453
|
fixable: false,
|
|
7390
7454
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7541,6 +7605,7 @@ var missedPipeableOpportunity = createDiagnostic({
|
|
|
7541
7605
|
name: "missedPipeableOpportunity",
|
|
7542
7606
|
code: 26,
|
|
7543
7607
|
description: "Enforces the use of pipeable style for nested function calls",
|
|
7608
|
+
group: "style",
|
|
7544
7609
|
severity: "off",
|
|
7545
7610
|
fixable: true,
|
|
7546
7611
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7723,6 +7788,7 @@ var missingEffectContext = createDiagnostic({
|
|
|
7723
7788
|
name: "missingEffectContext",
|
|
7724
7789
|
code: 1,
|
|
7725
7790
|
description: "Reports missing service requirements in Effect context channel",
|
|
7791
|
+
group: "correctness",
|
|
7726
7792
|
severity: "error",
|
|
7727
7793
|
fixable: false,
|
|
7728
7794
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7774,6 +7840,7 @@ var missingEffectError = createDiagnostic({
|
|
|
7774
7840
|
name: "missingEffectError",
|
|
7775
7841
|
code: 1,
|
|
7776
7842
|
description: "Reports missing error types in Effect error channel",
|
|
7843
|
+
group: "correctness",
|
|
7777
7844
|
severity: "error",
|
|
7778
7845
|
fixable: true,
|
|
7779
7846
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7917,6 +7984,7 @@ var missingEffectServiceDependency = createDiagnostic({
|
|
|
7917
7984
|
name: "missingEffectServiceDependency",
|
|
7918
7985
|
code: 22,
|
|
7919
7986
|
description: "Checks that Effect.Service dependencies satisfy all required layer inputs",
|
|
7987
|
+
group: "style",
|
|
7920
7988
|
severity: "off",
|
|
7921
7989
|
fixable: false,
|
|
7922
7990
|
supportedEffect: ["v3"],
|
|
@@ -8013,6 +8081,7 @@ var missingLayerContext = createDiagnostic({
|
|
|
8013
8081
|
name: "missingLayerContext",
|
|
8014
8082
|
code: 38,
|
|
8015
8083
|
description: "Reports missing service requirements in Layer context channel",
|
|
8084
|
+
group: "correctness",
|
|
8016
8085
|
severity: "error",
|
|
8017
8086
|
fixable: false,
|
|
8018
8087
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8064,6 +8133,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
8064
8133
|
name: "missingReturnYieldStar",
|
|
8065
8134
|
code: 7,
|
|
8066
8135
|
description: "Suggests using 'return yield*' for Effects with never success for better type narrowing",
|
|
8136
|
+
group: "correctness",
|
|
8067
8137
|
severity: "error",
|
|
8068
8138
|
fixable: true,
|
|
8069
8139
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8116,6 +8186,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
|
|
|
8116
8186
|
name: "missingStarInYieldEffectGen",
|
|
8117
8187
|
code: 4,
|
|
8118
8188
|
description: "Enforces using 'yield*' instead of 'yield' when yielding Effects in generators",
|
|
8189
|
+
group: "correctness",
|
|
8119
8190
|
severity: "error",
|
|
8120
8191
|
fixable: true,
|
|
8121
8192
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8193,6 +8264,7 @@ var multipleEffectProvide = createDiagnostic({
|
|
|
8193
8264
|
name: "multipleEffectProvide",
|
|
8194
8265
|
code: 18,
|
|
8195
8266
|
description: "Warns against chaining Effect.provide calls which can cause service lifecycle issues",
|
|
8267
|
+
group: "antipattern",
|
|
8196
8268
|
severity: "warning",
|
|
8197
8269
|
fixable: true,
|
|
8198
8270
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8295,7 +8367,11 @@ var moduleAlternativesV3 = /* @__PURE__ */ new Map([
|
|
|
8295
8367
|
["path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
8296
8368
|
["node:path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
8297
8369
|
["child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
8298
|
-
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }]
|
|
8370
|
+
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
8371
|
+
["http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
8372
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
8373
|
+
["https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }],
|
|
8374
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }]
|
|
8299
8375
|
]);
|
|
8300
8376
|
var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
8301
8377
|
["fs", { alternative: "FileSystem", module: "fs", package: "effect" }],
|
|
@@ -8309,12 +8385,17 @@ var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
|
8309
8385
|
["path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
8310
8386
|
["node:path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
8311
8387
|
["child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
8312
|
-
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }]
|
|
8388
|
+
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
8389
|
+
["http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
8390
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
8391
|
+
["https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }],
|
|
8392
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }]
|
|
8313
8393
|
]);
|
|
8314
8394
|
var nodeBuiltinImport = createDiagnostic({
|
|
8315
8395
|
name: "nodeBuiltinImport",
|
|
8316
8396
|
code: 52,
|
|
8317
8397
|
description: "Warns when importing Node.js built-in modules that have Effect-native counterparts",
|
|
8398
|
+
group: "effectNative",
|
|
8318
8399
|
severity: "off",
|
|
8319
8400
|
fixable: false,
|
|
8320
8401
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8358,6 +8439,7 @@ var nonObjectEffectServiceType = createDiagnostic({
|
|
|
8358
8439
|
name: "nonObjectEffectServiceType",
|
|
8359
8440
|
code: 24,
|
|
8360
8441
|
description: "Ensures Effect.Service types are objects, not primitives",
|
|
8442
|
+
group: "correctness",
|
|
8361
8443
|
severity: "error",
|
|
8362
8444
|
fixable: false,
|
|
8363
8445
|
supportedEffect: ["v3"],
|
|
@@ -9142,6 +9224,7 @@ var outdatedApi = createDiagnostic({
|
|
|
9142
9224
|
name: "outdatedApi",
|
|
9143
9225
|
code: 48,
|
|
9144
9226
|
description: "Detects usage of APIs that have been removed or renamed in Effect v4",
|
|
9227
|
+
group: "correctness",
|
|
9145
9228
|
severity: "warning",
|
|
9146
9229
|
fixable: false,
|
|
9147
9230
|
supportedEffect: ["v4"],
|
|
@@ -10280,6 +10363,7 @@ var outdatedEffectCodegen = createDiagnostic({
|
|
|
10280
10363
|
name: "outdatedEffectCodegen",
|
|
10281
10364
|
code: 19,
|
|
10282
10365
|
description: "Detects when generated code is outdated and needs to be regenerated",
|
|
10366
|
+
group: "correctness",
|
|
10283
10367
|
severity: "warning",
|
|
10284
10368
|
fixable: true,
|
|
10285
10369
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10328,6 +10412,7 @@ var overriddenSchemaConstructor = createDiagnostic({
|
|
|
10328
10412
|
name: "overriddenSchemaConstructor",
|
|
10329
10413
|
code: 30,
|
|
10330
10414
|
description: "Prevents overriding constructors in Schema classes which breaks decoding behavior",
|
|
10415
|
+
group: "correctness",
|
|
10331
10416
|
severity: "error",
|
|
10332
10417
|
fixable: true,
|
|
10333
10418
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10467,6 +10552,7 @@ var preferSchemaOverJson = createDiagnostic({
|
|
|
10467
10552
|
name: "preferSchemaOverJson",
|
|
10468
10553
|
code: 44,
|
|
10469
10554
|
description: "Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify which may throw",
|
|
10555
|
+
group: "effectNative",
|
|
10470
10556
|
severity: "suggestion",
|
|
10471
10557
|
fixable: false,
|
|
10472
10558
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10579,6 +10665,7 @@ var redundantSchemaTagIdentifier = createDiagnostic({
|
|
|
10579
10665
|
name: "redundantSchemaTagIdentifier",
|
|
10580
10666
|
code: 42,
|
|
10581
10667
|
description: "Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest",
|
|
10668
|
+
group: "style",
|
|
10582
10669
|
severity: "suggestion",
|
|
10583
10670
|
fixable: true,
|
|
10584
10671
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10631,6 +10718,7 @@ var returnEffectInGen = createDiagnostic({
|
|
|
10631
10718
|
name: "returnEffectInGen",
|
|
10632
10719
|
code: 11,
|
|
10633
10720
|
description: "Warns when returning an Effect in a generator causes nested Effect<Effect<...>>",
|
|
10721
|
+
group: "antipattern",
|
|
10634
10722
|
severity: "suggestion",
|
|
10635
10723
|
fixable: true,
|
|
10636
10724
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10702,6 +10790,7 @@ var runEffectInsideEffect = createDiagnostic({
|
|
|
10702
10790
|
name: "runEffectInsideEffect",
|
|
10703
10791
|
code: 32,
|
|
10704
10792
|
description: "Suggests using Runtime methods instead of Effect.run* inside Effect contexts",
|
|
10793
|
+
group: "antipattern",
|
|
10705
10794
|
severity: "suggestion",
|
|
10706
10795
|
fixable: true,
|
|
10707
10796
|
supportedEffect: ["v3"],
|
|
@@ -10828,6 +10917,7 @@ var schemaStructWithTag = createDiagnostic({
|
|
|
10828
10917
|
name: "schemaStructWithTag",
|
|
10829
10918
|
code: 34,
|
|
10830
10919
|
description: "Suggests using Schema.TaggedStruct instead of Schema.Struct with _tag field",
|
|
10920
|
+
group: "style",
|
|
10831
10921
|
severity: "suggestion",
|
|
10832
10922
|
fixable: true,
|
|
10833
10923
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10922,9 +11012,10 @@ var schemaSyncInEffect = createDiagnostic({
|
|
|
10922
11012
|
name: "schemaSyncInEffect",
|
|
10923
11013
|
code: 43,
|
|
10924
11014
|
description: "Suggests using Effect-based Schema methods instead of sync methods inside Effect generators",
|
|
11015
|
+
group: "antipattern",
|
|
10925
11016
|
severity: "suggestion",
|
|
10926
11017
|
fixable: false,
|
|
10927
|
-
supportedEffect: ["v3"
|
|
11018
|
+
supportedEffect: ["v3"],
|
|
10928
11019
|
apply: fn("schemaSyncInEffect.apply")(function* (sourceFile, report) {
|
|
10929
11020
|
const ts = yield* service(TypeScriptApi);
|
|
10930
11021
|
const typeParser = yield* service(TypeParser);
|
|
@@ -10973,6 +11064,7 @@ var schemaUnionOfLiterals = createDiagnostic({
|
|
|
10973
11064
|
name: "schemaUnionOfLiterals",
|
|
10974
11065
|
code: 33,
|
|
10975
11066
|
description: "Simplifies Schema.Union of multiple Schema.Literal calls into single Schema.Literal",
|
|
11067
|
+
group: "style",
|
|
10976
11068
|
severity: "off",
|
|
10977
11069
|
fixable: true,
|
|
10978
11070
|
supportedEffect: ["v3"],
|
|
@@ -11050,6 +11142,7 @@ var scopeInLayerEffect = createDiagnostic({
|
|
|
11050
11142
|
name: "scopeInLayerEffect",
|
|
11051
11143
|
code: 13,
|
|
11052
11144
|
description: "Suggests using Layer.scoped instead of Layer.effect when Scope is in requirements",
|
|
11145
|
+
group: "antipattern",
|
|
11053
11146
|
severity: "warning",
|
|
11054
11147
|
fixable: true,
|
|
11055
11148
|
supportedEffect: ["v3"],
|
|
@@ -11147,6 +11240,7 @@ var serviceNotAsClass = createDiagnostic({
|
|
|
11147
11240
|
name: "serviceNotAsClass",
|
|
11148
11241
|
code: 51,
|
|
11149
11242
|
description: "Warns when ServiceMap.Service is used as a variable instead of a class declaration",
|
|
11243
|
+
group: "style",
|
|
11150
11244
|
severity: "off",
|
|
11151
11245
|
fixable: true,
|
|
11152
11246
|
supportedEffect: ["v4"],
|
|
@@ -11224,6 +11318,7 @@ var strictBooleanExpressions = createDiagnostic({
|
|
|
11224
11318
|
name: "strictBooleanExpressions",
|
|
11225
11319
|
code: 17,
|
|
11226
11320
|
description: "Enforces boolean types in conditional expressions for type safety",
|
|
11321
|
+
group: "style",
|
|
11227
11322
|
severity: "off",
|
|
11228
11323
|
fixable: false,
|
|
11229
11324
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11297,6 +11392,7 @@ var strictEffectProvide = createDiagnostic({
|
|
|
11297
11392
|
name: "strictEffectProvide",
|
|
11298
11393
|
code: 27,
|
|
11299
11394
|
description: "Warns when using Effect.provide with layers outside of application entry points",
|
|
11395
|
+
group: "antipattern",
|
|
11300
11396
|
severity: "off",
|
|
11301
11397
|
fixable: false,
|
|
11302
11398
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11350,6 +11446,7 @@ var tryCatchInEffectGen = createDiagnostic({
|
|
|
11350
11446
|
name: "tryCatchInEffectGen",
|
|
11351
11447
|
code: 15,
|
|
11352
11448
|
description: "Discourages try/catch in Effect generators in favor of Effect error handling",
|
|
11449
|
+
group: "antipattern",
|
|
11353
11450
|
severity: "suggestion",
|
|
11354
11451
|
fixable: false,
|
|
11355
11452
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11409,6 +11506,7 @@ var unknownInEffectCatch = createDiagnostic({
|
|
|
11409
11506
|
name: "unknownInEffectCatch",
|
|
11410
11507
|
code: 31,
|
|
11411
11508
|
description: "Warns when catch callbacks return unknown instead of typed errors",
|
|
11509
|
+
group: "antipattern",
|
|
11412
11510
|
severity: "warning",
|
|
11413
11511
|
fixable: false,
|
|
11414
11512
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11472,6 +11570,7 @@ var unnecessaryEffectGen = createDiagnostic({
|
|
|
11472
11570
|
name: "unnecessaryEffectGen",
|
|
11473
11571
|
code: 5,
|
|
11474
11572
|
description: "Suggests removing Effect.gen when it contains only a single return statement",
|
|
11573
|
+
group: "style",
|
|
11475
11574
|
severity: "suggestion",
|
|
11476
11575
|
fixable: true,
|
|
11477
11576
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11518,6 +11617,7 @@ var unnecessaryFailYieldableError = createDiagnostic({
|
|
|
11518
11617
|
name: "unnecessaryFailYieldableError",
|
|
11519
11618
|
code: 29,
|
|
11520
11619
|
description: "Suggests yielding yieldable errors directly instead of wrapping with Effect.fail",
|
|
11620
|
+
group: "style",
|
|
11521
11621
|
severity: "suggestion",
|
|
11522
11622
|
fixable: true,
|
|
11523
11623
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11579,6 +11679,7 @@ var unnecessaryPipe = createDiagnostic({
|
|
|
11579
11679
|
name: "unnecessaryPipe",
|
|
11580
11680
|
code: 9,
|
|
11581
11681
|
description: "Removes pipe calls with no arguments",
|
|
11682
|
+
group: "style",
|
|
11582
11683
|
severity: "suggestion",
|
|
11583
11684
|
fixable: true,
|
|
11584
11685
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11627,6 +11728,7 @@ var unnecessaryPipeChain = createDiagnostic({
|
|
|
11627
11728
|
name: "unnecessaryPipeChain",
|
|
11628
11729
|
code: 16,
|
|
11629
11730
|
description: "Simplifies chained pipe calls into a single pipe call",
|
|
11731
|
+
group: "style",
|
|
11630
11732
|
severity: "suggestion",
|
|
11631
11733
|
fixable: true,
|
|
11632
11734
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11704,6 +11806,7 @@ var unsupportedServiceAccessors = createDiagnostic({
|
|
|
11704
11806
|
name: "unsupportedServiceAccessors",
|
|
11705
11807
|
code: 21,
|
|
11706
11808
|
description: "Warns about service accessors that need codegen due to generic/complex signatures",
|
|
11809
|
+
group: "correctness",
|
|
11707
11810
|
severity: "warning",
|
|
11708
11811
|
fixable: true,
|
|
11709
11812
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11781,6 +11884,7 @@ var diagnostics = [
|
|
|
11781
11884
|
leakingRequirements,
|
|
11782
11885
|
unnecessaryPipe,
|
|
11783
11886
|
genericEffectServices,
|
|
11887
|
+
globalFetch,
|
|
11784
11888
|
returnEffectInGen,
|
|
11785
11889
|
tryCatchInEffectGen,
|
|
11786
11890
|
importFromBarrel,
|