@utilfirst/eslint-plugin 0.4.0 → 0.4.2

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/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as src_default } from "./src-BcVIwgzD.js";
1
+ import { t as src_default } from "./src-DdudPvOQ.js";
2
2
 
3
3
  export { src_default as default };
package/dist/oxlint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as src_default } from "./src-BcVIwgzD.js";
1
+ import { t as src_default } from "./src-DdudPvOQ.js";
2
2
  import { defineConfig } from "oxlint";
3
3
 
4
4
  //#region src/oxlint.ts
@@ -3,7 +3,7 @@ import { AST_NODE_TYPES } from "@typescript-eslint/utils";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region package.json
6
- var version = "0.4.0";
6
+ var version = "0.4.2";
7
7
 
8
8
  //#endregion
9
9
  //#region src/rules/consistent-blank-lines.ts
@@ -2620,6 +2620,11 @@ function parameterName(parameter, sourceText) {
2620
2620
  if (parameter.type === "RestElement") return parameterName(parameter.argument, sourceText);
2621
2621
  return parameter.type === "Identifier" ? parameter.name : sourceText.replace(/\s*:\s*unknown\s*$/u, "");
2622
2622
  }
2623
+ function isPromiseCatchCallback(node) {
2624
+ if (node.type !== "ArrowFunctionExpression" && node.type !== "FunctionExpression") return false;
2625
+ const call = node.parent;
2626
+ return call.type === "CallExpression" && call.arguments[0] === node && call.callee.type === "MemberExpression" && !call.callee.computed && call.callee.property.type === "Identifier" && call.callee.property.name === "catch";
2627
+ }
2623
2628
  /** Keep unknown inputs at explicit decoding and error-enrichment boundaries. */
2624
2629
  const noUnknownParametersRule = defineRule({
2625
2630
  meta: {
@@ -2642,6 +2647,7 @@ const noUnknownParametersRule = defineRule({
2642
2647
  },
2643
2648
  createOnce(context) {
2644
2649
  const checkParameters = (node) => {
2650
+ if (isPromiseCatchCallback(node)) return;
2645
2651
  const parsedOptions = ContextOptionsSchema$1.safeParse(context.options);
2646
2652
  const options = parsedOptions.success ? parsedOptions.data : void 0;
2647
2653
  for (const parameter of node.params) {
@@ -3426,6 +3432,15 @@ const preferOptionsParameterRule = defineRule({
3426
3432
 
3427
3433
  //#endregion
3428
3434
  //#region src/rules/prefer-react-props-reference.ts
3435
+ const HTTP_METHOD_EXPORT_NAMES = new Set([
3436
+ "DELETE",
3437
+ "GET",
3438
+ "HEAD",
3439
+ "OPTIONS",
3440
+ "PATCH",
3441
+ "POST",
3442
+ "PUT"
3443
+ ]);
3429
3444
  function componentNameOf(node) {
3430
3445
  if (node.type !== "ArrowFunctionExpression") return node.id?.name ?? null;
3431
3446
  if (node.parent.type === "VariableDeclarator" && node.parent.id.type === "Identifier") return node.parent.id.name;
@@ -3433,7 +3448,7 @@ function componentNameOf(node) {
3433
3448
  }
3434
3449
  function isComponent(node) {
3435
3450
  const name = componentNameOf(node);
3436
- return name !== null && /^\p{Lu}/u.test(name);
3451
+ return name !== null && !HTTP_METHOD_EXPORT_NAMES.has(name) && /^\p{Lu}/u.test(name);
3437
3452
  }
3438
3453
  function propertyNameOf(key) {
3439
3454
  if (key.type === "Identifier") return key.name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilfirst/eslint-plugin",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Shared lint rules for ESLint and Oxlint",
5
5
  "keywords": [
6
6
  "eslint",