@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/index.js
CHANGED
|
@@ -7153,6 +7153,7 @@ var anyUnknownInErrorContext = createDiagnostic({
|
|
|
7153
7153
|
name: "anyUnknownInErrorContext",
|
|
7154
7154
|
code: 28,
|
|
7155
7155
|
description: "Detects 'any' or 'unknown' types in Effect error or requirements channels",
|
|
7156
|
+
group: "correctness",
|
|
7156
7157
|
severity: "off",
|
|
7157
7158
|
fixable: false,
|
|
7158
7159
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7258,6 +7259,7 @@ var catchAllToMapError = createDiagnostic({
|
|
|
7258
7259
|
name: "catchAllToMapError",
|
|
7259
7260
|
code: 39,
|
|
7260
7261
|
description: "Suggests using Effect.mapError instead of Effect.catchAll when the callback only wraps the error with Effect.fail",
|
|
7262
|
+
group: "style",
|
|
7261
7263
|
severity: "suggestion",
|
|
7262
7264
|
fixable: true,
|
|
7263
7265
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7357,6 +7359,7 @@ var catchUnfailableEffect = createDiagnostic({
|
|
|
7357
7359
|
name: "catchUnfailableEffect",
|
|
7358
7360
|
code: 2,
|
|
7359
7361
|
description: "Warns when using error handling on Effects that never fail (error type is 'never')",
|
|
7362
|
+
group: "antipattern",
|
|
7360
7363
|
severity: "suggestion",
|
|
7361
7364
|
fixable: false,
|
|
7362
7365
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7408,6 +7411,7 @@ var classSelfMismatch = createDiagnostic({
|
|
|
7408
7411
|
name: "classSelfMismatch",
|
|
7409
7412
|
code: 20,
|
|
7410
7413
|
description: "Ensures Self type parameter matches the class name in Service/Tag/Schema classes",
|
|
7414
|
+
group: "correctness",
|
|
7411
7415
|
severity: "error",
|
|
7412
7416
|
fixable: true,
|
|
7413
7417
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7482,6 +7486,7 @@ var deterministicKeys = createDiagnostic({
|
|
|
7482
7486
|
name: "deterministicKeys",
|
|
7483
7487
|
code: 25,
|
|
7484
7488
|
description: "Enforces deterministic naming for service/tag/error identifiers based on class names",
|
|
7489
|
+
group: "style",
|
|
7485
7490
|
severity: "off",
|
|
7486
7491
|
fixable: true,
|
|
7487
7492
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7601,6 +7606,7 @@ var duplicatePackage = createDiagnostic({
|
|
|
7601
7606
|
name: "duplicatePackage",
|
|
7602
7607
|
code: 6,
|
|
7603
7608
|
description: "Detects when multiple versions of the same Effect package are loaded",
|
|
7609
|
+
group: "correctness",
|
|
7604
7610
|
severity: "warning",
|
|
7605
7611
|
fixable: false,
|
|
7606
7612
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7632,6 +7638,7 @@ var effectFnIife = createDiagnostic({
|
|
|
7632
7638
|
name: "effectFnIife",
|
|
7633
7639
|
code: 46,
|
|
7634
7640
|
description: "Effect.fn or Effect.fnUntraced is called as an IIFE (Immediately Invoked Function Expression). Use Effect.gen instead.",
|
|
7641
|
+
group: "antipattern",
|
|
7635
7642
|
severity: "warning",
|
|
7636
7643
|
fixable: true,
|
|
7637
7644
|
supportedEffect: ["v3", "v4"],
|
|
@@ -7736,6 +7743,7 @@ var effectFnOpportunity = createDiagnostic({
|
|
|
7736
7743
|
name: "effectFnOpportunity",
|
|
7737
7744
|
code: 41,
|
|
7738
7745
|
description: "Suggests using Effect.fn for functions that returns an Effect",
|
|
7746
|
+
group: "style",
|
|
7739
7747
|
severity: "suggestion",
|
|
7740
7748
|
fixable: true,
|
|
7741
7749
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8330,6 +8338,7 @@ var effectGenUsesAdapter = createDiagnostic({
|
|
|
8330
8338
|
name: "effectGenUsesAdapter",
|
|
8331
8339
|
code: 23,
|
|
8332
8340
|
description: "Warns when using the deprecated adapter parameter in Effect.gen",
|
|
8341
|
+
group: "antipattern",
|
|
8333
8342
|
severity: "warning",
|
|
8334
8343
|
fixable: false,
|
|
8335
8344
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8370,6 +8379,7 @@ var effectInFailure = createDiagnostic({
|
|
|
8370
8379
|
name: "effectInFailure",
|
|
8371
8380
|
code: 49,
|
|
8372
8381
|
description: "Warns when an Effect is used inside an Effect failure channel",
|
|
8382
|
+
group: "antipattern",
|
|
8373
8383
|
severity: "warning",
|
|
8374
8384
|
fixable: false,
|
|
8375
8385
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8436,6 +8446,7 @@ var effectInVoidSuccess = createDiagnostic({
|
|
|
8436
8446
|
name: "effectInVoidSuccess",
|
|
8437
8447
|
code: 14,
|
|
8438
8448
|
description: "Detects nested Effects in void success channels that may cause unexecuted effects",
|
|
8449
|
+
group: "antipattern",
|
|
8439
8450
|
severity: "warning",
|
|
8440
8451
|
fixable: false,
|
|
8441
8452
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8487,6 +8498,7 @@ var effectMapVoid = createDiagnostic({
|
|
|
8487
8498
|
name: "effectMapVoid",
|
|
8488
8499
|
code: 40,
|
|
8489
8500
|
description: "Suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {})",
|
|
8501
|
+
group: "style",
|
|
8490
8502
|
severity: "suggestion",
|
|
8491
8503
|
fixable: true,
|
|
8492
8504
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8553,6 +8565,7 @@ var effectSucceedWithVoid = createDiagnostic({
|
|
|
8553
8565
|
name: "effectSucceedWithVoid",
|
|
8554
8566
|
code: 47,
|
|
8555
8567
|
description: "Suggests using Effect.void instead of Effect.succeed(undefined) or Effect.succeed(void 0)",
|
|
8568
|
+
group: "style",
|
|
8556
8569
|
severity: "suggestion",
|
|
8557
8570
|
fixable: true,
|
|
8558
8571
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8606,6 +8619,7 @@ var extendsNativeError = createDiagnostic({
|
|
|
8606
8619
|
name: "extendsNativeError",
|
|
8607
8620
|
code: 50,
|
|
8608
8621
|
description: "Warns when a class directly extends the native Error class",
|
|
8622
|
+
group: "effectNative",
|
|
8609
8623
|
severity: "off",
|
|
8610
8624
|
fixable: false,
|
|
8611
8625
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8658,6 +8672,7 @@ var floatingEffect = createDiagnostic({
|
|
|
8658
8672
|
name: "floatingEffect",
|
|
8659
8673
|
code: 3,
|
|
8660
8674
|
description: "Ensures Effects are yielded or assigned to variables, not left floating",
|
|
8675
|
+
group: "correctness",
|
|
8661
8676
|
severity: "error",
|
|
8662
8677
|
fixable: false,
|
|
8663
8678
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8711,6 +8726,7 @@ var genericEffectServices = createDiagnostic({
|
|
|
8711
8726
|
name: "genericEffectServices",
|
|
8712
8727
|
code: 10,
|
|
8713
8728
|
description: "Prevents services with type parameters that cannot be discriminated at runtime",
|
|
8729
|
+
group: "correctness",
|
|
8714
8730
|
severity: "warning",
|
|
8715
8731
|
fixable: false,
|
|
8716
8732
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8760,6 +8776,7 @@ var globalErrorInEffectCatch = createDiagnostic({
|
|
|
8760
8776
|
name: "globalErrorInEffectCatch",
|
|
8761
8777
|
code: 36,
|
|
8762
8778
|
description: "Warns when catch callbacks return global Error type instead of typed errors",
|
|
8779
|
+
group: "antipattern",
|
|
8763
8780
|
severity: "warning",
|
|
8764
8781
|
fixable: false,
|
|
8765
8782
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8822,6 +8839,7 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
8822
8839
|
name: "globalErrorInEffectFailure",
|
|
8823
8840
|
code: 35,
|
|
8824
8841
|
description: "Warns when the global Error type is used in an Effect failure channel",
|
|
8842
|
+
group: "antipattern",
|
|
8825
8843
|
severity: "warning",
|
|
8826
8844
|
fixable: false,
|
|
8827
8845
|
supportedEffect: ["v3", "v4"],
|
|
@@ -8872,11 +8890,54 @@ var globalErrorInEffectFailure = createDiagnostic({
|
|
|
8872
8890
|
})
|
|
8873
8891
|
});
|
|
8874
8892
|
|
|
8893
|
+
// src/diagnostics/globalFetch.ts
|
|
8894
|
+
var globalFetch = createDiagnostic({
|
|
8895
|
+
name: "globalFetch",
|
|
8896
|
+
code: 53,
|
|
8897
|
+
description: "Warns when using the global fetch function instead of the Effect HTTP client",
|
|
8898
|
+
group: "effectNative",
|
|
8899
|
+
severity: "off",
|
|
8900
|
+
fixable: false,
|
|
8901
|
+
supportedEffect: ["v3", "v4"],
|
|
8902
|
+
apply: fn("globalFetch.apply")(function* (sourceFile, report) {
|
|
8903
|
+
const ts = yield* service(TypeScriptApi);
|
|
8904
|
+
const typeChecker = yield* service(TypeCheckerApi);
|
|
8905
|
+
const typeParser = yield* service(TypeParser);
|
|
8906
|
+
const fetchSymbol = typeChecker.resolveName("fetch", void 0, ts.SymbolFlags.Value, false);
|
|
8907
|
+
if (!fetchSymbol) return;
|
|
8908
|
+
const effectVersion = typeParser.supportedEffect();
|
|
8909
|
+
const packageName = effectVersion === "v3" ? "@effect/platform" : "effect/unstable/http";
|
|
8910
|
+
const messageText = `Prefer using HttpClient from ${packageName} instead of the global 'fetch' function.`;
|
|
8911
|
+
const nodeToVisit = [];
|
|
8912
|
+
const appendNodeToVisit = (node) => {
|
|
8913
|
+
nodeToVisit.push(node);
|
|
8914
|
+
return void 0;
|
|
8915
|
+
};
|
|
8916
|
+
ts.forEachChild(sourceFile, appendNodeToVisit);
|
|
8917
|
+
while (nodeToVisit.length > 0) {
|
|
8918
|
+
const node = nodeToVisit.shift();
|
|
8919
|
+
if (ts.isCallExpression(node)) {
|
|
8920
|
+
const symbol3 = typeChecker.getSymbolAtLocation(node.expression);
|
|
8921
|
+
const resolvedSymbol = symbol3 && symbol3.flags & ts.SymbolFlags.Alias ? typeChecker.getAliasedSymbol(symbol3) : symbol3;
|
|
8922
|
+
if (resolvedSymbol === fetchSymbol) {
|
|
8923
|
+
report({
|
|
8924
|
+
location: node.expression,
|
|
8925
|
+
messageText,
|
|
8926
|
+
fixes: []
|
|
8927
|
+
});
|
|
8928
|
+
}
|
|
8929
|
+
}
|
|
8930
|
+
ts.forEachChild(node, appendNodeToVisit);
|
|
8931
|
+
}
|
|
8932
|
+
})
|
|
8933
|
+
});
|
|
8934
|
+
|
|
8875
8935
|
// src/diagnostics/importFromBarrel.ts
|
|
8876
8936
|
var importFromBarrel = createDiagnostic({
|
|
8877
8937
|
name: "importFromBarrel",
|
|
8878
8938
|
code: 12,
|
|
8879
8939
|
description: "Suggests importing from specific module paths instead of barrel exports",
|
|
8940
|
+
group: "style",
|
|
8880
8941
|
severity: "off",
|
|
8881
8942
|
fixable: true,
|
|
8882
8943
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9019,6 +9080,7 @@ var instanceOfSchema = createDiagnostic({
|
|
|
9019
9080
|
name: "instanceOfSchema",
|
|
9020
9081
|
code: 45,
|
|
9021
9082
|
description: "Suggests using Schema.is instead of instanceof for Effect Schema types",
|
|
9083
|
+
group: "effectNative",
|
|
9022
9084
|
severity: "off",
|
|
9023
9085
|
fixable: true,
|
|
9024
9086
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9084,6 +9146,7 @@ var layerMergeAllWithDependencies = createDiagnostic({
|
|
|
9084
9146
|
name: "layerMergeAllWithDependencies",
|
|
9085
9147
|
code: 37,
|
|
9086
9148
|
description: "Detects interdependencies in Layer.mergeAll calls where one layer provides a service that another layer requires",
|
|
9149
|
+
group: "antipattern",
|
|
9087
9150
|
severity: "warning",
|
|
9088
9151
|
fixable: true,
|
|
9089
9152
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9199,6 +9262,7 @@ var leakingRequirements = createDiagnostic({
|
|
|
9199
9262
|
name: "leakingRequirements",
|
|
9200
9263
|
code: 8,
|
|
9201
9264
|
description: "Detects implementation services leaked in service methods",
|
|
9265
|
+
group: "antipattern",
|
|
9202
9266
|
severity: "suggestion",
|
|
9203
9267
|
fixable: false,
|
|
9204
9268
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9355,6 +9419,7 @@ var missedPipeableOpportunity = createDiagnostic({
|
|
|
9355
9419
|
name: "missedPipeableOpportunity",
|
|
9356
9420
|
code: 26,
|
|
9357
9421
|
description: "Enforces the use of pipeable style for nested function calls",
|
|
9422
|
+
group: "style",
|
|
9358
9423
|
severity: "off",
|
|
9359
9424
|
fixable: true,
|
|
9360
9425
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9537,6 +9602,7 @@ var missingEffectContext = createDiagnostic({
|
|
|
9537
9602
|
name: "missingEffectContext",
|
|
9538
9603
|
code: 1,
|
|
9539
9604
|
description: "Reports missing service requirements in Effect context channel",
|
|
9605
|
+
group: "correctness",
|
|
9540
9606
|
severity: "error",
|
|
9541
9607
|
fixable: false,
|
|
9542
9608
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9588,6 +9654,7 @@ var missingEffectError = createDiagnostic({
|
|
|
9588
9654
|
name: "missingEffectError",
|
|
9589
9655
|
code: 1,
|
|
9590
9656
|
description: "Reports missing error types in Effect error channel",
|
|
9657
|
+
group: "correctness",
|
|
9591
9658
|
severity: "error",
|
|
9592
9659
|
fixable: true,
|
|
9593
9660
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9731,6 +9798,7 @@ var missingEffectServiceDependency = createDiagnostic({
|
|
|
9731
9798
|
name: "missingEffectServiceDependency",
|
|
9732
9799
|
code: 22,
|
|
9733
9800
|
description: "Checks that Effect.Service dependencies satisfy all required layer inputs",
|
|
9801
|
+
group: "style",
|
|
9734
9802
|
severity: "off",
|
|
9735
9803
|
fixable: false,
|
|
9736
9804
|
supportedEffect: ["v3"],
|
|
@@ -9827,6 +9895,7 @@ var missingLayerContext = createDiagnostic({
|
|
|
9827
9895
|
name: "missingLayerContext",
|
|
9828
9896
|
code: 38,
|
|
9829
9897
|
description: "Reports missing service requirements in Layer context channel",
|
|
9898
|
+
group: "correctness",
|
|
9830
9899
|
severity: "error",
|
|
9831
9900
|
fixable: false,
|
|
9832
9901
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9878,6 +9947,7 @@ var missingReturnYieldStar = createDiagnostic({
|
|
|
9878
9947
|
name: "missingReturnYieldStar",
|
|
9879
9948
|
code: 7,
|
|
9880
9949
|
description: "Suggests using 'return yield*' for Effects with never success for better type narrowing",
|
|
9950
|
+
group: "correctness",
|
|
9881
9951
|
severity: "error",
|
|
9882
9952
|
fixable: true,
|
|
9883
9953
|
supportedEffect: ["v3", "v4"],
|
|
@@ -9930,6 +10000,7 @@ var missingStarInYieldEffectGen = createDiagnostic({
|
|
|
9930
10000
|
name: "missingStarInYieldEffectGen",
|
|
9931
10001
|
code: 4,
|
|
9932
10002
|
description: "Enforces using 'yield*' instead of 'yield' when yielding Effects in generators",
|
|
10003
|
+
group: "correctness",
|
|
9933
10004
|
severity: "error",
|
|
9934
10005
|
fixable: true,
|
|
9935
10006
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10007,6 +10078,7 @@ var multipleEffectProvide = createDiagnostic({
|
|
|
10007
10078
|
name: "multipleEffectProvide",
|
|
10008
10079
|
code: 18,
|
|
10009
10080
|
description: "Warns against chaining Effect.provide calls which can cause service lifecycle issues",
|
|
10081
|
+
group: "antipattern",
|
|
10010
10082
|
severity: "warning",
|
|
10011
10083
|
fixable: true,
|
|
10012
10084
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10109,7 +10181,11 @@ var moduleAlternativesV3 = /* @__PURE__ */ new Map([
|
|
|
10109
10181
|
["path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
10110
10182
|
["node:path/win32", { alternative: "Path", module: "path", package: "@effect/platform" }],
|
|
10111
10183
|
["child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
10112
|
-
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }]
|
|
10184
|
+
["node:child_process", { alternative: "CommandExecutor", module: "child_process", package: "@effect/platform" }],
|
|
10185
|
+
["http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
10186
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "@effect/platform" }],
|
|
10187
|
+
["https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }],
|
|
10188
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "@effect/platform" }]
|
|
10113
10189
|
]);
|
|
10114
10190
|
var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
10115
10191
|
["fs", { alternative: "FileSystem", module: "fs", package: "effect" }],
|
|
@@ -10123,12 +10199,17 @@ var moduleAlternativesV4 = /* @__PURE__ */ new Map([
|
|
|
10123
10199
|
["path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
10124
10200
|
["node:path/win32", { alternative: "Path", module: "path", package: "effect" }],
|
|
10125
10201
|
["child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
10126
|
-
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }]
|
|
10202
|
+
["node:child_process", { alternative: "ChildProcess", module: "child_process", package: "effect" }],
|
|
10203
|
+
["http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
10204
|
+
["node:http", { alternative: "HttpClient", module: "http", package: "effect/unstable/http" }],
|
|
10205
|
+
["https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }],
|
|
10206
|
+
["node:https", { alternative: "HttpClient", module: "https", package: "effect/unstable/http" }]
|
|
10127
10207
|
]);
|
|
10128
10208
|
var nodeBuiltinImport = createDiagnostic({
|
|
10129
10209
|
name: "nodeBuiltinImport",
|
|
10130
10210
|
code: 52,
|
|
10131
10211
|
description: "Warns when importing Node.js built-in modules that have Effect-native counterparts",
|
|
10212
|
+
group: "effectNative",
|
|
10132
10213
|
severity: "off",
|
|
10133
10214
|
fixable: false,
|
|
10134
10215
|
supportedEffect: ["v3", "v4"],
|
|
@@ -10172,6 +10253,7 @@ var nonObjectEffectServiceType = createDiagnostic({
|
|
|
10172
10253
|
name: "nonObjectEffectServiceType",
|
|
10173
10254
|
code: 24,
|
|
10174
10255
|
description: "Ensures Effect.Service types are objects, not primitives",
|
|
10256
|
+
group: "correctness",
|
|
10175
10257
|
severity: "error",
|
|
10176
10258
|
fixable: false,
|
|
10177
10259
|
supportedEffect: ["v3"],
|
|
@@ -10956,6 +11038,7 @@ var outdatedApi = createDiagnostic({
|
|
|
10956
11038
|
name: "outdatedApi",
|
|
10957
11039
|
code: 48,
|
|
10958
11040
|
description: "Detects usage of APIs that have been removed or renamed in Effect v4",
|
|
11041
|
+
group: "correctness",
|
|
10959
11042
|
severity: "warning",
|
|
10960
11043
|
fixable: false,
|
|
10961
11044
|
supportedEffect: ["v4"],
|
|
@@ -11025,6 +11108,7 @@ var outdatedEffectCodegen = createDiagnostic({
|
|
|
11025
11108
|
name: "outdatedEffectCodegen",
|
|
11026
11109
|
code: 19,
|
|
11027
11110
|
description: "Detects when generated code is outdated and needs to be regenerated",
|
|
11111
|
+
group: "correctness",
|
|
11028
11112
|
severity: "warning",
|
|
11029
11113
|
fixable: true,
|
|
11030
11114
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11073,6 +11157,7 @@ var overriddenSchemaConstructor = createDiagnostic({
|
|
|
11073
11157
|
name: "overriddenSchemaConstructor",
|
|
11074
11158
|
code: 30,
|
|
11075
11159
|
description: "Prevents overriding constructors in Schema classes which breaks decoding behavior",
|
|
11160
|
+
group: "correctness",
|
|
11076
11161
|
severity: "error",
|
|
11077
11162
|
fixable: true,
|
|
11078
11163
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11212,6 +11297,7 @@ var preferSchemaOverJson = createDiagnostic({
|
|
|
11212
11297
|
name: "preferSchemaOverJson",
|
|
11213
11298
|
code: 44,
|
|
11214
11299
|
description: "Suggests using Effect Schema for JSON operations instead of JSON.parse/JSON.stringify which may throw",
|
|
11300
|
+
group: "effectNative",
|
|
11215
11301
|
severity: "suggestion",
|
|
11216
11302
|
fixable: false,
|
|
11217
11303
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11324,6 +11410,7 @@ var redundantSchemaTagIdentifier = createDiagnostic({
|
|
|
11324
11410
|
name: "redundantSchemaTagIdentifier",
|
|
11325
11411
|
code: 42,
|
|
11326
11412
|
description: "Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest",
|
|
11413
|
+
group: "style",
|
|
11327
11414
|
severity: "suggestion",
|
|
11328
11415
|
fixable: true,
|
|
11329
11416
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11376,6 +11463,7 @@ var returnEffectInGen = createDiagnostic({
|
|
|
11376
11463
|
name: "returnEffectInGen",
|
|
11377
11464
|
code: 11,
|
|
11378
11465
|
description: "Warns when returning an Effect in a generator causes nested Effect<Effect<...>>",
|
|
11466
|
+
group: "antipattern",
|
|
11379
11467
|
severity: "suggestion",
|
|
11380
11468
|
fixable: true,
|
|
11381
11469
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11447,6 +11535,7 @@ var runEffectInsideEffect = createDiagnostic({
|
|
|
11447
11535
|
name: "runEffectInsideEffect",
|
|
11448
11536
|
code: 32,
|
|
11449
11537
|
description: "Suggests using Runtime methods instead of Effect.run* inside Effect contexts",
|
|
11538
|
+
group: "antipattern",
|
|
11450
11539
|
severity: "suggestion",
|
|
11451
11540
|
fixable: true,
|
|
11452
11541
|
supportedEffect: ["v3"],
|
|
@@ -11573,6 +11662,7 @@ var schemaStructWithTag = createDiagnostic({
|
|
|
11573
11662
|
name: "schemaStructWithTag",
|
|
11574
11663
|
code: 34,
|
|
11575
11664
|
description: "Suggests using Schema.TaggedStruct instead of Schema.Struct with _tag field",
|
|
11665
|
+
group: "style",
|
|
11576
11666
|
severity: "suggestion",
|
|
11577
11667
|
fixable: true,
|
|
11578
11668
|
supportedEffect: ["v3", "v4"],
|
|
@@ -11667,9 +11757,10 @@ var schemaSyncInEffect = createDiagnostic({
|
|
|
11667
11757
|
name: "schemaSyncInEffect",
|
|
11668
11758
|
code: 43,
|
|
11669
11759
|
description: "Suggests using Effect-based Schema methods instead of sync methods inside Effect generators",
|
|
11760
|
+
group: "antipattern",
|
|
11670
11761
|
severity: "suggestion",
|
|
11671
11762
|
fixable: false,
|
|
11672
|
-
supportedEffect: ["v3"
|
|
11763
|
+
supportedEffect: ["v3"],
|
|
11673
11764
|
apply: fn("schemaSyncInEffect.apply")(function* (sourceFile, report) {
|
|
11674
11765
|
const ts = yield* service(TypeScriptApi);
|
|
11675
11766
|
const typeParser = yield* service(TypeParser);
|
|
@@ -11718,6 +11809,7 @@ var schemaUnionOfLiterals = createDiagnostic({
|
|
|
11718
11809
|
name: "schemaUnionOfLiterals",
|
|
11719
11810
|
code: 33,
|
|
11720
11811
|
description: "Simplifies Schema.Union of multiple Schema.Literal calls into single Schema.Literal",
|
|
11812
|
+
group: "style",
|
|
11721
11813
|
severity: "off",
|
|
11722
11814
|
fixable: true,
|
|
11723
11815
|
supportedEffect: ["v3"],
|
|
@@ -11795,6 +11887,7 @@ var scopeInLayerEffect = createDiagnostic({
|
|
|
11795
11887
|
name: "scopeInLayerEffect",
|
|
11796
11888
|
code: 13,
|
|
11797
11889
|
description: "Suggests using Layer.scoped instead of Layer.effect when Scope is in requirements",
|
|
11890
|
+
group: "antipattern",
|
|
11798
11891
|
severity: "warning",
|
|
11799
11892
|
fixable: true,
|
|
11800
11893
|
supportedEffect: ["v3"],
|
|
@@ -11892,6 +11985,7 @@ var serviceNotAsClass = createDiagnostic({
|
|
|
11892
11985
|
name: "serviceNotAsClass",
|
|
11893
11986
|
code: 51,
|
|
11894
11987
|
description: "Warns when ServiceMap.Service is used as a variable instead of a class declaration",
|
|
11988
|
+
group: "style",
|
|
11895
11989
|
severity: "off",
|
|
11896
11990
|
fixable: true,
|
|
11897
11991
|
supportedEffect: ["v4"],
|
|
@@ -11969,6 +12063,7 @@ var strictBooleanExpressions = createDiagnostic({
|
|
|
11969
12063
|
name: "strictBooleanExpressions",
|
|
11970
12064
|
code: 17,
|
|
11971
12065
|
description: "Enforces boolean types in conditional expressions for type safety",
|
|
12066
|
+
group: "style",
|
|
11972
12067
|
severity: "off",
|
|
11973
12068
|
fixable: false,
|
|
11974
12069
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12042,6 +12137,7 @@ var strictEffectProvide = createDiagnostic({
|
|
|
12042
12137
|
name: "strictEffectProvide",
|
|
12043
12138
|
code: 27,
|
|
12044
12139
|
description: "Warns when using Effect.provide with layers outside of application entry points",
|
|
12140
|
+
group: "antipattern",
|
|
12045
12141
|
severity: "off",
|
|
12046
12142
|
fixable: false,
|
|
12047
12143
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12095,6 +12191,7 @@ var tryCatchInEffectGen = createDiagnostic({
|
|
|
12095
12191
|
name: "tryCatchInEffectGen",
|
|
12096
12192
|
code: 15,
|
|
12097
12193
|
description: "Discourages try/catch in Effect generators in favor of Effect error handling",
|
|
12194
|
+
group: "antipattern",
|
|
12098
12195
|
severity: "suggestion",
|
|
12099
12196
|
fixable: false,
|
|
12100
12197
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12154,6 +12251,7 @@ var unknownInEffectCatch = createDiagnostic({
|
|
|
12154
12251
|
name: "unknownInEffectCatch",
|
|
12155
12252
|
code: 31,
|
|
12156
12253
|
description: "Warns when catch callbacks return unknown instead of typed errors",
|
|
12254
|
+
group: "antipattern",
|
|
12157
12255
|
severity: "warning",
|
|
12158
12256
|
fixable: false,
|
|
12159
12257
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12217,6 +12315,7 @@ var unnecessaryEffectGen = createDiagnostic({
|
|
|
12217
12315
|
name: "unnecessaryEffectGen",
|
|
12218
12316
|
code: 5,
|
|
12219
12317
|
description: "Suggests removing Effect.gen when it contains only a single return statement",
|
|
12318
|
+
group: "style",
|
|
12220
12319
|
severity: "suggestion",
|
|
12221
12320
|
fixable: true,
|
|
12222
12321
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12263,6 +12362,7 @@ var unnecessaryFailYieldableError = createDiagnostic({
|
|
|
12263
12362
|
name: "unnecessaryFailYieldableError",
|
|
12264
12363
|
code: 29,
|
|
12265
12364
|
description: "Suggests yielding yieldable errors directly instead of wrapping with Effect.fail",
|
|
12365
|
+
group: "style",
|
|
12266
12366
|
severity: "suggestion",
|
|
12267
12367
|
fixable: true,
|
|
12268
12368
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12324,6 +12424,7 @@ var unnecessaryPipe = createDiagnostic({
|
|
|
12324
12424
|
name: "unnecessaryPipe",
|
|
12325
12425
|
code: 9,
|
|
12326
12426
|
description: "Removes pipe calls with no arguments",
|
|
12427
|
+
group: "style",
|
|
12327
12428
|
severity: "suggestion",
|
|
12328
12429
|
fixable: true,
|
|
12329
12430
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12372,6 +12473,7 @@ var unnecessaryPipeChain = createDiagnostic({
|
|
|
12372
12473
|
name: "unnecessaryPipeChain",
|
|
12373
12474
|
code: 16,
|
|
12374
12475
|
description: "Simplifies chained pipe calls into a single pipe call",
|
|
12476
|
+
group: "style",
|
|
12375
12477
|
severity: "suggestion",
|
|
12376
12478
|
fixable: true,
|
|
12377
12479
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12449,6 +12551,7 @@ var unsupportedServiceAccessors = createDiagnostic({
|
|
|
12449
12551
|
name: "unsupportedServiceAccessors",
|
|
12450
12552
|
code: 21,
|
|
12451
12553
|
description: "Warns about service accessors that need codegen due to generic/complex signatures",
|
|
12554
|
+
group: "correctness",
|
|
12452
12555
|
severity: "warning",
|
|
12453
12556
|
fixable: true,
|
|
12454
12557
|
supportedEffect: ["v3", "v4"],
|
|
@@ -12526,6 +12629,7 @@ var diagnostics = [
|
|
|
12526
12629
|
leakingRequirements,
|
|
12527
12630
|
unnecessaryPipe,
|
|
12528
12631
|
genericEffectServices,
|
|
12632
|
+
globalFetch,
|
|
12529
12633
|
returnEffectInGen,
|
|
12530
12634
|
tryCatchInEffectGen,
|
|
12531
12635
|
importFromBarrel,
|