eslint-plugin-react-naming-convention 2.5.7 → 2.5.8
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 +5 -5
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, getConfigAdapters, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
|
|
2
2
|
import * as AST from "@eslint-react/ast";
|
|
3
|
-
import {
|
|
3
|
+
import { findEnclosingAssignmentTarget, isComponentName, isCreateContextCall, isUseRefCall, isUseStateCall, useComponentCollector, useComponentCollectorLegacy } from "@eslint-react/core";
|
|
4
4
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
5
5
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
6
6
|
import { compare } from "compare-versions";
|
|
@@ -41,7 +41,7 @@ const rules = {
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region package.json
|
|
43
43
|
var name = "eslint-plugin-react-naming-convention";
|
|
44
|
-
var version = "2.5.
|
|
44
|
+
var version = "2.5.8";
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/utils/create-rule.ts
|
|
@@ -175,7 +175,7 @@ function create$4(context) {
|
|
|
175
175
|
if (compare(version$1, "19.0.0", "<")) return {};
|
|
176
176
|
return { CallExpression(node) {
|
|
177
177
|
if (!isCreateContextCall(context, node)) return;
|
|
178
|
-
const [id, name$2] = match(
|
|
178
|
+
const [id, name$2] = match(findEnclosingAssignmentTarget(node)).with({
|
|
179
179
|
type: AST_NODE_TYPES.Identifier,
|
|
180
180
|
name: P.string
|
|
181
181
|
}, (id$1) => [id$1, id$1.name]).with({
|
|
@@ -387,7 +387,7 @@ function create$1(context) {
|
|
|
387
387
|
return { CallExpression(node) {
|
|
388
388
|
if (!isUseRefCall(node)) return;
|
|
389
389
|
if (AST.getUnderlyingExpression(node.parent).type === AST_NODE_TYPES.MemberExpression) return;
|
|
390
|
-
const [id, name$2] = match(
|
|
390
|
+
const [id, name$2] = match(findEnclosingAssignmentTarget(node)).with({
|
|
391
391
|
type: AST_NODE_TYPES.Identifier,
|
|
392
392
|
name: P.string
|
|
393
393
|
}, (id$1) => [id$1, id$1.name]).with({
|
|
@@ -450,7 +450,7 @@ function create(context) {
|
|
|
450
450
|
});
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
const id =
|
|
453
|
+
const id = findEnclosingAssignmentTarget(node);
|
|
454
454
|
if (id?.type !== AST_NODE_TYPES.ArrayPattern) {
|
|
455
455
|
if (!enforceAssignment) return;
|
|
456
456
|
context.report({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.8",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"compare-versions": "^6.1.1",
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "2.5.
|
|
49
|
-
"@eslint-react/core": "2.5.
|
|
50
|
-
"@eslint-react/shared": "2.5.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "2.5.8",
|
|
49
|
+
"@eslint-react/core": "2.5.8",
|
|
50
|
+
"@eslint-react/shared": "2.5.8",
|
|
51
|
+
"@eslint-react/eff": "2.5.8",
|
|
52
|
+
"@eslint-react/var": "2.5.8"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.8",
|
|
56
56
|
"@types/react-dom": "^19.2.3",
|
|
57
|
-
"tsdown": "^0.20.0-beta.
|
|
57
|
+
"tsdown": "^0.20.0-beta.2",
|
|
58
58
|
"@local/configs": "0.0.0"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|