@fedify/lint 2.4.0-dev.1867 → 2.4.0-dev.1881

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.4.0-dev.1867+ac08358f",
3
+ "version": "2.4.0-dev.1881+17358f2e",
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-ups7r81A.cjs");
27
+ const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-CcxLbaR4.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 eslint$13, D as RULE_IDS, E as eslint$21, O as name, S as eslint$12, T as eslint$11, _ as eslint, a as eslint$18, b as eslint$4, c as eslint$17, d as eslint$7, f as eslint$8, g as eslint$1, h as eslint$15, i as eslint$22, k as version, l as eslint$20, m as eslint$14, n as eslint$24, o as eslint$19, p as eslint$9, r as eslint$25, s as eslint$16, t as eslint$23, u as eslint$6, v as eslint$2, w as eslint$10, x as eslint$5, y as eslint$3 } from "./outbox-listener-delivery-required-CGUbZyge.js";
1
+ import { C as eslint$13, D as RULE_IDS, E as eslint$21, O as name, S as eslint$12, T as eslint$11, _ as eslint, a as eslint$18, b as eslint$4, c as eslint$17, d as eslint$7, f as eslint$8, g as eslint$1, h as eslint$15, i as eslint$22, k as version, l as eslint$20, m as eslint$14, n as eslint$24, o as eslint$19, p as eslint$9, r as eslint$25, s as eslint$16, t as eslint$23, u as eslint$6, v as eslint$2, w as eslint$10, x as eslint$5, y as eslint$3 } from "./outbox-listener-delivery-required-B5vCAu_Z.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.4.0-dev.1867+ac08358f";
4
+ var version = "2.4.0-dev.1881+17358f2e";
5
5
  //#endregion
6
6
  //#region src/lib/const.ts
7
7
  /**
@@ -260,7 +260,21 @@ const checkObjectExpression = (propertyChecker) => (obj) => obj.properties.some(
260
260
  * @returns A function that checks the ConditionalExpression
261
261
  */
262
262
  const checkConditionalExpression = (propertyChecker) => (node) => [node.consequent, node.alternate].every(checkBranchWith(propertyChecker));
263
- const checkBranchWith = (propertyChecker) => (branch) => pipe(branch, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), pipeLazy(extractObjectExpression, cases(isObject, checkObjectExpression(propertyChecker), always(false)))));
263
+ const unwrapTypeScriptExpression = (node) => {
264
+ switch (node.type) {
265
+ case "TSAsExpression":
266
+ case "TSSatisfiesExpression":
267
+ case "TSNonNullExpression":
268
+ case "TSTypeAssertion": return unwrapTypeScriptExpression(node.expression);
269
+ default: return node;
270
+ }
271
+ };
272
+ const isNullLiteral = (node) => node.type === "Literal" && node.value === null;
273
+ const checkBranchWith = (propertyChecker) => (branch) => {
274
+ const expression = unwrapTypeScriptExpression(branch);
275
+ if (isNullLiteral(expression)) return true;
276
+ return pipe(expression, cases(isNodeType("ConditionalExpression"), checkConditionalExpression(propertyChecker), pipeLazy(extractObjectExpression, cases(isObject, checkObjectExpression(propertyChecker), always(false)))));
277
+ };
264
278
  /**
265
279
  * Extracts the first argument if it's an ObjectExpression.
266
280
  */
@@ -286,7 +300,7 @@ const createPropertySearcher = (propertyChecker) => {
286
300
  case "ReturnStatement": return checkReturnStatement(propertyChecker)(node);
287
301
  case "BlockStatement": return checkAllReturnPaths(propertyChecker)(node);
288
302
  case "NewExpression": return pipe(node, extractFirstObjectExpression, when(isObject, checkObjectExpression(propertyChecker)), Boolean);
289
- default: return false;
303
+ default: return checkBranchWith(propertyChecker)(node);
290
304
  }
291
305
  };
292
306
  };
@@ -1,7 +1,7 @@
1
1
  let _fxts_core = require("@fxts/core");
2
2
  //#region deno.json
3
3
  var name = "@fedify/lint";
4
- var version = "2.4.0-dev.1867+ac08358f";
4
+ var version = "2.4.0-dev.1881+17358f2e";
5
5
  //#endregion
6
6
  //#region src/lib/const.ts
7
7
  /**
@@ -260,7 +260,21 @@ const checkObjectExpression = (propertyChecker) => (obj) => obj.properties.some(
260
260
  * @returns A function that checks the ConditionalExpression
261
261
  */
262
262
  const checkConditionalExpression = (propertyChecker) => (node) => [node.consequent, node.alternate].every(checkBranchWith(propertyChecker));
263
- 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)))));
263
+ const unwrapTypeScriptExpression = (node) => {
264
+ switch (node.type) {
265
+ case "TSAsExpression":
266
+ case "TSSatisfiesExpression":
267
+ case "TSNonNullExpression":
268
+ case "TSTypeAssertion": return unwrapTypeScriptExpression(node.expression);
269
+ default: return node;
270
+ }
271
+ };
272
+ const isNullLiteral = (node) => node.type === "Literal" && node.value === null;
273
+ const checkBranchWith = (propertyChecker) => (branch) => {
274
+ const expression = unwrapTypeScriptExpression(branch);
275
+ if (isNullLiteral(expression)) return true;
276
+ 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)))));
277
+ };
264
278
  /**
265
279
  * Extracts the first argument if it's an ObjectExpression.
266
280
  */
@@ -286,7 +300,7 @@ const createPropertySearcher = (propertyChecker) => {
286
300
  case "ReturnStatement": return checkReturnStatement(propertyChecker)(node);
287
301
  case "BlockStatement": return checkAllReturnPaths(propertyChecker)(node);
288
302
  case "NewExpression": return (0, _fxts_core.pipe)(node, extractFirstObjectExpression, (0, _fxts_core.when)(_fxts_core.isObject, checkObjectExpression(propertyChecker)), Boolean);
289
- default: return false;
303
+ default: return checkBranchWith(propertyChecker)(node);
290
304
  }
291
305
  };
292
306
  };
package/dist/oxlint.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-ups7r81A.cjs");
1
+ const require_outbox_listener_delivery_required = require("./outbox-listener-delivery-required-CcxLbaR4.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$16,
package/dist/oxlint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as eslint$13, D as RULE_IDS, E as eslint$21, O as name, S as eslint$12, T as eslint$11, _ as eslint, a as eslint$18, b as eslint$4, c as eslint$17, d as eslint$7, f as eslint$8, g as eslint$1, h as eslint$15, i as eslint$22, k as version, l as eslint$20, m as eslint$14, n as eslint$24, o as eslint$19, p as eslint$9, r as eslint$25, s as eslint$16, t as eslint$23, u as eslint$6, v as eslint$2, w as eslint$10, x as eslint$5, y as eslint$3 } from "./outbox-listener-delivery-required-CGUbZyge.js";
1
+ import { C as eslint$13, D as RULE_IDS, E as eslint$21, O as name, S as eslint$12, T as eslint$11, _ as eslint, a as eslint$18, b as eslint$4, c as eslint$17, d as eslint$7, f as eslint$8, g as eslint$1, h as eslint$15, i as eslint$22, k as version, l as eslint$20, m as eslint$14, n as eslint$24, o as eslint$19, p as eslint$9, r as eslint$25, s as eslint$16, t as eslint$23, u as eslint$6, v as eslint$2, w as eslint$10, x as eslint$5, y as eslint$3 } from "./outbox-listener-delivery-required-B5vCAu_Z.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.4.0-dev.1867+ac08358f",
3
+ "version": "2.4.0-dev.1881+17358f2e",
4
4
  "description": "Fedify linting rules and plugins",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "peerDependencies": {
53
53
  "eslint": ">=9.0.0",
54
- "@fedify/fedify": "^2.4.0-dev.1867+ac08358f"
54
+ "@fedify/fedify": "^2.4.0-dev.1881+17358f2e"
55
55
  },
56
56
  "peerDependenciesMeta": {
57
57
  "eslint": {