eslint-plugin-react-naming-convention 1.24.0-beta.1 → 1.24.0-beta.16

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
@@ -36,7 +36,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
36
36
 
37
37
  // package.json
38
38
  var name = "eslint-plugin-react-naming-convention";
39
- var version = "1.24.0-beta.1";
39
+ var version = "1.24.0-beta.16";
40
40
  var createRule = shared.createRuleForPlugin("naming-convention");
41
41
 
42
42
  // src/rules/component-name.ts
@@ -132,7 +132,7 @@ var component_name_default = createRule({
132
132
  ...collector.listeners,
133
133
  ...collectorLegacy.listeners,
134
134
  JSXOpeningElement(node) {
135
- const name2 = JSX__namespace.getElementName(node);
135
+ const name2 = JSX__namespace.getElementName(node.parent);
136
136
  if (/^[a-z]/u.test(name2)) {
137
137
  return;
138
138
  }
@@ -381,8 +381,18 @@ var use_state_default = createRule({
381
381
  },
382
382
  name: RULE_NAME4,
383
383
  create(context) {
384
- const alias = shared.getSettingsFromContext(context).additionalHooks?.useState ?? [];
385
- const { ctx, listeners } = core.useComponentCollector(context);
384
+ const alias = shared.getSettingsFromContext(context).additionalHooks.useState ?? [];
385
+ const {
386
+ ctx,
387
+ listeners
388
+ } = core.useComponentCollector(
389
+ context,
390
+ core.DEFAULT_COMPONENT_HINT,
391
+ {
392
+ collectDisplayName: false,
393
+ collectHookCalls: true
394
+ }
395
+ );
386
396
  return {
387
397
  ...listeners,
388
398
  "Program:exit"(node) {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as AST from '@eslint-react/ast';
2
- import { useComponentCollector, useComponentCollectorLegacy, isUseStateCall, isReactHookCallWithNameLoose } from '@eslint-react/core';
2
+ import { useComponentCollector, useComponentCollectorLegacy, DEFAULT_COMPONENT_HINT, isUseStateCall, isReactHookCallWithNameLoose } from '@eslint-react/core';
3
3
  import { isObject, returnFalse } from '@eslint-react/eff';
4
4
  import * as JSX from '@eslint-react/jsx';
5
5
  import { createRuleForPlugin, getSettingsFromContext, RE_CONSTANT_CASE, RE_PASCAL_CASE, RE_CAMEL_CASE, RE_KEBAB_CASE, RE_SNAKE_CASE } from '@eslint-react/shared';
@@ -10,7 +10,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
10
10
 
11
11
  // package.json
12
12
  var name = "eslint-plugin-react-naming-convention";
13
- var version = "1.24.0-beta.1";
13
+ var version = "1.24.0-beta.16";
14
14
  var createRule = createRuleForPlugin("naming-convention");
15
15
 
16
16
  // src/rules/component-name.ts
@@ -106,7 +106,7 @@ var component_name_default = createRule({
106
106
  ...collector.listeners,
107
107
  ...collectorLegacy.listeners,
108
108
  JSXOpeningElement(node) {
109
- const name2 = JSX.getElementName(node);
109
+ const name2 = JSX.getElementName(node.parent);
110
110
  if (/^[a-z]/u.test(name2)) {
111
111
  return;
112
112
  }
@@ -355,8 +355,18 @@ var use_state_default = createRule({
355
355
  },
356
356
  name: RULE_NAME4,
357
357
  create(context) {
358
- const alias = getSettingsFromContext(context).additionalHooks?.useState ?? [];
359
- const { ctx, listeners } = useComponentCollector(context);
358
+ const alias = getSettingsFromContext(context).additionalHooks.useState ?? [];
359
+ const {
360
+ ctx,
361
+ listeners
362
+ } = useComponentCollector(
363
+ context,
364
+ DEFAULT_COMPONENT_HINT,
365
+ {
366
+ collectDisplayName: false,
367
+ collectHookCalls: true
368
+ }
369
+ );
360
370
  return {
361
371
  ...listeners,
362
372
  "Program:exit"(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-naming-convention",
3
- "version": "1.24.0-beta.1",
3
+ "version": "1.24.0-beta.16",
4
4
  "description": "ESLint React's ESLint plugin for naming convention related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -41,21 +41,20 @@
41
41
  "./package.json"
42
42
  ],
43
43
  "dependencies": {
44
- "@typescript-eslint/scope-manager": "^8.19.1",
45
- "@typescript-eslint/type-utils": "^8.19.1",
46
- "@typescript-eslint/types": "^8.19.1",
47
- "@typescript-eslint/utils": "^8.19.1",
44
+ "@typescript-eslint/scope-manager": "^8.20.0",
45
+ "@typescript-eslint/type-utils": "^8.20.0",
46
+ "@typescript-eslint/types": "^8.20.0",
47
+ "@typescript-eslint/utils": "^8.20.0",
48
48
  "string-ts": "^2.2.0",
49
49
  "ts-pattern": "^5.6.0",
50
- "@eslint-react/ast": "1.24.0-beta.1",
51
- "@eslint-react/core": "1.24.0-beta.1",
52
- "@eslint-react/eff": "1.24.0-beta.1",
53
- "@eslint-react/jsx": "1.24.0-beta.1",
54
- "@eslint-react/shared": "1.24.0-beta.1",
55
- "@eslint-react/types": "1.24.0-beta.1"
50
+ "@eslint-react/ast": "1.24.0-beta.16",
51
+ "@eslint-react/core": "1.24.0-beta.16",
52
+ "@eslint-react/eff": "1.24.0-beta.16",
53
+ "@eslint-react/jsx": "1.24.0-beta.16",
54
+ "@eslint-react/shared": "1.24.0-beta.16"
56
55
  },
57
56
  "devDependencies": {
58
- "@types/react": "^19.0.5",
57
+ "@types/react": "^19.0.7",
59
58
  "@types/react-dom": "^19.0.3",
60
59
  "tsup": "^8.3.5",
61
60
  "@workspace/configs": "0.0.0"