eslint-plugin-react-naming-convention 1.22.2-next.4 → 1.22.2-next.6

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.22.2-next.4";
39
+ var version = "1.22.2-next.6";
40
40
  var createRule = shared.createRuleForPlugin("naming-convention");
41
41
 
42
42
  // src/rules/component-name.ts
@@ -312,19 +312,18 @@ var filename_extension_default = createRule({
312
312
  const allow = eff.isObject(options) ? options.allow : options;
313
313
  const extensions = eff.isObject(options) && "extensions" in options ? options.extensions : defaultOptions3[0].extensions;
314
314
  const filename = context.filename;
315
- const hasJSXNodeRef = eff.MutRef.make(false);
315
+ let hasJSXNode = false;
316
316
  return {
317
317
  JSXElement() {
318
- eff.MutRef.set(hasJSXNodeRef, true);
318
+ hasJSXNode = true;
319
319
  },
320
320
  JSXFragment() {
321
- eff.MutRef.set(hasJSXNodeRef, true);
321
+ hasJSXNode = true;
322
322
  },
323
323
  "Program:exit"(node) {
324
324
  const fileNameExt = filename.slice(filename.lastIndexOf("."));
325
325
  const isJSXExt = extensions.includes(fileNameExt);
326
- const hasJSXCode = eff.MutRef.get(hasJSXNodeRef);
327
- if (hasJSXCode && !isJSXExt) {
326
+ if (hasJSXNode && !isJSXExt) {
328
327
  context.report({
329
328
  messageId: "filenameExtensionInvalid",
330
329
  node
@@ -334,7 +333,7 @@ var filename_extension_default = createRule({
334
333
  const hasCode = node.body.length > 0;
335
334
  const ignoreFilesWithoutCode = eff.isObject(options) && options.ignoreFilesWithoutCode;
336
335
  if (!hasCode && ignoreFilesWithoutCode) return;
337
- if (!hasJSXCode && isJSXExt && allow === "as-needed") {
336
+ if (!hasJSXNode && isJSXExt && allow === "as-needed") {
338
337
  context.report({
339
338
  messageId: "filenameExtensionUnexpected",
340
339
  node
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as AST from '@eslint-react/ast';
2
2
  import { useComponentCollector, useComponentCollectorLegacy, isUseStateCall, isReactHookCallWithNameLoose } from '@eslint-react/core';
3
- import { O, isString, isObject, MutRef, F, isNullable } from '@eslint-react/eff';
3
+ import { O, isString, isObject, F, isNullable } from '@eslint-react/eff';
4
4
  import * as JSX from '@eslint-react/jsx';
5
5
  import { createRuleForPlugin, decodeSettings, RE_CONSTANT_CASE, RE_PASCAL_CASE, RE_CAMEL_CASE, RE_KEBAB_CASE, RE_SNAKE_CASE } from '@eslint-react/shared';
6
6
  import { match } from 'ts-pattern';
@@ -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.22.2-next.4";
13
+ var version = "1.22.2-next.6";
14
14
  var createRule = createRuleForPlugin("naming-convention");
15
15
 
16
16
  // src/rules/component-name.ts
@@ -286,19 +286,18 @@ var filename_extension_default = createRule({
286
286
  const allow = isObject(options) ? options.allow : options;
287
287
  const extensions = isObject(options) && "extensions" in options ? options.extensions : defaultOptions3[0].extensions;
288
288
  const filename = context.filename;
289
- const hasJSXNodeRef = MutRef.make(false);
289
+ let hasJSXNode = false;
290
290
  return {
291
291
  JSXElement() {
292
- MutRef.set(hasJSXNodeRef, true);
292
+ hasJSXNode = true;
293
293
  },
294
294
  JSXFragment() {
295
- MutRef.set(hasJSXNodeRef, true);
295
+ hasJSXNode = true;
296
296
  },
297
297
  "Program:exit"(node) {
298
298
  const fileNameExt = filename.slice(filename.lastIndexOf("."));
299
299
  const isJSXExt = extensions.includes(fileNameExt);
300
- const hasJSXCode = MutRef.get(hasJSXNodeRef);
301
- if (hasJSXCode && !isJSXExt) {
300
+ if (hasJSXNode && !isJSXExt) {
302
301
  context.report({
303
302
  messageId: "filenameExtensionInvalid",
304
303
  node
@@ -308,7 +307,7 @@ var filename_extension_default = createRule({
308
307
  const hasCode = node.body.length > 0;
309
308
  const ignoreFilesWithoutCode = isObject(options) && options.ignoreFilesWithoutCode;
310
309
  if (!hasCode && ignoreFilesWithoutCode) return;
311
- if (!hasJSXCode && isJSXExt && allow === "as-needed") {
310
+ if (!hasJSXNode && isJSXExt && allow === "as-needed") {
312
311
  context.report({
313
312
  messageId: "filenameExtensionUnexpected",
314
313
  node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-naming-convention",
3
- "version": "1.22.2-next.4",
3
+ "version": "1.22.2-next.6",
4
4
  "description": "ESLint React's ESLint plugin for naming convention related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -47,12 +47,12 @@
47
47
  "@typescript-eslint/utils": "^8.18.2",
48
48
  "string-ts": "^2.2.0",
49
49
  "ts-pattern": "^5.6.0",
50
- "@eslint-react/ast": "1.22.2-next.4",
51
- "@eslint-react/eff": "1.22.2-next.4",
52
- "@eslint-react/jsx": "1.22.2-next.4",
53
- "@eslint-react/core": "1.22.2-next.4",
54
- "@eslint-react/shared": "1.22.2-next.4",
55
- "@eslint-react/types": "1.22.2-next.4"
50
+ "@eslint-react/core": "1.22.2-next.6",
51
+ "@eslint-react/eff": "1.22.2-next.6",
52
+ "@eslint-react/jsx": "1.22.2-next.6",
53
+ "@eslint-react/ast": "1.22.2-next.6",
54
+ "@eslint-react/shared": "1.22.2-next.6",
55
+ "@eslint-react/types": "1.22.2-next.6"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/react": "^19.0.2",