@utilfirst/eslint-plugin 0.4.0 → 0.4.1
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 +1 -1
- package/dist/oxlint.js +1 -1
- package/dist/{src-BcVIwgzD.js → src-Bthhlf8v.js} +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/oxlint.js
CHANGED
|
@@ -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.
|
|
6
|
+
var version = "0.4.1";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/rules/consistent-blank-lines.ts
|
|
@@ -3426,6 +3426,15 @@ const preferOptionsParameterRule = defineRule({
|
|
|
3426
3426
|
|
|
3427
3427
|
//#endregion
|
|
3428
3428
|
//#region src/rules/prefer-react-props-reference.ts
|
|
3429
|
+
const HTTP_METHOD_EXPORT_NAMES = new Set([
|
|
3430
|
+
"DELETE",
|
|
3431
|
+
"GET",
|
|
3432
|
+
"HEAD",
|
|
3433
|
+
"OPTIONS",
|
|
3434
|
+
"PATCH",
|
|
3435
|
+
"POST",
|
|
3436
|
+
"PUT"
|
|
3437
|
+
]);
|
|
3429
3438
|
function componentNameOf(node) {
|
|
3430
3439
|
if (node.type !== "ArrowFunctionExpression") return node.id?.name ?? null;
|
|
3431
3440
|
if (node.parent.type === "VariableDeclarator" && node.parent.id.type === "Identifier") return node.parent.id.name;
|
|
@@ -3433,7 +3442,7 @@ function componentNameOf(node) {
|
|
|
3433
3442
|
}
|
|
3434
3443
|
function isComponent(node) {
|
|
3435
3444
|
const name = componentNameOf(node);
|
|
3436
|
-
return name !== null && /^\p{Lu}/u.test(name);
|
|
3445
|
+
return name !== null && !HTTP_METHOD_EXPORT_NAMES.has(name) && /^\p{Lu}/u.test(name);
|
|
3437
3446
|
}
|
|
3438
3447
|
function propertyNameOf(key) {
|
|
3439
3448
|
if (key.type === "Identifier") return key.name;
|