eslint-plugin-react-naming-convention 2.7.2-beta.2 → 2.7.2-beta.4

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.
Files changed (2) hide show
  1. package/dist/index.js +25 -29
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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";
1
+ import { RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, defineRuleListener, getConfigAdapters, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
2
2
  import { findEnclosingAssignmentTarget, isComponentName, isCreateContextCall, isUseRefCall, isUseStateCall, useComponentCollector, useComponentCollectorLegacy } from "@eslint-react/core";
3
3
  import { ESLintUtils } from "@typescript-eslint/utils";
4
4
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
@@ -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.7.2-beta.2";
44
+ var version = "2.7.2-beta.4";
45
45
 
46
46
  //#endregion
47
47
  //#region src/utils/create-rule.ts
@@ -96,34 +96,30 @@ function create$5(context) {
96
96
  const { rule } = options;
97
97
  const fCollector = useComponentCollector(context);
98
98
  const cCollector = useComponentCollectorLegacy(context);
99
- return {
100
- ...fCollector.listeners,
101
- ...cCollector.listeners,
102
- "Program:exit"(program) {
103
- for (const { id, name: name$2, node: component } of fCollector.ctx.getAllComponents(program)) {
104
- if (isValidName(name$2, options)) continue;
105
- context.report({
106
- messageId: "invalidComponentName",
107
- node: id ?? component,
108
- data: {
109
- name: name$2,
110
- rule
111
- }
112
- });
113
- }
114
- for (const { id, name: name$2, node } of cCollector.ctx.getAllComponents(program)) {
115
- if (isValidName(name$2, options)) continue;
116
- context.report({
117
- messageId: "invalidComponentName",
118
- node: id ?? node,
119
- data: {
120
- name: name$2,
121
- rule
122
- }
123
- });
124
- }
99
+ return defineRuleListener(fCollector.visitors, cCollector.visitors, { "Program:exit"(program) {
100
+ for (const { id, name: name$2, node: component } of fCollector.ctx.getAllComponents(program)) {
101
+ if (isValidName(name$2, options)) continue;
102
+ context.report({
103
+ messageId: "invalidComponentName",
104
+ node: id ?? component,
105
+ data: {
106
+ name: name$2,
107
+ rule
108
+ }
109
+ });
125
110
  }
126
- };
111
+ for (const { id, name: name$2, node } of cCollector.ctx.getAllComponents(program)) {
112
+ if (isValidName(name$2, options)) continue;
113
+ context.report({
114
+ messageId: "invalidComponentName",
115
+ node: id ?? node,
116
+ data: {
117
+ name: name$2,
118
+ rule
119
+ }
120
+ });
121
+ }
122
+ } });
127
123
  }
128
124
  function normalizeOptions(options) {
129
125
  const opts = options[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-naming-convention",
3
- "version": "2.7.2-beta.2",
3
+ "version": "2.7.2-beta.4",
4
4
  "description": "ESLint React's ESLint plugin for naming convention related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -45,11 +45,11 @@
45
45
  "compare-versions": "^6.1.1",
46
46
  "string-ts": "^2.3.1",
47
47
  "ts-pattern": "^5.9.0",
48
- "@eslint-react/eff": "2.7.2-beta.2",
49
- "@eslint-react/ast": "2.7.2-beta.2",
50
- "@eslint-react/core": "2.7.2-beta.2",
51
- "@eslint-react/shared": "2.7.2-beta.2",
52
- "@eslint-react/var": "2.7.2-beta.2"
48
+ "@eslint-react/ast": "2.7.2-beta.4",
49
+ "@eslint-react/core": "2.7.2-beta.4",
50
+ "@eslint-react/eff": "2.7.2-beta.4",
51
+ "@eslint-react/var": "2.7.2-beta.4",
52
+ "@eslint-react/shared": "2.7.2-beta.4"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/react": "^19.2.8",