eslint-plugin-react-naming-convention 1.29.1-next.2 → 1.29.1-next.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.
package/dist/index.js CHANGED
@@ -54,7 +54,7 @@ var rules = {
54
54
 
55
55
  // package.json
56
56
  var name2 = "eslint-plugin-react-naming-convention";
57
- var version = "1.29.1-next.2";
57
+ var version = "1.29.1-next.4";
58
58
  var createRule = shared.createRuleForPlugin("naming-convention");
59
59
 
60
60
  // src/rules/component-name.ts
@@ -212,10 +212,10 @@ var context_name_default = createRule({
212
212
  meta: {
213
213
  type: "problem",
214
214
  docs: {
215
- description: "enforce context name to end with 'Context'"
215
+ description: "enforces context name to be a valid component name with the suffix 'Context'"
216
216
  },
217
217
  messages: {
218
- contextName: "Context name must end with 'Context'."
218
+ contextName: "In React 19, you can render '<Context>' as a provider instead of '<Context.Provider>', it's name must be a valid component name with the suffix 'Context'."
219
219
  },
220
220
  schema: []
221
221
  },
@@ -228,8 +228,7 @@ var context_name_default = createRule({
228
228
  const id = core.getInstanceId(node);
229
229
  if (id == null) return;
230
230
  const name3 = tsPattern.match(id).with({ type: types.AST_NODE_TYPES.Identifier, name: tsPattern.P.select() }, eff.identity).with({ type: types.AST_NODE_TYPES.MemberExpression, property: { name: tsPattern.P.select(tsPattern.P.string) } }, eff.identity).otherwise(() => eff._);
231
- if (name3 == null) return;
232
- if (name3.endsWith("Context")) return;
231
+ if (name3 != null && /^[A-Z]/.test(name3) && name3.endsWith("Context")) return;
233
232
  context.report({
234
233
  messageId: "contextName",
235
234
  node: id
package/dist/index.mjs CHANGED
@@ -28,7 +28,7 @@ var rules = {
28
28
 
29
29
  // package.json
30
30
  var name2 = "eslint-plugin-react-naming-convention";
31
- var version = "1.29.1-next.2";
31
+ var version = "1.29.1-next.4";
32
32
  var createRule = createRuleForPlugin("naming-convention");
33
33
 
34
34
  // src/rules/component-name.ts
@@ -186,10 +186,10 @@ var context_name_default = createRule({
186
186
  meta: {
187
187
  type: "problem",
188
188
  docs: {
189
- description: "enforce context name to end with 'Context'"
189
+ description: "enforces context name to be a valid component name with the suffix 'Context'"
190
190
  },
191
191
  messages: {
192
- contextName: "Context name must end with 'Context'."
192
+ contextName: "In React 19, you can render '<Context>' as a provider instead of '<Context.Provider>', it's name must be a valid component name with the suffix 'Context'."
193
193
  },
194
194
  schema: []
195
195
  },
@@ -202,8 +202,7 @@ var context_name_default = createRule({
202
202
  const id = getInstanceId(node);
203
203
  if (id == null) return;
204
204
  const name3 = match(id).with({ type: AST_NODE_TYPES.Identifier, name: P.select() }, identity).with({ type: AST_NODE_TYPES.MemberExpression, property: { name: P.select(P.string) } }, identity).otherwise(() => _);
205
- if (name3 == null) return;
206
- if (name3.endsWith("Context")) return;
205
+ if (name3 != null && /^[A-Z]/.test(name3) && name3.endsWith("Context")) return;
207
206
  context.report({
208
207
  messageId: "contextName",
209
208
  node: id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-naming-convention",
3
- "version": "1.29.1-next.2",
3
+ "version": "1.29.1-next.4",
4
4
  "description": "ESLint React's ESLint plugin for naming convention related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -49,12 +49,12 @@
49
49
  "@typescript-eslint/utils": "^8.25.0",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.6.2",
52
- "@eslint-react/ast": "1.29.1-next.2",
53
- "@eslint-react/eff": "1.29.1-next.2",
54
- "@eslint-react/jsx": "1.29.1-next.2",
55
- "@eslint-react/core": "1.29.1-next.2",
56
- "@eslint-react/shared": "1.29.1-next.2",
57
- "@eslint-react/var": "1.29.1-next.2"
52
+ "@eslint-react/ast": "1.29.1-next.4",
53
+ "@eslint-react/core": "1.29.1-next.4",
54
+ "@eslint-react/eff": "1.29.1-next.4",
55
+ "@eslint-react/jsx": "1.29.1-next.4",
56
+ "@eslint-react/var": "1.29.1-next.4",
57
+ "@eslint-react/shared": "1.29.1-next.4"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/react": "^19.0.10",