@fedify/lint 2.3.5-dev.1755 → 2.3.6

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/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/lint",
3
- "version": "2.3.5-dev.1755+9b03b9cc",
3
+ "version": "2.3.6",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./src/mod.ts",
package/dist/index.cjs CHANGED
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-CdBoXukB.cjs");
27
+ const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-hBmjVAtK.cjs");
28
28
  let _fxts_core = require("@fxts/core");
29
29
  let _typescript_eslint_parser = require("@typescript-eslint/parser");
30
30
  _typescript_eslint_parser = __toESM(_typescript_eslint_parser, 1);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as RULE_IDS, S as eslint$19, T as version, _ as eslint$5, a as eslint$18, b as eslint$10, c as eslint$8, d as eslint$15, f as eslint$1, g as eslint$4, h as eslint$3, i as eslint$17, l as eslint$9, m as eslint$2, n as eslint$20, o as eslint$6, p as eslint, r as eslint$16, s as eslint$7, t as eslint$21, u as eslint$14, v as eslint$12, w as name, x as eslint$11, y as eslint$13 } from "./outbox-listener-delivery-required-DTE5oUyk.js";
1
+ import { C as RULE_IDS, S as eslint$19, T as version, _ as eslint$5, a as eslint$18, b as eslint$10, c as eslint$8, d as eslint$15, f as eslint$1, g as eslint$4, h as eslint$3, i as eslint$17, l as eslint$9, m as eslint$2, n as eslint$20, o as eslint$6, p as eslint, r as eslint$16, s as eslint$7, t as eslint$21, u as eslint$14, v as eslint$12, w as name, x as eslint$11, y as eslint$13 } from "./outbox-listener-delivery-required-Cf87W4CE.js";
2
2
  import { fromEntries, keys, map, pipe } from "@fxts/core";
3
3
  import parser from "@typescript-eslint/parser";
4
4
  //#region src/index.ts
@@ -1,7 +1,7 @@
1
1
  import { always, every, head, isEmpty, isObject, negate, pipe, pipeLazy, prop, some, toArray, unless, when } from "@fxts/core";
2
2
  //#region deno.json
3
3
  var name = "@fedify/lint";
4
- var version = "2.3.5-dev.1755+9b03b9cc";
4
+ var version = "2.3.6";
5
5
  //#endregion
6
6
  //#region src/lib/const.ts
7
7
  /**
@@ -245,7 +245,21 @@ const checkObjectExpression = (propertyChecker) => (obj) => obj.properties.some(
245
245
  * @returns A function that checks the ConditionalExpression
246
246
  */
247
247
  const checkConditionalExpression = (propertyChecker) => (node) => [node.consequent, node.alternate].every(checkBranchWith(propertyChecker));
248
- const checkBranchWith = (propertyChecker) => (branch) => pipe(branch, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), pipeLazy(extractObjectExpression, cases(isObject, checkObjectExpression(propertyChecker), always(false)))));
248
+ const unwrapTypeScriptExpression = (node) => {
249
+ switch (node.type) {
250
+ case "TSAsExpression":
251
+ case "TSSatisfiesExpression":
252
+ case "TSNonNullExpression":
253
+ case "TSTypeAssertion": return unwrapTypeScriptExpression(node.expression);
254
+ default: return node;
255
+ }
256
+ };
257
+ const isNullLiteral = (node) => node.type === "Literal" && node.value === null;
258
+ const checkBranchWith = (propertyChecker) => (branch) => {
259
+ const expression = unwrapTypeScriptExpression(branch);
260
+ if (isNullLiteral(expression)) return true;
261
+ return pipe(expression, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), pipeLazy(extractObjectExpression, cases(isObject, checkObjectExpression(propertyChecker), always(false)))));
262
+ };
249
263
  /**
250
264
  * Extracts the first argument if it's an ObjectExpression.
251
265
  */
@@ -271,7 +285,7 @@ const createPropertySearcher = (propertyChecker) => {
271
285
  case "ReturnStatement": return checkReturnStatement(propertyChecker)(node);
272
286
  case "BlockStatement": return checkAllReturnPaths(propertyChecker)(node);
273
287
  case "NewExpression": return pipe(node, extractFirstObjectExpression, when(isObject, checkObjectExpression(propertyChecker)), Boolean);
274
- default: return false;
288
+ default: return checkBranchWith(propertyChecker)(node);
275
289
  }
276
290
  };
277
291
  };
@@ -2,7 +2,7 @@ require("./index.cjs");
2
2
  let _fxts_core = require("@fxts/core");
3
3
  //#region deno.json
4
4
  var name = "@fedify/lint";
5
- var version = "2.3.5-dev.1755+9b03b9cc";
5
+ var version = "2.3.6";
6
6
  //#endregion
7
7
  //#region src/lib/const.ts
8
8
  /**
@@ -246,7 +246,21 @@ const checkObjectExpression = (propertyChecker) => (obj) => obj.properties.some(
246
246
  * @returns A function that checks the ConditionalExpression
247
247
  */
248
248
  const checkConditionalExpression = (propertyChecker) => (node) => [node.consequent, node.alternate].every(checkBranchWith(propertyChecker));
249
- const checkBranchWith = (propertyChecker) => (branch) => (0, _fxts_core.pipe)(branch, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), (0, _fxts_core.pipeLazy)(extractObjectExpression, cases(_fxts_core.isObject, checkObjectExpression(propertyChecker), (0, _fxts_core.always)(false)))));
249
+ const unwrapTypeScriptExpression = (node) => {
250
+ switch (node.type) {
251
+ case "TSAsExpression":
252
+ case "TSSatisfiesExpression":
253
+ case "TSNonNullExpression":
254
+ case "TSTypeAssertion": return unwrapTypeScriptExpression(node.expression);
255
+ default: return node;
256
+ }
257
+ };
258
+ const isNullLiteral = (node) => node.type === "Literal" && node.value === null;
259
+ const checkBranchWith = (propertyChecker) => (branch) => {
260
+ const expression = unwrapTypeScriptExpression(branch);
261
+ if (isNullLiteral(expression)) return true;
262
+ return (0, _fxts_core.pipe)(expression, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), (0, _fxts_core.pipeLazy)(extractObjectExpression, cases(_fxts_core.isObject, checkObjectExpression(propertyChecker), (0, _fxts_core.always)(false)))));
263
+ };
250
264
  /**
251
265
  * Extracts the first argument if it's an ObjectExpression.
252
266
  */
@@ -272,7 +286,7 @@ const createPropertySearcher = (propertyChecker) => {
272
286
  case "ReturnStatement": return checkReturnStatement(propertyChecker)(node);
273
287
  case "BlockStatement": return checkAllReturnPaths(propertyChecker)(node);
274
288
  case "NewExpression": return (0, _fxts_core.pipe)(node, extractFirstObjectExpression, (0, _fxts_core.when)(_fxts_core.isObject, checkObjectExpression(propertyChecker)), Boolean);
275
- default: return false;
289
+ default: return checkBranchWith(propertyChecker)(node);
276
290
  }
277
291
  };
278
292
  };
package/dist/oxlint.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-CdBoXukB.cjs");
1
+ const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-hBmjVAtK.cjs");
2
2
  //#region src/oxlint.ts
3
3
  const rules = {
4
4
  [require_outbox_listener_delivery_required.RULE_IDS.actorIdMismatch]: require_outbox_listener_delivery_required.eslint$12,
package/dist/oxlint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as RULE_IDS, S as eslint$19, T as version, _ as eslint$5, a as eslint$18, b as eslint$10, c as eslint$8, d as eslint$15, f as eslint$1, g as eslint$4, h as eslint$3, i as eslint$17, l as eslint$9, m as eslint$2, n as eslint$20, o as eslint$6, p as eslint, r as eslint$16, s as eslint$7, t as eslint$21, u as eslint$14, v as eslint$12, w as name, x as eslint$11, y as eslint$13 } from "./outbox-listener-delivery-required-DTE5oUyk.js";
1
+ import { C as RULE_IDS, S as eslint$19, T as version, _ as eslint$5, a as eslint$18, b as eslint$10, c as eslint$8, d as eslint$15, f as eslint$1, g as eslint$4, h as eslint$3, i as eslint$17, l as eslint$9, m as eslint$2, n as eslint$20, o as eslint$6, p as eslint, r as eslint$16, s as eslint$7, t as eslint$21, u as eslint$14, v as eslint$12, w as name, x as eslint$11, y as eslint$13 } from "./outbox-listener-delivery-required-Cf87W4CE.js";
2
2
  //#region src/oxlint.ts
3
3
  const rules = {
4
4
  [RULE_IDS.actorIdMismatch]: eslint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/lint",
3
- "version": "2.3.5-dev.1755+9b03b9cc",
3
+ "version": "2.3.6",
4
4
  "description": "Fedify linting rules and plugins",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -54,7 +54,7 @@
54
54
  ],
55
55
  "peerDependencies": {
56
56
  "eslint": ">=9.0.0",
57
- "@fedify/fedify": "^2.3.5-dev.1755+9b03b9cc"
57
+ "@fedify/fedify": "^2.3.6"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "eslint": {