eslint-plugin-react-x 2.0.0-beta.172 → 2.0.0-beta.173

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 +395 -684
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -45,7 +45,6 @@ const rules$2 = {
45
45
  "react-x/no-children-only": "warn",
46
46
  "react-x/no-children-to-array": "warn",
47
47
  "react-x/no-clone-element": "warn",
48
- "react-x/no-comment-textnodes": "warn",
49
48
  "react-x/no-component-will-mount": "error",
50
49
  "react-x/no-component-will-receive-props": "error",
51
50
  "react-x/no-component-will-update": "error",
@@ -116,7 +115,7 @@ const settings = { ...settings$1 };
116
115
  //#endregion
117
116
  //#region package.json
118
117
  var name = "eslint-plugin-react-x";
119
- var version = "2.0.0-beta.172";
118
+ var version = "2.0.0-beta.173";
120
119
 
121
120
  //#endregion
122
121
  //#region src/utils/create-rule.ts
@@ -124,23 +123,23 @@ const createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
124
123
 
125
124
  //#endregion
126
125
  //#region src/rules/jsx-key-before-spread.ts
127
- const RULE_NAME$68 = "jsx-key-before-spread";
128
- const RULE_FEATURES$66 = ["EXP"];
126
+ const RULE_NAME$61 = "jsx-key-before-spread";
127
+ const RULE_FEATURES$59 = ["EXP"];
129
128
  var jsx_key_before_spread_default = createRule({
130
129
  meta: {
131
130
  type: "problem",
132
131
  docs: {
133
132
  description: "Enforces that the 'key' attribute is placed before the spread attribute in JSX elements.",
134
- [Symbol.for("rule_features")]: RULE_FEATURES$66
133
+ [Symbol.for("rule_features")]: RULE_FEATURES$59
135
134
  },
136
135
  messages: { jsxKeyBeforeSpread: "The 'key' attribute must be placed before the spread attribute." },
137
136
  schema: []
138
137
  },
139
- name: RULE_NAME$68,
140
- create: create$68,
138
+ name: RULE_NAME$61,
139
+ create: create$61,
141
140
  defaultOptions: []
142
141
  });
143
- function create$68(context) {
142
+ function create$61(context) {
144
143
  return { JSXOpeningElement(node) {
145
144
  let firstSpreadAttributeIndex = null;
146
145
  for (const [index, attr] of node.attributes.entries()) {
@@ -159,23 +158,23 @@ function create$68(context) {
159
158
 
160
159
  //#endregion
161
160
  //#region src/rules/jsx-no-comment-textnodes.ts
162
- const RULE_NAME$67 = "jsx-no-comment-textnodes";
163
- const RULE_FEATURES$65 = [];
161
+ const RULE_NAME$60 = "jsx-no-comment-textnodes";
162
+ const RULE_FEATURES$58 = [];
164
163
  var jsx_no_comment_textnodes_default = createRule({
165
164
  meta: {
166
165
  type: "problem",
167
166
  docs: {
168
167
  description: "Prevents comments from being inserted as text nodes.",
169
- [Symbol.for("rule_features")]: RULE_FEATURES$65
168
+ [Symbol.for("rule_features")]: RULE_FEATURES$58
170
169
  },
171
170
  messages: { jsxNoCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
172
171
  schema: []
173
172
  },
174
- name: RULE_NAME$67,
175
- create: create$67,
173
+ name: RULE_NAME$60,
174
+ create: create$60,
176
175
  defaultOptions: []
177
176
  });
178
- function create$67(context) {
177
+ function create$60(context) {
179
178
  function hasCommentLike(node) {
180
179
  if (AST.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) return false;
181
180
  const rawValue = context.sourceCode.getText(node);
@@ -198,23 +197,23 @@ function create$67(context) {
198
197
 
199
198
  //#endregion
200
199
  //#region src/rules/jsx-no-duplicate-props.ts
201
- const RULE_NAME$66 = "jsx-no-duplicate-props";
202
- const RULE_FEATURES$64 = [];
200
+ const RULE_NAME$59 = "jsx-no-duplicate-props";
201
+ const RULE_FEATURES$57 = [];
203
202
  var jsx_no_duplicate_props_default = createRule({
204
203
  meta: {
205
204
  type: "problem",
206
205
  docs: {
207
206
  description: "Disallow duplicate props in JSX elements.",
208
- [Symbol.for("rule_features")]: RULE_FEATURES$64
207
+ [Symbol.for("rule_features")]: RULE_FEATURES$57
209
208
  },
210
209
  messages: { jsxNoDuplicateProps: "This JSX property is assigned multiple times." },
211
210
  schema: []
212
211
  },
213
- name: RULE_NAME$66,
214
- create: create$66,
212
+ name: RULE_NAME$59,
213
+ create: create$59,
215
214
  defaultOptions: []
216
215
  });
217
- function create$66(context) {
216
+ function create$59(context) {
218
217
  return { JSXOpeningElement(node) {
219
218
  const props = [];
220
219
  for (const attr of node.attributes) {
@@ -235,23 +234,23 @@ function create$66(context) {
235
234
 
236
235
  //#endregion
237
236
  //#region src/rules/jsx-no-iife.ts
238
- const RULE_NAME$65 = "jsx-no-iife";
239
- const RULE_FEATURES$63 = ["EXP"];
237
+ const RULE_NAME$58 = "jsx-no-iife";
238
+ const RULE_FEATURES$56 = ["EXP"];
240
239
  var jsx_no_iife_default = createRule({
241
240
  meta: {
242
241
  type: "problem",
243
242
  docs: {
244
243
  description: "Disallows 'IIFE' in JSX elements.",
245
- [Symbol.for("rule_features")]: RULE_FEATURES$63
244
+ [Symbol.for("rule_features")]: RULE_FEATURES$56
246
245
  },
247
246
  messages: { jsxNoIife: "Avoid using IIFE in JSX elements." },
248
247
  schema: []
249
248
  },
250
- name: RULE_NAME$65,
251
- create: create$65,
249
+ name: RULE_NAME$58,
250
+ create: create$58,
252
251
  defaultOptions: []
253
252
  });
254
- function create$65(context) {
253
+ function create$58(context) {
255
254
  return {
256
255
  "JSXElement :function"(node) {
257
256
  if (node.parent.type === AST_NODE_TYPES.CallExpression && node.parent.callee === node) context.report({
@@ -270,23 +269,23 @@ function create$65(context) {
270
269
 
271
270
  //#endregion
272
271
  //#region src/rules/jsx-no-undef.ts
273
- const RULE_NAME$64 = "jsx-no-undef";
274
- const RULE_FEATURES$62 = [];
272
+ const RULE_NAME$57 = "jsx-no-undef";
273
+ const RULE_FEATURES$55 = [];
275
274
  var jsx_no_undef_default = createRule({
276
275
  meta: {
277
276
  type: "problem",
278
277
  docs: {
279
278
  description: "Disallow undefined variables in JSX.",
280
- [Symbol.for("rule_features")]: RULE_FEATURES$62
279
+ [Symbol.for("rule_features")]: RULE_FEATURES$55
281
280
  },
282
281
  messages: { jsxNoUndef: "JSX variable '{{name}}' is not defined." },
283
282
  schema: []
284
283
  },
285
- name: RULE_NAME$64,
286
- create: create$64,
284
+ name: RULE_NAME$57,
285
+ create: create$57,
287
286
  defaultOptions: []
288
287
  });
289
- function create$64(context) {
288
+ function create$57(context) {
290
289
  return { JSXOpeningElement(node) {
291
290
  const name$4 = match(node.name).with({ type: AST_NODE_TYPES.JSXIdentifier }, (n) => n.name).with({
292
291
  type: AST_NODE_TYPES.JSXMemberExpression,
@@ -305,8 +304,8 @@ function create$64(context) {
305
304
 
306
305
  //#endregion
307
306
  //#region src/rules/jsx-shorthand-boolean.ts
308
- const RULE_NAME$63 = "jsx-shorthand-boolean";
309
- const RULE_FEATURES$61 = ["CFG", "FIX"];
307
+ const RULE_NAME$56 = "jsx-shorthand-boolean";
308
+ const RULE_FEATURES$54 = ["CFG", "FIX"];
310
309
  const defaultOptions$3 = [1];
311
310
  const schema$1 = [{
312
311
  type: "integer",
@@ -317,17 +316,17 @@ var jsx_shorthand_boolean_default = createRule({
317
316
  type: "problem",
318
317
  docs: {
319
318
  description: "Enforces shorthand syntax for boolean attributes.",
320
- [Symbol.for("rule_features")]: RULE_FEATURES$61
319
+ [Symbol.for("rule_features")]: RULE_FEATURES$54
321
320
  },
322
321
  fixable: "code",
323
322
  messages: { jsxShorthandBoolean: "{{message}}" },
324
323
  schema: schema$1
325
324
  },
326
- name: RULE_NAME$63,
327
- create: create$63,
325
+ name: RULE_NAME$56,
326
+ create: create$56,
328
327
  defaultOptions: defaultOptions$3
329
328
  });
330
- function create$63(context) {
329
+ function create$56(context) {
331
330
  const policy = context.options[0] ?? defaultOptions$3[0];
332
331
  return { JSXAttribute(node) {
333
332
  const { value } = node;
@@ -355,8 +354,8 @@ function create$63(context) {
355
354
 
356
355
  //#endregion
357
356
  //#region src/rules/jsx-shorthand-fragment.ts
358
- const RULE_NAME$62 = "jsx-shorthand-fragment";
359
- const RULE_FEATURES$60 = ["CFG", "FIX"];
357
+ const RULE_NAME$55 = "jsx-shorthand-fragment";
358
+ const RULE_FEATURES$53 = ["CFG", "FIX"];
360
359
  const defaultOptions$2 = [1];
361
360
  const schema = [{
362
361
  type: "integer",
@@ -367,17 +366,17 @@ var jsx_shorthand_fragment_default = createRule({
367
366
  type: "problem",
368
367
  docs: {
369
368
  description: "Enforces shorthand syntax for fragments.",
370
- [Symbol.for("rule_features")]: RULE_FEATURES$60
369
+ [Symbol.for("rule_features")]: RULE_FEATURES$53
371
370
  },
372
371
  fixable: "code",
373
372
  messages: { jsxShorthandFragment: "{{message}}" },
374
373
  schema
375
374
  },
376
- name: RULE_NAME$62,
377
- create: create$62,
375
+ name: RULE_NAME$55,
376
+ create: create$55,
378
377
  defaultOptions: defaultOptions$2
379
378
  });
380
- function create$62(context) {
379
+ function create$55(context) {
381
380
  const policy = context.options[0] ?? defaultOptions$2[0];
382
381
  const jsxConfig = {
383
382
  ...JsxConfig.getFromContext(context),
@@ -414,23 +413,23 @@ function create$62(context) {
414
413
  //#endregion
415
414
  //#region src/rules/jsx-uses-react.ts
416
415
  const { JsxEmit } = JsxConfig;
417
- const RULE_NAME$61 = "jsx-uses-react";
418
- const RULE_FEATURES$59 = [];
416
+ const RULE_NAME$54 = "jsx-uses-react";
417
+ const RULE_FEATURES$52 = [];
419
418
  var jsx_uses_react_default = createRule({
420
419
  meta: {
421
420
  type: "problem",
422
421
  docs: {
423
422
  description: "Marks React variables as used when JSX is used.",
424
- [Symbol.for("rule_features")]: RULE_FEATURES$59
423
+ [Symbol.for("rule_features")]: RULE_FEATURES$52
425
424
  },
426
425
  messages: { jsxUsesReact: "Marked {{name}} as used." },
427
426
  schema: []
428
427
  },
429
- name: RULE_NAME$61,
430
- create: create$61,
428
+ name: RULE_NAME$54,
429
+ create: create$54,
431
430
  defaultOptions: []
432
431
  });
433
- function create$61(context) {
432
+ function create$54(context) {
434
433
  const jsxConfig = {
435
434
  ...JsxConfig.getFromContext(context),
436
435
  ...JsxConfig.getFromAnnotation(context)
@@ -462,23 +461,23 @@ function debugReport(context, node, name$4) {
462
461
 
463
462
  //#endregion
464
463
  //#region src/rules/jsx-uses-vars.ts
465
- const RULE_NAME$60 = "jsx-uses-vars";
466
- const RULE_FEATURES$58 = [];
464
+ const RULE_NAME$53 = "jsx-uses-vars";
465
+ const RULE_FEATURES$51 = [];
467
466
  var jsx_uses_vars_default = createRule({
468
467
  meta: {
469
468
  type: "problem",
470
469
  docs: {
471
470
  description: "Marks variables used in JSX elements as used.",
472
- [Symbol.for("rule_features")]: RULE_FEATURES$58
471
+ [Symbol.for("rule_features")]: RULE_FEATURES$51
473
472
  },
474
473
  messages: { jsxUsesVars: "An identifier in JSX is marked as used." },
475
474
  schema: []
476
475
  },
477
- name: RULE_NAME$60,
478
- create: create$60,
476
+ name: RULE_NAME$53,
477
+ create: create$53,
479
478
  defaultOptions: []
480
479
  });
481
- function create$60(context) {
480
+ function create$53(context) {
482
481
  return { JSXOpeningElement(node) {
483
482
  switch (node.name.type) {
484
483
  case AST_NODE_TYPES.JSXIdentifier:
@@ -496,8 +495,8 @@ function create$60(context) {
496
495
 
497
496
  //#endregion
498
497
  //#region src/rules/no-access-state-in-setstate.ts
499
- const RULE_NAME$59 = "no-access-state-in-setstate";
500
- const RULE_FEATURES$57 = [];
498
+ const RULE_NAME$52 = "no-access-state-in-setstate";
499
+ const RULE_FEATURES$50 = [];
501
500
  function isKeyLiteral$2(node, key) {
502
501
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({
503
502
  type: AST_NODE_TYPES.TemplateLiteral,
@@ -509,16 +508,16 @@ var no_access_state_in_setstate_default = createRule({
509
508
  type: "problem",
510
509
  docs: {
511
510
  description: "Disallow accessing `this.state` inside `setState` calls.",
512
- [Symbol.for("rule_features")]: RULE_FEATURES$57
511
+ [Symbol.for("rule_features")]: RULE_FEATURES$50
513
512
  },
514
513
  messages: { noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead." },
515
514
  schema: []
516
515
  },
517
- name: RULE_NAME$59,
518
- create: create$59,
516
+ name: RULE_NAME$52,
517
+ create: create$52,
519
518
  defaultOptions: []
520
519
  });
521
- function create$59(context) {
520
+ function create$52(context) {
522
521
  if (!context.sourceCode.text.includes("setState")) return {};
523
522
  const classEntries = [];
524
523
  const methodEntries = [];
@@ -590,8 +589,8 @@ function create$59(context) {
590
589
 
591
590
  //#endregion
592
591
  //#region src/rules/no-array-index-key.ts
593
- const RULE_NAME$58 = "no-array-index-key";
594
- const RULE_FEATURES$56 = [];
592
+ const RULE_NAME$51 = "no-array-index-key";
593
+ const RULE_FEATURES$49 = [];
595
594
  const REACT_CHILDREN_METHOD = ["forEach", "map"];
596
595
  function isReactChildrenMethod(name$4) {
597
596
  return REACT_CHILDREN_METHOD.includes(name$4);
@@ -631,16 +630,16 @@ var no_array_index_key_default = createRule({
631
630
  type: "problem",
632
631
  docs: {
633
632
  description: "Disallow an item's index in the array as its key.",
634
- [Symbol.for("rule_features")]: RULE_FEATURES$56
633
+ [Symbol.for("rule_features")]: RULE_FEATURES$49
635
634
  },
636
635
  messages: { noArrayIndexKey: "Do not use item index in the array as its key." },
637
636
  schema: []
638
637
  },
639
- name: RULE_NAME$58,
640
- create: create$58,
638
+ name: RULE_NAME$51,
639
+ create: create$51,
641
640
  defaultOptions: []
642
641
  });
643
- function create$58(context) {
642
+ function create$51(context) {
644
643
  const report = Reporter.make(context);
645
644
  const indexParamNames = [];
646
645
  function isArrayIndex(node) {
@@ -707,23 +706,23 @@ function create$58(context) {
707
706
 
708
707
  //#endregion
709
708
  //#region src/rules/no-children-count.ts
710
- const RULE_NAME$57 = "no-children-count";
711
- const RULE_FEATURES$55 = [];
709
+ const RULE_NAME$50 = "no-children-count";
710
+ const RULE_FEATURES$48 = [];
712
711
  var no_children_count_default = createRule({
713
712
  meta: {
714
713
  type: "problem",
715
714
  docs: {
716
715
  description: "Disallow `Children.count`.",
717
- [Symbol.for("rule_features")]: RULE_FEATURES$55
716
+ [Symbol.for("rule_features")]: RULE_FEATURES$48
718
717
  },
719
718
  messages: { noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead." },
720
719
  schema: []
721
720
  },
722
- name: RULE_NAME$57,
723
- create: create$57,
721
+ name: RULE_NAME$50,
722
+ create: create$50,
724
723
  defaultOptions: []
725
724
  });
726
- function create$57(context) {
725
+ function create$50(context) {
727
726
  return { MemberExpression(node) {
728
727
  if (ER.isChildrenCount(context, node)) context.report({
729
728
  messageId: "noChildrenCount",
@@ -734,23 +733,23 @@ function create$57(context) {
734
733
 
735
734
  //#endregion
736
735
  //#region src/rules/no-children-for-each.ts
737
- const RULE_NAME$56 = "no-children-for-each";
738
- const RULE_FEATURES$54 = [];
736
+ const RULE_NAME$49 = "no-children-for-each";
737
+ const RULE_FEATURES$47 = [];
739
738
  var no_children_for_each_default = createRule({
740
739
  meta: {
741
740
  type: "problem",
742
741
  docs: {
743
742
  description: "Disallow 'Children.forEach'.",
744
- [Symbol.for("rule_features")]: RULE_FEATURES$54
743
+ [Symbol.for("rule_features")]: RULE_FEATURES$47
745
744
  },
746
745
  messages: { noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead." },
747
746
  schema: []
748
747
  },
749
- name: RULE_NAME$56,
750
- create: create$56,
748
+ name: RULE_NAME$49,
749
+ create: create$49,
751
750
  defaultOptions: []
752
751
  });
753
- function create$56(context) {
752
+ function create$49(context) {
754
753
  return { MemberExpression(node) {
755
754
  if (ER.isChildrenForEach(context, node)) context.report({
756
755
  messageId: "noChildrenForEach",
@@ -761,23 +760,23 @@ function create$56(context) {
761
760
 
762
761
  //#endregion
763
762
  //#region src/rules/no-children-map.ts
764
- const RULE_NAME$55 = "no-children-map";
765
- const RULE_FEATURES$53 = [];
763
+ const RULE_NAME$48 = "no-children-map";
764
+ const RULE_FEATURES$46 = [];
766
765
  var no_children_map_default = createRule({
767
766
  meta: {
768
767
  type: "problem",
769
768
  docs: {
770
769
  description: "Disallow `Children.map`.",
771
- [Symbol.for("rule_features")]: RULE_FEATURES$53
770
+ [Symbol.for("rule_features")]: RULE_FEATURES$46
772
771
  },
773
772
  messages: { noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead." },
774
773
  schema: []
775
774
  },
776
- name: RULE_NAME$55,
777
- create: create$55,
775
+ name: RULE_NAME$48,
776
+ create: create$48,
778
777
  defaultOptions: []
779
778
  });
780
- function create$55(context) {
779
+ function create$48(context) {
781
780
  return { MemberExpression(node) {
782
781
  if (ER.isChildrenMap(context, node)) context.report({
783
782
  messageId: "noChildrenMap",
@@ -788,23 +787,23 @@ function create$55(context) {
788
787
 
789
788
  //#endregion
790
789
  //#region src/rules/no-children-only.ts
791
- const RULE_NAME$54 = "no-children-only";
792
- const RULE_FEATURES$52 = [];
790
+ const RULE_NAME$47 = "no-children-only";
791
+ const RULE_FEATURES$45 = [];
793
792
  var no_children_only_default = createRule({
794
793
  meta: {
795
794
  type: "problem",
796
795
  docs: {
797
796
  description: "Disallow `Children.only`.",
798
- [Symbol.for("rule_features")]: RULE_FEATURES$52
797
+ [Symbol.for("rule_features")]: RULE_FEATURES$45
799
798
  },
800
799
  messages: { noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead." },
801
800
  schema: []
802
801
  },
803
- name: RULE_NAME$54,
804
- create: create$54,
802
+ name: RULE_NAME$47,
803
+ create: create$47,
805
804
  defaultOptions: []
806
805
  });
807
- function create$54(context) {
806
+ function create$47(context) {
808
807
  return { MemberExpression(node) {
809
808
  if (ER.isChildrenOnly(context, node)) context.report({
810
809
  messageId: "noChildrenOnly",
@@ -815,23 +814,23 @@ function create$54(context) {
815
814
 
816
815
  //#endregion
817
816
  //#region src/rules/no-children-prop.ts
818
- const RULE_NAME$53 = "no-children-prop";
819
- const RULE_FEATURES$51 = [];
817
+ const RULE_NAME$46 = "no-children-prop";
818
+ const RULE_FEATURES$44 = [];
820
819
  var no_children_prop_default = createRule({
821
820
  meta: {
822
821
  type: "problem",
823
822
  docs: {
824
823
  description: "Disallow passing `children` as a prop.",
825
- [Symbol.for("rule_features")]: RULE_FEATURES$51
824
+ [Symbol.for("rule_features")]: RULE_FEATURES$44
826
825
  },
827
826
  messages: { noChildrenProp: "Do not pass 'children' as props." },
828
827
  schema: []
829
828
  },
830
- name: RULE_NAME$53,
831
- create: create$53,
829
+ name: RULE_NAME$46,
830
+ create: create$46,
832
831
  defaultOptions: []
833
832
  });
834
- function create$53(context) {
833
+ function create$46(context) {
835
834
  return { JSXElement(node) {
836
835
  const getAttribute = ER.getAttribute(context, node.openingElement.attributes, context.sourceCode.getScope(node));
837
836
  const childrenProp = getAttribute("children");
@@ -844,23 +843,23 @@ function create$53(context) {
844
843
 
845
844
  //#endregion
846
845
  //#region src/rules/no-children-to-array.ts
847
- const RULE_NAME$52 = "no-children-to-array";
848
- const RULE_FEATURES$50 = [];
846
+ const RULE_NAME$45 = "no-children-to-array";
847
+ const RULE_FEATURES$43 = [];
849
848
  var no_children_to_array_default = createRule({
850
849
  meta: {
851
850
  type: "problem",
852
851
  docs: {
853
852
  description: "Disallow `Children.toArray`.",
854
- [Symbol.for("rule_features")]: RULE_FEATURES$50
853
+ [Symbol.for("rule_features")]: RULE_FEATURES$43
855
854
  },
856
855
  messages: { noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead." },
857
856
  schema: []
858
857
  },
859
- name: RULE_NAME$52,
860
- create: create$52,
858
+ name: RULE_NAME$45,
859
+ create: create$45,
861
860
  defaultOptions: []
862
861
  });
863
- function create$52(context) {
862
+ function create$45(context) {
864
863
  return { MemberExpression(node) {
865
864
  if (ER.isChildrenToArray(context, node)) context.report({
866
865
  messageId: "noChildrenToArray",
@@ -871,23 +870,23 @@ function create$52(context) {
871
870
 
872
871
  //#endregion
873
872
  //#region src/rules/no-class-component.ts
874
- const RULE_NAME$51 = "no-class-component";
875
- const RULE_FEATURES$49 = [];
873
+ const RULE_NAME$44 = "no-class-component";
874
+ const RULE_FEATURES$42 = [];
876
875
  var no_class_component_default = createRule({
877
876
  meta: {
878
877
  type: "problem",
879
878
  docs: {
880
879
  description: "Disallow class components except for error boundaries.",
881
- [Symbol.for("rule_features")]: RULE_FEATURES$49
880
+ [Symbol.for("rule_features")]: RULE_FEATURES$42
882
881
  },
883
882
  messages: { noClassComponent: "Avoid using class components. Use function components instead." },
884
883
  schema: []
885
884
  },
886
- name: RULE_NAME$51,
887
- create: create$51,
885
+ name: RULE_NAME$44,
886
+ create: create$44,
888
887
  defaultOptions: []
889
888
  });
890
- function create$51(context) {
889
+ function create$44(context) {
891
890
  if (!context.sourceCode.text.includes("Component")) return {};
892
891
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
893
892
  return {
@@ -908,23 +907,23 @@ function create$51(context) {
908
907
 
909
908
  //#endregion
910
909
  //#region src/rules/no-clone-element.ts
911
- const RULE_NAME$50 = "no-clone-element";
912
- const RULE_FEATURES$48 = [];
910
+ const RULE_NAME$43 = "no-clone-element";
911
+ const RULE_FEATURES$41 = [];
913
912
  var no_clone_element_default = createRule({
914
913
  meta: {
915
914
  type: "problem",
916
915
  docs: {
917
916
  description: "Disallow `cloneElement`.",
918
- [Symbol.for("rule_features")]: RULE_FEATURES$48
917
+ [Symbol.for("rule_features")]: RULE_FEATURES$41
919
918
  },
920
919
  messages: { noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead." },
921
920
  schema: []
922
921
  },
923
- name: RULE_NAME$50,
924
- create: create$50,
922
+ name: RULE_NAME$43,
923
+ create: create$43,
925
924
  defaultOptions: []
926
925
  });
927
- function create$50(context) {
926
+ function create$43(context) {
928
927
  return { CallExpression(node) {
929
928
  if (ER.isCloneElementCall(context, node)) context.report({
930
929
  messageId: "noCloneElement",
@@ -935,24 +934,24 @@ function create$50(context) {
935
934
 
936
935
  //#endregion
937
936
  //#region src/rules/no-component-will-mount.ts
938
- const RULE_NAME$49 = "no-component-will-mount";
939
- const RULE_FEATURES$47 = ["MOD"];
937
+ const RULE_NAME$42 = "no-component-will-mount";
938
+ const RULE_FEATURES$40 = ["MOD"];
940
939
  var no_component_will_mount_default = createRule({
941
940
  meta: {
942
941
  type: "problem",
943
942
  docs: {
944
943
  description: "Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.",
945
- [Symbol.for("rule_features")]: RULE_FEATURES$47
944
+ [Symbol.for("rule_features")]: RULE_FEATURES$40
946
945
  },
947
946
  fixable: "code",
948
947
  messages: { noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead." },
949
948
  schema: []
950
949
  },
951
- name: RULE_NAME$49,
952
- create: create$49,
950
+ name: RULE_NAME$42,
951
+ create: create$42,
953
952
  defaultOptions: []
954
953
  });
955
- function create$49(context) {
954
+ function create$42(context) {
956
955
  if (!context.sourceCode.text.includes("componentWillMount")) return {};
957
956
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
958
957
  return {
@@ -976,24 +975,24 @@ function create$49(context) {
976
975
 
977
976
  //#endregion
978
977
  //#region src/rules/no-component-will-receive-props.ts
979
- const RULE_NAME$48 = "no-component-will-receive-props";
980
- const RULE_FEATURES$46 = ["MOD"];
978
+ const RULE_NAME$41 = "no-component-will-receive-props";
979
+ const RULE_FEATURES$39 = ["MOD"];
981
980
  var no_component_will_receive_props_default = createRule({
982
981
  meta: {
983
982
  type: "problem",
984
983
  docs: {
985
984
  description: "Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.",
986
- [Symbol.for("rule_features")]: RULE_FEATURES$46
985
+ [Symbol.for("rule_features")]: RULE_FEATURES$39
987
986
  },
988
987
  fixable: "code",
989
988
  messages: { noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead." },
990
989
  schema: []
991
990
  },
992
- name: RULE_NAME$48,
993
- create: create$48,
991
+ name: RULE_NAME$41,
992
+ create: create$41,
994
993
  defaultOptions: []
995
994
  });
996
- function create$48(context) {
995
+ function create$41(context) {
997
996
  if (!context.sourceCode.text.includes("componentWillReceiveProps")) return {};
998
997
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
999
998
  return {
@@ -1017,24 +1016,24 @@ function create$48(context) {
1017
1016
 
1018
1017
  //#endregion
1019
1018
  //#region src/rules/no-component-will-update.ts
1020
- const RULE_NAME$47 = "no-component-will-update";
1021
- const RULE_FEATURES$45 = ["MOD"];
1019
+ const RULE_NAME$40 = "no-component-will-update";
1020
+ const RULE_FEATURES$38 = ["MOD"];
1022
1021
  var no_component_will_update_default = createRule({
1023
1022
  meta: {
1024
1023
  type: "problem",
1025
1024
  docs: {
1026
1025
  description: "Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.",
1027
- [Symbol.for("rule_features")]: RULE_FEATURES$45
1026
+ [Symbol.for("rule_features")]: RULE_FEATURES$38
1028
1027
  },
1029
1028
  fixable: "code",
1030
1029
  messages: { noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead." },
1031
1030
  schema: []
1032
1031
  },
1033
- name: RULE_NAME$47,
1034
- create: create$47,
1032
+ name: RULE_NAME$40,
1033
+ create: create$40,
1035
1034
  defaultOptions: []
1036
1035
  });
1037
- function create$47(context) {
1036
+ function create$40(context) {
1038
1037
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
1039
1038
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
1040
1039
  return {
@@ -1058,24 +1057,24 @@ function create$47(context) {
1058
1057
 
1059
1058
  //#endregion
1060
1059
  //#region src/rules/no-context-provider.ts
1061
- const RULE_NAME$46 = "no-context-provider";
1062
- const RULE_FEATURES$44 = ["MOD"];
1060
+ const RULE_NAME$39 = "no-context-provider";
1061
+ const RULE_FEATURES$37 = ["MOD"];
1063
1062
  var no_context_provider_default = createRule({
1064
1063
  meta: {
1065
1064
  type: "problem",
1066
1065
  docs: {
1067
1066
  description: "Replace usages of `<Context.Provider>` with `<Context>`.",
1068
- [Symbol.for("rule_features")]: RULE_FEATURES$44
1067
+ [Symbol.for("rule_features")]: RULE_FEATURES$37
1069
1068
  },
1070
1069
  fixable: "code",
1071
1070
  messages: { noContextProvider: "In React 19, you can render '<Context>' as a provider instead of '<Context.Provider>'." },
1072
1071
  schema: []
1073
1072
  },
1074
- name: RULE_NAME$46,
1075
- create: create$46,
1073
+ name: RULE_NAME$39,
1074
+ create: create$39,
1076
1075
  defaultOptions: []
1077
1076
  });
1078
- function create$46(context) {
1077
+ function create$39(context) {
1079
1078
  if (!context.sourceCode.text.includes("Provider")) return {};
1080
1079
  const { version: version$1 } = getSettingsFromContext(context);
1081
1080
  if (compare(version$1, "19.0.0", "<")) return {};
@@ -1103,23 +1102,23 @@ function create$46(context) {
1103
1102
 
1104
1103
  //#endregion
1105
1104
  //#region src/rules/no-create-ref.ts
1106
- const RULE_NAME$45 = "no-create-ref";
1107
- const RULE_FEATURES$43 = [];
1105
+ const RULE_NAME$38 = "no-create-ref";
1106
+ const RULE_FEATURES$36 = [];
1108
1107
  var no_create_ref_default = createRule({
1109
1108
  meta: {
1110
1109
  type: "problem",
1111
1110
  docs: {
1112
1111
  description: "Disallow `createRef` in function components.",
1113
- [Symbol.for("rule_features")]: RULE_FEATURES$43
1112
+ [Symbol.for("rule_features")]: RULE_FEATURES$36
1114
1113
  },
1115
1114
  messages: { noCreateRef: "[Deprecated] Use 'useRef' instead." },
1116
1115
  schema: []
1117
1116
  },
1118
- name: RULE_NAME$45,
1119
- create: create$45,
1117
+ name: RULE_NAME$38,
1118
+ create: create$38,
1120
1119
  defaultOptions: []
1121
1120
  });
1122
- function create$45(context) {
1121
+ function create$38(context) {
1123
1122
  return { CallExpression(node) {
1124
1123
  if (ER.isCreateRefCall(context, node) && AST.findParentNode(node, ER.isClassComponent) == null) context.report({
1125
1124
  messageId: "noCreateRef",
@@ -1130,23 +1129,23 @@ function create$45(context) {
1130
1129
 
1131
1130
  //#endregion
1132
1131
  //#region src/rules/no-default-props.ts
1133
- const RULE_NAME$44 = "no-default-props";
1134
- const RULE_FEATURES$42 = [];
1132
+ const RULE_NAME$37 = "no-default-props";
1133
+ const RULE_FEATURES$35 = [];
1135
1134
  var no_default_props_default = createRule({
1136
1135
  meta: {
1137
1136
  type: "problem",
1138
1137
  docs: {
1139
1138
  description: "Disallow `defaultProps` property in favor of ES6 default parameters.",
1140
- [Symbol.for("rule_features")]: RULE_FEATURES$42
1139
+ [Symbol.for("rule_features")]: RULE_FEATURES$35
1141
1140
  },
1142
1141
  messages: { noDefaultProps: "[Deprecated] Use ES6 default parameters instead." },
1143
1142
  schema: []
1144
1143
  },
1145
- name: RULE_NAME$44,
1146
- create: create$44,
1144
+ name: RULE_NAME$37,
1145
+ create: create$37,
1147
1146
  defaultOptions: []
1148
1147
  });
1149
- function create$44(context) {
1148
+ function create$37(context) {
1150
1149
  if (!context.sourceCode.text.includes("defaultProps")) return {};
1151
1150
  return { AssignmentExpression(node) {
1152
1151
  if (node.operator !== "=" || node.left.type !== AST_NODE_TYPES.MemberExpression) return;
@@ -1167,8 +1166,8 @@ function create$44(context) {
1167
1166
 
1168
1167
  //#endregion
1169
1168
  //#region src/rules/no-direct-mutation-state.ts
1170
- const RULE_NAME$43 = "no-direct-mutation-state";
1171
- const RULE_FEATURES$41 = [];
1169
+ const RULE_NAME$36 = "no-direct-mutation-state";
1170
+ const RULE_FEATURES$34 = [];
1172
1171
  function isConstructorFunction(node) {
1173
1172
  return AST.isOneOf([AST_NODE_TYPES.FunctionDeclaration, AST_NODE_TYPES.FunctionExpression])(node) && AST.isMethodOrProperty(node.parent) && node.parent.key.type === AST_NODE_TYPES.Identifier && node.parent.key.name === "constructor";
1174
1173
  }
@@ -1177,16 +1176,16 @@ var no_direct_mutation_state_default = createRule({
1177
1176
  type: "problem",
1178
1177
  docs: {
1179
1178
  description: "Disallow direct mutation of `this.state`.",
1180
- [Symbol.for("rule_features")]: RULE_FEATURES$41
1179
+ [Symbol.for("rule_features")]: RULE_FEATURES$34
1181
1180
  },
1182
1181
  messages: { noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead." },
1183
1182
  schema: []
1184
1183
  },
1185
- name: RULE_NAME$43,
1186
- create: create$43,
1184
+ name: RULE_NAME$36,
1185
+ create: create$36,
1187
1186
  defaultOptions: []
1188
1187
  });
1189
- function create$43(context) {
1188
+ function create$36(context) {
1190
1189
  return { AssignmentExpression(node) {
1191
1190
  if (!ER.isAssignmentToThisState(node)) return;
1192
1191
  const parentClass = AST.findParentNode(node, AST.isOneOf([AST_NODE_TYPES.ClassDeclaration, AST_NODE_TYPES.ClassExpression]));
@@ -1200,23 +1199,23 @@ function create$43(context) {
1200
1199
 
1201
1200
  //#endregion
1202
1201
  //#region src/rules/no-duplicate-key.ts
1203
- const RULE_NAME$42 = "no-duplicate-key";
1204
- const RULE_FEATURES$40 = [];
1202
+ const RULE_NAME$35 = "no-duplicate-key";
1203
+ const RULE_FEATURES$33 = [];
1205
1204
  var no_duplicate_key_default = createRule({
1206
1205
  meta: {
1207
1206
  type: "problem",
1208
1207
  docs: {
1209
1208
  description: "Disallow duplicate `key` on elements in the same array or a list of `children`.",
1210
- [Symbol.for("rule_features")]: RULE_FEATURES$40
1209
+ [Symbol.for("rule_features")]: RULE_FEATURES$33
1211
1210
  },
1212
1211
  messages: { noDuplicateKey: "A key must be unique. '{{value}}' is duplicated." },
1213
1212
  schema: []
1214
1213
  },
1215
- name: RULE_NAME$42,
1216
- create: create$42,
1214
+ name: RULE_NAME$35,
1215
+ create: create$35,
1217
1216
  defaultOptions: []
1218
1217
  });
1219
- function create$42(context) {
1218
+ function create$35(context) {
1220
1219
  if (!context.sourceCode.getText().includes("key=")) return {};
1221
1220
  const keyedEntries = /* @__PURE__ */ new Map();
1222
1221
  function isKeyValueEqual(a, b) {
@@ -1271,8 +1270,8 @@ function create$42(context) {
1271
1270
 
1272
1271
  //#endregion
1273
1272
  //#region src/rules/no-forbidden-props.ts
1274
- const RULE_NAME$41 = "no-forbidden-props";
1275
- const messageId = camelCase(RULE_NAME$41);
1273
+ const RULE_NAME$34 = "no-forbidden-props";
1274
+ const messageId = camelCase(RULE_NAME$34);
1276
1275
  const defaultOptions$1 = [{ forbid: [{ prop: "/_/" }] }];
1277
1276
  var no_forbidden_props_default = createRule({
1278
1277
  meta: {
@@ -1316,11 +1315,11 @@ var no_forbidden_props_default = createRule({
1316
1315
  } }
1317
1316
  }]
1318
1317
  },
1319
- name: RULE_NAME$41,
1320
- create: create$41,
1318
+ name: RULE_NAME$34,
1319
+ create: create$34,
1321
1320
  defaultOptions: defaultOptions$1
1322
1321
  });
1323
- function create$41(context, [option]) {
1322
+ function create$34(context, [option]) {
1324
1323
  const { forbid = [{ prop: "/_/" }] } = option;
1325
1324
  return { JSXOpeningElement(node) {
1326
1325
  let nodeName = null;
@@ -1349,24 +1348,24 @@ function create$41(context, [option]) {
1349
1348
 
1350
1349
  //#endregion
1351
1350
  //#region src/rules/no-forward-ref.ts
1352
- const RULE_NAME$40 = "no-forward-ref";
1353
- const RULE_FEATURES$39 = ["MOD"];
1351
+ const RULE_NAME$33 = "no-forward-ref";
1352
+ const RULE_FEATURES$32 = ["MOD"];
1354
1353
  var no_forward_ref_default = createRule({
1355
1354
  meta: {
1356
1355
  type: "problem",
1357
1356
  docs: {
1358
1357
  description: "Replaces usages of `forwardRef` with passing `ref` as a prop.",
1359
- [Symbol.for("rule_features")]: RULE_FEATURES$39
1358
+ [Symbol.for("rule_features")]: RULE_FEATURES$32
1360
1359
  },
1361
1360
  fixable: "code",
1362
1361
  messages: { noForwardRef: "In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead." },
1363
1362
  schema: []
1364
1363
  },
1365
- name: RULE_NAME$40,
1366
- create: create$40,
1364
+ name: RULE_NAME$33,
1365
+ create: create$33,
1367
1366
  defaultOptions: []
1368
1367
  });
1369
- function create$40(context) {
1368
+ function create$33(context) {
1370
1369
  if (!context.sourceCode.text.includes("forwardRef")) return {};
1371
1370
  const { version: version$1 } = getSettingsFromContext(context);
1372
1371
  if (compare(version$1, "19.0.0", "<")) return {};
@@ -1447,23 +1446,23 @@ function getComponentPropsFixes(context, fixer, node, typeArguments) {
1447
1446
 
1448
1447
  //#endregion
1449
1448
  //#region src/rules/no-implicit-key.ts
1450
- const RULE_NAME$39 = "no-implicit-key";
1451
- const RULE_FEATURES$38 = ["EXP"];
1449
+ const RULE_NAME$32 = "no-implicit-key";
1450
+ const RULE_FEATURES$31 = ["EXP"];
1452
1451
  var no_implicit_key_default = createRule({
1453
1452
  meta: {
1454
1453
  type: "problem",
1455
1454
  docs: {
1456
1455
  description: "Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).",
1457
- [Symbol.for("rule_features")]: RULE_FEATURES$38
1456
+ [Symbol.for("rule_features")]: RULE_FEATURES$31
1458
1457
  },
1459
1458
  messages: { noImplicitKey: "Do not use implicit 'key' props." },
1460
1459
  schema: []
1461
1460
  },
1462
- name: RULE_NAME$39,
1463
- create: create$39,
1461
+ name: RULE_NAME$32,
1462
+ create: create$32,
1464
1463
  defaultOptions: []
1465
1464
  });
1466
- function create$39(context) {
1465
+ function create$32(context) {
1467
1466
  return { JSXOpeningElement(node) {
1468
1467
  const initialScope = context.sourceCode.getScope(node);
1469
1468
  const keyProp = ER.getAttribute(context, node.attributes, initialScope)("key");
@@ -1477,23 +1476,23 @@ function create$39(context) {
1477
1476
 
1478
1477
  //#endregion
1479
1478
  //#region src/rules/no-leaked-conditional-rendering.ts
1480
- const RULE_NAME$38 = "no-leaked-conditional-rendering";
1481
- const RULE_FEATURES$37 = ["TSC"];
1479
+ const RULE_NAME$31 = "no-leaked-conditional-rendering";
1480
+ const RULE_FEATURES$30 = ["TSC"];
1482
1481
  var no_leaked_conditional_rendering_default = createRule({
1483
1482
  meta: {
1484
1483
  type: "problem",
1485
1484
  docs: {
1486
1485
  description: "Prevents problematic leaked values from being rendered.",
1487
- [Symbol.for("rule_features")]: RULE_FEATURES$37
1486
+ [Symbol.for("rule_features")]: RULE_FEATURES$30
1488
1487
  },
1489
1488
  messages: { noLeakedConditionalRendering: "Potential leaked value {{value}} that might cause unintentionally rendered values or rendering crashes." },
1490
1489
  schema: []
1491
1490
  },
1492
- name: RULE_NAME$38,
1493
- create: create$38,
1491
+ name: RULE_NAME$31,
1492
+ create: create$31,
1494
1493
  defaultOptions: []
1495
1494
  });
1496
- function create$38(context) {
1495
+ function create$31(context) {
1497
1496
  if (!context.sourceCode.text.includes("&&")) return {};
1498
1497
  const { version: version$1 } = getSettingsFromContext(context);
1499
1498
  const allowedVariants = [
@@ -1549,23 +1548,23 @@ function create$38(context) {
1549
1548
 
1550
1549
  //#endregion
1551
1550
  //#region src/rules/no-missing-component-display-name.ts
1552
- const RULE_NAME$37 = "no-missing-component-display-name";
1553
- const RULE_FEATURES$36 = [];
1551
+ const RULE_NAME$30 = "no-missing-component-display-name";
1552
+ const RULE_FEATURES$29 = [];
1554
1553
  var no_missing_component_display_name_default = createRule({
1555
1554
  meta: {
1556
1555
  type: "problem",
1557
1556
  docs: {
1558
1557
  description: "Enforces that all components have a `displayName` which can be used in devtools.",
1559
- [Symbol.for("rule_features")]: RULE_FEATURES$36
1558
+ [Symbol.for("rule_features")]: RULE_FEATURES$29
1560
1559
  },
1561
1560
  messages: { noMissingComponentDisplayName: "Add missing 'displayName' for component." },
1562
1561
  schema: []
1563
1562
  },
1564
- name: RULE_NAME$37,
1565
- create: create$37,
1563
+ name: RULE_NAME$30,
1564
+ create: create$30,
1566
1565
  defaultOptions: []
1567
1566
  });
1568
- function create$37(context) {
1567
+ function create$30(context) {
1569
1568
  if (!context.sourceCode.text.includes("memo") && !context.sourceCode.text.includes("forwardRef")) return {};
1570
1569
  const { ctx, listeners } = ER.useComponentCollector(context, {
1571
1570
  collectDisplayName: true,
@@ -1594,24 +1593,24 @@ function create$37(context) {
1594
1593
 
1595
1594
  //#endregion
1596
1595
  //#region src/rules/no-missing-context-display-name.ts
1597
- const RULE_NAME$36 = "no-missing-context-display-name";
1598
- const RULE_FEATURES$35 = ["FIX"];
1596
+ const RULE_NAME$29 = "no-missing-context-display-name";
1597
+ const RULE_FEATURES$28 = ["FIX"];
1599
1598
  var no_missing_context_display_name_default = createRule({
1600
1599
  meta: {
1601
1600
  type: "problem",
1602
1601
  docs: {
1603
1602
  description: "Enforces that all contexts have a `displayName` which can be used in devtools.",
1604
- [Symbol.for("rule_features")]: RULE_FEATURES$35
1603
+ [Symbol.for("rule_features")]: RULE_FEATURES$28
1605
1604
  },
1606
1605
  fixable: "code",
1607
1606
  messages: { noMissingContextDisplayName: "Add missing 'displayName' for context." },
1608
1607
  schema: []
1609
1608
  },
1610
- name: RULE_NAME$36,
1611
- create: create$36,
1612
- defaultOptions: []
1609
+ name: RULE_NAME$29,
1610
+ create: create$29,
1611
+ defaultOptions: []
1613
1612
  });
1614
- function create$36(context) {
1613
+ function create$29(context) {
1615
1614
  if (!context.sourceCode.text.includes("createContext")) return {};
1616
1615
  const createCalls = [];
1617
1616
  const displayNameAssignments = [];
@@ -1667,14 +1666,14 @@ function create$36(context) {
1667
1666
 
1668
1667
  //#endregion
1669
1668
  //#region src/rules/no-missing-key.ts
1670
- const RULE_NAME$35 = "no-missing-key";
1671
- const RULE_FEATURES$34 = [];
1669
+ const RULE_NAME$28 = "no-missing-key";
1670
+ const RULE_FEATURES$27 = [];
1672
1671
  var no_missing_key_default = createRule({
1673
1672
  meta: {
1674
1673
  type: "problem",
1675
1674
  docs: {
1676
1675
  description: "Disallow missing `key` on items in list rendering.",
1677
- [Symbol.for("rule_features")]: RULE_FEATURES$34
1676
+ [Symbol.for("rule_features")]: RULE_FEATURES$27
1678
1677
  },
1679
1678
  messages: {
1680
1679
  missingKey: "Missing 'key' for element when rendering list.",
@@ -1682,11 +1681,11 @@ var no_missing_key_default = createRule({
1682
1681
  },
1683
1682
  schema: []
1684
1683
  },
1685
- name: RULE_NAME$35,
1686
- create: create$35,
1684
+ name: RULE_NAME$28,
1685
+ create: create$28,
1687
1686
  defaultOptions: []
1688
1687
  });
1689
- function create$35(context) {
1688
+ function create$28(context) {
1690
1689
  const report = Reporter.make(context);
1691
1690
  const state = { isWithinChildrenToArray: false };
1692
1691
  function checkIteratorElement(node) {
@@ -1767,14 +1766,14 @@ function create$35(context) {
1767
1766
 
1768
1767
  //#endregion
1769
1768
  //#region src/rules/no-misused-capture-owner-stack.ts
1770
- const RULE_NAME$34 = "no-misused-capture-owner-stack";
1771
- const RULE_FEATURES$33 = ["EXP"];
1769
+ const RULE_NAME$27 = "no-misused-capture-owner-stack";
1770
+ const RULE_FEATURES$26 = ["EXP"];
1772
1771
  var no_misused_capture_owner_stack_default = createRule({
1773
1772
  meta: {
1774
1773
  type: "problem",
1775
1774
  docs: {
1776
1775
  description: "Prevents incorrect usage of `captureOwnerStack`.",
1777
- [Symbol.for("rule_features")]: RULE_FEATURES$33
1776
+ [Symbol.for("rule_features")]: RULE_FEATURES$26
1778
1777
  },
1779
1778
  fixable: "code",
1780
1779
  messages: {
@@ -1783,11 +1782,11 @@ var no_misused_capture_owner_stack_default = createRule({
1783
1782
  },
1784
1783
  schema: []
1785
1784
  },
1786
- name: RULE_NAME$34,
1787
- create: create$34,
1785
+ name: RULE_NAME$27,
1786
+ create: create$27,
1788
1787
  defaultOptions: []
1789
1788
  });
1790
- function create$34(context) {
1789
+ function create$27(context) {
1791
1790
  if (!context.sourceCode.text.includes("captureOwnerStack")) return {};
1792
1791
  const { importSource } = getSettingsFromContext(context);
1793
1792
  return {
@@ -1819,23 +1818,23 @@ function isDevelopmentOnlyCheck(node) {
1819
1818
 
1820
1819
  //#endregion
1821
1820
  //#region src/rules/no-nested-component-definitions.ts
1822
- const RULE_NAME$33 = "no-nested-component-definitions";
1823
- const RULE_FEATURES$32 = [];
1821
+ const RULE_NAME$26 = "no-nested-component-definitions";
1822
+ const RULE_FEATURES$25 = [];
1824
1823
  var no_nested_component_definitions_default = createRule({
1825
1824
  meta: {
1826
1825
  type: "problem",
1827
1826
  docs: {
1828
1827
  description: "Disallow nesting component definitions inside other components.",
1829
- [Symbol.for("rule_features")]: RULE_FEATURES$32
1828
+ [Symbol.for("rule_features")]: RULE_FEATURES$25
1830
1829
  },
1831
1830
  messages: { noNestedComponentDefinitions: "Do not nest component definitions inside other components or props. {{suggestion}}" },
1832
1831
  schema: []
1833
1832
  },
1834
- name: RULE_NAME$33,
1835
- create: create$33,
1833
+ name: RULE_NAME$26,
1834
+ create: create$26,
1836
1835
  defaultOptions: []
1837
1836
  });
1838
- function create$33(context) {
1837
+ function create$26(context) {
1839
1838
  const hint = ER.ComponentDetectionHint.SkipArrayMapArgument | ER.ComponentDetectionHint.SkipNullLiteral | ER.ComponentDetectionHint.SkipUndefined | ER.ComponentDetectionHint.SkipBooleanLiteral | ER.ComponentDetectionHint.SkipStringLiteral | ER.ComponentDetectionHint.SkipNumberLiteral | ER.ComponentDetectionHint.StrictLogical | ER.ComponentDetectionHint.StrictConditional;
1840
1839
  const collector = ER.useComponentCollector(context, { hint });
1841
1840
  const collectorLegacy = ER.useComponentCollectorLegacy();
@@ -1953,23 +1952,23 @@ function isInsideCreateElementProps(context, node) {
1953
1952
 
1954
1953
  //#endregion
1955
1954
  //#region src/rules/no-nested-lazy-component-declarations.ts
1956
- const RULE_NAME$32 = "no-nested-lazy-component-declarations";
1957
- const RULE_FEATURES$31 = [];
1955
+ const RULE_NAME$25 = "no-nested-lazy-component-declarations";
1956
+ const RULE_FEATURES$24 = [];
1958
1957
  var no_nested_lazy_component_declarations_default = createRule({
1959
1958
  meta: {
1960
1959
  type: "problem",
1961
1960
  docs: {
1962
1961
  description: "Disallow nesting lazy component declarations inside other components.",
1963
- [Symbol.for("rule_features")]: RULE_FEATURES$31
1962
+ [Symbol.for("rule_features")]: RULE_FEATURES$24
1964
1963
  },
1965
1964
  messages: { noNestedLazyComponentDeclarations: "Do not declare lazy components inside other components. Instead, always declare them at the top level of your module." },
1966
1965
  schema: []
1967
1966
  },
1968
- name: RULE_NAME$32,
1969
- create: create$32,
1967
+ name: RULE_NAME$25,
1968
+ create: create$25,
1970
1969
  defaultOptions: []
1971
1970
  });
1972
- function create$32(context) {
1971
+ function create$25(context) {
1973
1972
  const hint = ER.ComponentDetectionHint.None;
1974
1973
  const collector = ER.useComponentCollector(context, { hint });
1975
1974
  const collectorLegacy = ER.useComponentCollectorLegacy();
@@ -2003,23 +2002,23 @@ function create$32(context) {
2003
2002
 
2004
2003
  //#endregion
2005
2004
  //#region src/rules/no-prop-types.ts
2006
- const RULE_NAME$31 = "no-prop-types";
2007
- const RULE_FEATURES$30 = [];
2005
+ const RULE_NAME$24 = "no-prop-types";
2006
+ const RULE_FEATURES$23 = [];
2008
2007
  var no_prop_types_default = createRule({
2009
2008
  meta: {
2010
2009
  type: "problem",
2011
2010
  docs: {
2012
2011
  description: "Disallow `propTypes` in favor of TypeScript or another type-checking solution.",
2013
- [Symbol.for("rule_features")]: RULE_FEATURES$30
2012
+ [Symbol.for("rule_features")]: RULE_FEATURES$23
2014
2013
  },
2015
2014
  messages: { noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead." },
2016
2015
  schema: []
2017
2016
  },
2018
- name: RULE_NAME$31,
2019
- create: create$31,
2017
+ name: RULE_NAME$24,
2018
+ create: create$24,
2020
2019
  defaultOptions: []
2021
2020
  });
2022
- function create$31(context) {
2021
+ function create$24(context) {
2023
2022
  if (!context.sourceCode.text.includes("propTypes")) return {};
2024
2023
  return {
2025
2024
  AssignmentExpression(node) {
@@ -2048,8 +2047,8 @@ function create$31(context) {
2048
2047
 
2049
2048
  //#endregion
2050
2049
  //#region src/rules/no-redundant-should-component-update.ts
2051
- const RULE_NAME$30 = "no-redundant-should-component-update";
2052
- const RULE_FEATURES$29 = [];
2050
+ const RULE_NAME$23 = "no-redundant-should-component-update";
2051
+ const RULE_FEATURES$22 = [];
2053
2052
  function isShouldComponentUpdate(node) {
2054
2053
  return AST.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
2055
2054
  }
@@ -2058,16 +2057,16 @@ var no_redundant_should_component_update_default = createRule({
2058
2057
  type: "problem",
2059
2058
  docs: {
2060
2059
  description: "Disallow `shouldComponentUpdate` when extending `React.PureComponent`.",
2061
- [Symbol.for("rule_features")]: RULE_FEATURES$29
2060
+ [Symbol.for("rule_features")]: RULE_FEATURES$22
2062
2061
  },
2063
2062
  messages: { noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'." },
2064
2063
  schema: []
2065
2064
  },
2066
- name: RULE_NAME$30,
2067
- create: create$30,
2065
+ name: RULE_NAME$23,
2066
+ create: create$23,
2068
2067
  defaultOptions: []
2069
2068
  });
2070
- function create$30(context) {
2069
+ function create$23(context) {
2071
2070
  if (!context.sourceCode.text.includes("shouldComponentUpdate")) return {};
2072
2071
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
2073
2072
  return {
@@ -2089,23 +2088,23 @@ function create$30(context) {
2089
2088
 
2090
2089
  //#endregion
2091
2090
  //#region src/rules/no-set-state-in-component-did-mount.ts
2092
- const RULE_NAME$29 = "no-set-state-in-component-did-mount";
2093
- const RULE_FEATURES$28 = [];
2091
+ const RULE_NAME$22 = "no-set-state-in-component-did-mount";
2092
+ const RULE_FEATURES$21 = [];
2094
2093
  var no_set_state_in_component_did_mount_default = createRule({
2095
2094
  meta: {
2096
2095
  type: "problem",
2097
2096
  docs: {
2098
2097
  description: "Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.",
2099
- [Symbol.for("rule_features")]: RULE_FEATURES$28
2098
+ [Symbol.for("rule_features")]: RULE_FEATURES$21
2100
2099
  },
2101
2100
  messages: { noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks." },
2102
2101
  schema: []
2103
2102
  },
2104
- name: RULE_NAME$29,
2105
- create: create$29,
2103
+ name: RULE_NAME$22,
2104
+ create: create$22,
2106
2105
  defaultOptions: []
2107
2106
  });
2108
- function create$29(context) {
2107
+ function create$22(context) {
2109
2108
  if (!context.sourceCode.text.includes("componentDidMount")) return {};
2110
2109
  return { CallExpression(node) {
2111
2110
  if (!ER.isThisSetState(node)) return;
@@ -2123,23 +2122,23 @@ function create$29(context) {
2123
2122
 
2124
2123
  //#endregion
2125
2124
  //#region src/rules/no-set-state-in-component-did-update.ts
2126
- const RULE_NAME$28 = "no-set-state-in-component-did-update";
2127
- const RULE_FEATURES$27 = [];
2125
+ const RULE_NAME$21 = "no-set-state-in-component-did-update";
2126
+ const RULE_FEATURES$20 = [];
2128
2127
  var no_set_state_in_component_did_update_default = createRule({
2129
2128
  meta: {
2130
2129
  type: "problem",
2131
2130
  docs: {
2132
2131
  description: "Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.",
2133
- [Symbol.for("rule_features")]: RULE_FEATURES$27
2132
+ [Symbol.for("rule_features")]: RULE_FEATURES$20
2134
2133
  },
2135
2134
  messages: { noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks." },
2136
2135
  schema: []
2137
2136
  },
2138
- name: RULE_NAME$28,
2139
- create: create$28,
2137
+ name: RULE_NAME$21,
2138
+ create: create$21,
2140
2139
  defaultOptions: []
2141
2140
  });
2142
- function create$28(context) {
2141
+ function create$21(context) {
2143
2142
  if (!context.sourceCode.text.includes("componentDidUpdate")) return {};
2144
2143
  return { CallExpression(node) {
2145
2144
  if (!ER.isThisSetState(node)) return;
@@ -2157,23 +2156,23 @@ function create$28(context) {
2157
2156
 
2158
2157
  //#endregion
2159
2158
  //#region src/rules/no-set-state-in-component-will-update.ts
2160
- const RULE_NAME$27 = "no-set-state-in-component-will-update";
2161
- const RULE_FEATURES$26 = [];
2159
+ const RULE_NAME$20 = "no-set-state-in-component-will-update";
2160
+ const RULE_FEATURES$19 = [];
2162
2161
  var no_set_state_in_component_will_update_default = createRule({
2163
2162
  meta: {
2164
2163
  type: "problem",
2165
2164
  docs: {
2166
2165
  description: "Disallows calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.",
2167
- [Symbol.for("rule_features")]: RULE_FEATURES$26
2166
+ [Symbol.for("rule_features")]: RULE_FEATURES$19
2168
2167
  },
2169
2168
  messages: { noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks." },
2170
2169
  schema: []
2171
2170
  },
2172
- name: RULE_NAME$27,
2173
- create: create$27,
2171
+ name: RULE_NAME$20,
2172
+ create: create$20,
2174
2173
  defaultOptions: []
2175
2174
  });
2176
- function create$27(context) {
2175
+ function create$20(context) {
2177
2176
  if (!context.sourceCode.text.includes("componentWillUpdate")) return {};
2178
2177
  return { CallExpression(node) {
2179
2178
  if (!ER.isThisSetState(node)) return;
@@ -2191,24 +2190,24 @@ function create$27(context) {
2191
2190
 
2192
2191
  //#endregion
2193
2192
  //#region src/rules/no-string-refs.ts
2194
- const RULE_NAME$26 = "no-string-refs";
2195
- const RULE_FEATURES$25 = ["MOD"];
2193
+ const RULE_NAME$19 = "no-string-refs";
2194
+ const RULE_FEATURES$18 = ["MOD"];
2196
2195
  var no_string_refs_default = createRule({
2197
2196
  meta: {
2198
2197
  type: "problem",
2199
2198
  docs: {
2200
2199
  description: "Replaces string refs with callback refs.",
2201
- [Symbol.for("rule_features")]: RULE_FEATURES$25
2200
+ [Symbol.for("rule_features")]: RULE_FEATURES$18
2202
2201
  },
2203
2202
  fixable: "code",
2204
2203
  messages: { noStringRefs: "[Deprecated] Use callback refs instead." },
2205
2204
  schema: []
2206
2205
  },
2207
- name: RULE_NAME$26,
2208
- create: create$26,
2206
+ name: RULE_NAME$19,
2207
+ create: create$19,
2209
2208
  defaultOptions: []
2210
2209
  });
2211
- function create$26(context) {
2210
+ function create$19(context) {
2212
2211
  const state = { isWithinClassComponent: false };
2213
2212
  function onClassBodyEnter(node) {
2214
2213
  if (ER.isClassComponent(node.parent)) state.isWithinClassComponent = true;
@@ -2247,23 +2246,23 @@ function getAttributeValueText(context, node) {
2247
2246
 
2248
2247
  //#endregion
2249
2248
  //#region src/rules/no-unnecessary-key.ts
2250
- const RULE_NAME$25 = "no-unnecessary-key";
2251
- const RULE_FEATURES$24 = ["EXP"];
2249
+ const RULE_NAME$18 = "no-unnecessary-key";
2250
+ const RULE_FEATURES$17 = ["EXP"];
2252
2251
  var no_unnecessary_key_default = createRule({
2253
2252
  meta: {
2254
2253
  type: "problem",
2255
2254
  docs: {
2256
2255
  description: "Prevents the use of unnecessary `key` props on JSX elements when rendering lists.",
2257
- [Symbol.for("rule_features")]: RULE_FEATURES$24
2256
+ [Symbol.for("rule_features")]: RULE_FEATURES$17
2258
2257
  },
2259
2258
  messages: { noUnnecessaryKey: "Unnecessary `key` prop on this element. The `key` should be on the top-level element returned from the array." },
2260
2259
  schema: []
2261
2260
  },
2262
- name: RULE_NAME$25,
2263
- create: create$25,
2261
+ name: RULE_NAME$18,
2262
+ create: create$18,
2264
2263
  defaultOptions: []
2265
2264
  });
2266
- function create$25(context) {
2265
+ function create$18(context) {
2267
2266
  if (!context.sourceCode.getText().includes("key=")) return {};
2268
2267
  return { JSXAttribute(node) {
2269
2268
  if (node.name.name !== "key") return;
@@ -2289,32 +2288,28 @@ function isMapCallback(node) {
2289
2288
 
2290
2289
  //#endregion
2291
2290
  //#region src/rules/no-unnecessary-use-callback.ts
2292
- const RULE_NAME$24 = "no-unnecessary-use-callback";
2293
- const RULE_FEATURES$23 = ["EXP"];
2291
+ const RULE_NAME$17 = "no-unnecessary-use-callback";
2292
+ const RULE_FEATURES$16 = ["EXP"];
2294
2293
  var no_unnecessary_use_callback_default = createRule({
2295
2294
  meta: {
2296
2295
  type: "problem",
2297
2296
  docs: {
2298
2297
  description: "Disallow unnecessary usage of `useCallback`.",
2299
- [Symbol.for("rule_features")]: RULE_FEATURES$23
2298
+ [Symbol.for("rule_features")]: RULE_FEATURES$16
2300
2299
  },
2301
2300
  messages: { noUnnecessaryUseCallback: "An 'useCallback' with empty deps and no references to the component scope may be unnecessary." },
2302
2301
  schema: []
2303
2302
  },
2304
- name: RULE_NAME$24,
2305
- create: create$24,
2303
+ name: RULE_NAME$17,
2304
+ create: create$17,
2306
2305
  defaultOptions: []
2307
2306
  });
2308
- function create$24(context) {
2309
- if (!context.sourceCode.text.includes("use")) return {};
2310
- const alias = getSettingsFromContext(context).additionalHooks.useCallback ?? [];
2311
- const isUseCallbackCall = ER.isReactHookCallWithNameAlias(context, "useCallback", alias);
2307
+ function create$17(context) {
2308
+ if (!context.sourceCode.text.includes("useCallback")) return {};
2312
2309
  return { CallExpression(node) {
2313
- if (!ER.isReactHookCall(node)) return;
2310
+ if (!ER.isUseCallbackCall(node)) return;
2314
2311
  const initialScope = context.sourceCode.getScope(node);
2315
- if (!isUseCallbackCall(node)) return;
2316
- const scope = context.sourceCode.getScope(node);
2317
- const component = scope.block;
2312
+ const component = context.sourceCode.getScope(node).block;
2318
2313
  if (!AST.isFunction(component)) return;
2319
2314
  const [arg0, arg1] = node.arguments;
2320
2315
  if (arg0 == null || arg1 == null) return;
@@ -2347,30 +2342,27 @@ function create$24(context) {
2347
2342
 
2348
2343
  //#endregion
2349
2344
  //#region src/rules/no-unnecessary-use-memo.ts
2350
- const RULE_NAME$23 = "no-unnecessary-use-memo";
2351
- const RULE_FEATURES$22 = ["EXP"];
2345
+ const RULE_NAME$16 = "no-unnecessary-use-memo";
2346
+ const RULE_FEATURES$15 = ["EXP"];
2352
2347
  var no_unnecessary_use_memo_default = createRule({
2353
2348
  meta: {
2354
2349
  type: "problem",
2355
2350
  docs: {
2356
2351
  description: "Disallow unnecessary usage of `useMemo`.",
2357
- [Symbol.for("rule_features")]: RULE_FEATURES$22
2352
+ [Symbol.for("rule_features")]: RULE_FEATURES$15
2358
2353
  },
2359
2354
  messages: { noUnnecessaryUseMemo: "An 'useMemo' with empty deps and no references to the component scope may be unnecessary." },
2360
2355
  schema: []
2361
2356
  },
2362
- name: RULE_NAME$23,
2363
- create: create$23,
2357
+ name: RULE_NAME$16,
2358
+ create: create$16,
2364
2359
  defaultOptions: []
2365
2360
  });
2366
- function create$23(context) {
2367
- if (!context.sourceCode.text.includes("use")) return {};
2368
- const alias = getSettingsFromContext(context).additionalHooks.useMemo ?? [];
2369
- const isUseMemoCall = ER.isReactHookCallWithNameAlias(context, "useMemo", alias);
2361
+ function create$16(context) {
2362
+ if (!context.sourceCode.text.includes("useMemo")) return {};
2370
2363
  return { CallExpression(node) {
2371
- if (!ER.isReactHookCall(node)) return;
2372
2364
  const initialScope = context.sourceCode.getScope(node);
2373
- if (!isUseMemoCall(node)) return;
2365
+ if (!ER.isUseMemoCall(node)) return;
2374
2366
  const scope = context.sourceCode.getScope(node);
2375
2367
  const component = scope.block;
2376
2368
  if (!AST.isFunction(component)) return;
@@ -2407,8 +2399,8 @@ function create$23(context) {
2407
2399
 
2408
2400
  //#endregion
2409
2401
  //#region src/rules/no-unnecessary-use-prefix.ts
2410
- const RULE_NAME$22 = "no-unnecessary-use-prefix";
2411
- const RULE_FEATURES$21 = [];
2402
+ const RULE_NAME$15 = "no-unnecessary-use-prefix";
2403
+ const RULE_FEATURES$14 = [];
2412
2404
  const WELL_KNOWN_HOOKS = ["useMDXComponents"];
2413
2405
  function containsUseComments(context, node) {
2414
2406
  return context.sourceCode.getCommentsInside(node).some(({ value }) => /use\([\s\S]*?\)/u.test(value) || /use[A-Z0-9]\w*\([\s\S]*?\)/u.test(value));
@@ -2418,16 +2410,16 @@ var no_unnecessary_use_prefix_default = createRule({
2418
2410
  type: "problem",
2419
2411
  docs: {
2420
2412
  description: "Enforces that a function with the `use` prefix should use at least one Hook inside of it.",
2421
- [Symbol.for("rule_features")]: RULE_FEATURES$21
2413
+ [Symbol.for("rule_features")]: RULE_FEATURES$14
2422
2414
  },
2423
2415
  messages: { noUnnecessaryUsePrefix: "If your function doesn't call any Hooks, avoid the 'use' prefix. Instead, write it as a regular function without the 'use' prefix." },
2424
2416
  schema: []
2425
2417
  },
2426
- name: RULE_NAME$22,
2427
- create: create$22,
2418
+ name: RULE_NAME$15,
2419
+ create: create$15,
2428
2420
  defaultOptions: []
2429
2421
  });
2430
- function create$22(context) {
2422
+ function create$15(context) {
2431
2423
  const { ctx, listeners } = ER.useHookCollector();
2432
2424
  return {
2433
2425
  ...listeners,
@@ -2451,23 +2443,23 @@ function create$22(context) {
2451
2443
 
2452
2444
  //#endregion
2453
2445
  //#region src/rules/no-unsafe-component-will-mount.ts
2454
- const RULE_NAME$21 = "no-unsafe-component-will-mount";
2455
- const RULE_FEATURES$20 = [];
2446
+ const RULE_NAME$14 = "no-unsafe-component-will-mount";
2447
+ const RULE_FEATURES$13 = [];
2456
2448
  var no_unsafe_component_will_mount_default = createRule({
2457
2449
  meta: {
2458
2450
  type: "problem",
2459
2451
  docs: {
2460
2452
  description: "Warns the usage of `UNSAFE_componentWillMount` in class components.",
2461
- [Symbol.for("rule_features")]: RULE_FEATURES$20
2453
+ [Symbol.for("rule_features")]: RULE_FEATURES$13
2462
2454
  },
2463
2455
  messages: { noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'." },
2464
2456
  schema: []
2465
2457
  },
2466
- name: RULE_NAME$21,
2467
- create: create$21,
2458
+ name: RULE_NAME$14,
2459
+ create: create$14,
2468
2460
  defaultOptions: []
2469
2461
  });
2470
- function create$21(context) {
2462
+ function create$14(context) {
2471
2463
  if (!context.sourceCode.text.includes("UNSAFE_componentWillMount")) return {};
2472
2464
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
2473
2465
  return {
@@ -2487,23 +2479,23 @@ function create$21(context) {
2487
2479
 
2488
2480
  //#endregion
2489
2481
  //#region src/rules/no-unsafe-component-will-receive-props.ts
2490
- const RULE_NAME$20 = "no-unsafe-component-will-receive-props";
2491
- const RULE_FEATURES$19 = [];
2482
+ const RULE_NAME$13 = "no-unsafe-component-will-receive-props";
2483
+ const RULE_FEATURES$12 = [];
2492
2484
  var no_unsafe_component_will_receive_props_default = createRule({
2493
2485
  meta: {
2494
2486
  type: "problem",
2495
2487
  docs: {
2496
2488
  description: "Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.",
2497
- [Symbol.for("rule_features")]: RULE_FEATURES$19
2489
+ [Symbol.for("rule_features")]: RULE_FEATURES$12
2498
2490
  },
2499
2491
  messages: { noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'." },
2500
2492
  schema: []
2501
2493
  },
2502
- name: RULE_NAME$20,
2503
- create: create$20,
2494
+ name: RULE_NAME$13,
2495
+ create: create$13,
2504
2496
  defaultOptions: []
2505
2497
  });
2506
- function create$20(context) {
2498
+ function create$13(context) {
2507
2499
  if (!context.sourceCode.text.includes("UNSAFE_componentWillReceiveProps")) return {};
2508
2500
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
2509
2501
  return {
@@ -2523,23 +2515,23 @@ function create$20(context) {
2523
2515
 
2524
2516
  //#endregion
2525
2517
  //#region src/rules/no-unsafe-component-will-update.ts
2526
- const RULE_NAME$19 = "no-unsafe-component-will-update";
2527
- const RULE_FEATURES$18 = [];
2518
+ const RULE_NAME$12 = "no-unsafe-component-will-update";
2519
+ const RULE_FEATURES$11 = [];
2528
2520
  var no_unsafe_component_will_update_default = createRule({
2529
2521
  meta: {
2530
2522
  type: "problem",
2531
2523
  docs: {
2532
2524
  description: "Warns the usage of `UNSAFE_componentWillUpdate` in class components.",
2533
- [Symbol.for("rule_features")]: RULE_FEATURES$18
2525
+ [Symbol.for("rule_features")]: RULE_FEATURES$11
2534
2526
  },
2535
2527
  messages: { noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'." },
2536
2528
  schema: []
2537
2529
  },
2538
- name: RULE_NAME$19,
2539
- create: create$19,
2530
+ name: RULE_NAME$12,
2531
+ create: create$12,
2540
2532
  defaultOptions: []
2541
2533
  });
2542
- function create$19(context) {
2534
+ function create$12(context) {
2543
2535
  if (!context.sourceCode.text.includes("UNSAFE_componentWillUpdate")) return {};
2544
2536
  const { ctx, listeners } = ER.useComponentCollectorLegacy();
2545
2537
  return {
@@ -2559,23 +2551,23 @@ function create$19(context) {
2559
2551
 
2560
2552
  //#endregion
2561
2553
  //#region src/rules/no-unstable-context-value.ts
2562
- const RULE_NAME$18 = "no-unstable-context-value";
2563
- const RULE_FEATURES$17 = [];
2554
+ const RULE_NAME$11 = "no-unstable-context-value";
2555
+ const RULE_FEATURES$10 = [];
2564
2556
  var no_unstable_context_value_default = createRule({
2565
2557
  meta: {
2566
2558
  type: "problem",
2567
2559
  docs: {
2568
2560
  description: "Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.",
2569
- [Symbol.for("rule_features")]: RULE_FEATURES$17
2561
+ [Symbol.for("rule_features")]: RULE_FEATURES$10
2570
2562
  },
2571
2563
  messages: { unstableContextValue: "A/an '{{type}}' passed as the value prop to the context provider should not be constructed. It will change on every render. {{suggestion}}" },
2572
2564
  schema: []
2573
2565
  },
2574
- name: RULE_NAME$18,
2575
- create: create$18,
2566
+ name: RULE_NAME$11,
2567
+ create: create$11,
2576
2568
  defaultOptions: []
2577
2569
  });
2578
- function create$18(context) {
2570
+ function create$11(context) {
2579
2571
  const { version: version$1 } = getSettingsFromContext(context);
2580
2572
  const isReact18OrBelow = compare(version$1, "19.0.0", "<");
2581
2573
  const { ctx, listeners } = ER.useComponentCollector(context);
@@ -2625,23 +2617,23 @@ function isContextName(name$4, isReact18OrBelow) {
2625
2617
 
2626
2618
  //#endregion
2627
2619
  //#region src/rules/no-unstable-default-props.ts
2628
- const RULE_NAME$17 = "no-unstable-default-props";
2629
- const RULE_FEATURES$16 = [];
2620
+ const RULE_NAME$10 = "no-unstable-default-props";
2621
+ const RULE_FEATURES$9 = [];
2630
2622
  var no_unstable_default_props_default = createRule({
2631
2623
  meta: {
2632
2624
  type: "problem",
2633
2625
  docs: {
2634
2626
  description: "Prevents using referential-type values as default props in object destructuring.",
2635
- [Symbol.for("rule_features")]: RULE_FEATURES$16
2627
+ [Symbol.for("rule_features")]: RULE_FEATURES$9
2636
2628
  },
2637
2629
  messages: { noUnstableDefaultProps: "A/an '{{forbiddenType}}' as default prop. This could lead to potential infinite render loop in React. Use a variable instead of '{{forbiddenType}}'." },
2638
2630
  schema: []
2639
2631
  },
2640
- name: RULE_NAME$17,
2641
- create: create$17,
2632
+ name: RULE_NAME$10,
2633
+ create: create$10,
2642
2634
  defaultOptions: []
2643
2635
  });
2644
- function create$17(context) {
2636
+ function create$10(context) {
2645
2637
  const { ctx, listeners } = ER.useComponentCollector(context);
2646
2638
  const declarators = /* @__PURE__ */ new WeakMap();
2647
2639
  return {
@@ -2682,8 +2674,8 @@ function create$17(context) {
2682
2674
 
2683
2675
  //#endregion
2684
2676
  //#region src/rules/no-unused-class-component-members.ts
2685
- const RULE_NAME$16 = "no-unused-class-component-members";
2686
- const RULE_FEATURES$15 = [];
2677
+ const RULE_NAME$9 = "no-unused-class-component-members";
2678
+ const RULE_FEATURES$8 = [];
2687
2679
  const LIFECYCLE_METHODS = new Set([
2688
2680
  "componentDidCatch",
2689
2681
  "componentDidMount",
@@ -2712,16 +2704,16 @@ var no_unused_class_component_members_default = createRule({
2712
2704
  type: "problem",
2713
2705
  docs: {
2714
2706
  description: "Warns unused class component methods and properties.",
2715
- [Symbol.for("rule_features")]: RULE_FEATURES$15
2707
+ [Symbol.for("rule_features")]: RULE_FEATURES$8
2716
2708
  },
2717
2709
  messages: { noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'." },
2718
2710
  schema: []
2719
2711
  },
2720
- name: RULE_NAME$16,
2721
- create: create$16,
2712
+ name: RULE_NAME$9,
2713
+ create: create$9,
2722
2714
  defaultOptions: []
2723
2715
  });
2724
- function create$16(context) {
2716
+ function create$9(context) {
2725
2717
  const classEntries = [];
2726
2718
  const methodEntries = [];
2727
2719
  const propertyDefs = /* @__PURE__ */ new WeakMap();
@@ -2802,23 +2794,23 @@ function create$16(context) {
2802
2794
 
2803
2795
  //#endregion
2804
2796
  //#region src/rules/no-unused-props.ts
2805
- const RULE_NAME$15 = "no-unused-props";
2806
- const RULE_FEATURES$14 = ["TSC", "EXP"];
2797
+ const RULE_NAME$8 = "no-unused-props";
2798
+ const RULE_FEATURES$7 = ["TSC", "EXP"];
2807
2799
  var no_unused_props_default = createRule({
2808
2800
  meta: {
2809
2801
  type: "problem",
2810
2802
  docs: {
2811
2803
  description: "Warns about unused component prop declarations.",
2812
- [Symbol.for("rule_features")]: RULE_FEATURES$14
2804
+ [Symbol.for("rule_features")]: RULE_FEATURES$7
2813
2805
  },
2814
2806
  messages: { noUnusedProps: "Prop `{{name}}` is declared but never used" },
2815
2807
  schema: []
2816
2808
  },
2817
- name: RULE_NAME$15,
2818
- create: create$15,
2809
+ name: RULE_NAME$8,
2810
+ create: create$8,
2819
2811
  defaultOptions: []
2820
2812
  });
2821
- function create$15(context) {
2813
+ function create$8(context) {
2822
2814
  const services = ESLintUtils.getParserServices(context, false);
2823
2815
  const { ctx, listeners } = ER.useComponentCollector(context);
2824
2816
  return {
@@ -2922,8 +2914,8 @@ function reportUnusedProp(context, services, prop) {
2922
2914
 
2923
2915
  //#endregion
2924
2916
  //#region src/rules/no-unused-state.ts
2925
- const RULE_NAME$14 = "no-unused-state";
2926
- const RULE_FEATURES$13 = [];
2917
+ const RULE_NAME$7 = "no-unused-state";
2918
+ const RULE_FEATURES$6 = [];
2927
2919
  function isKeyLiteral(node, key) {
2928
2920
  return match(key).with({ type: AST_NODE_TYPES.Literal }, constTrue).with({
2929
2921
  type: AST_NODE_TYPES.TemplateLiteral,
@@ -2935,16 +2927,16 @@ var no_unused_state_default = createRule({
2935
2927
  type: "problem",
2936
2928
  docs: {
2937
2929
  description: "Warns unused class component state.",
2938
- [Symbol.for("rule_features")]: RULE_FEATURES$13
2930
+ [Symbol.for("rule_features")]: RULE_FEATURES$6
2939
2931
  },
2940
2932
  messages: { noUnusedState: "Unused class component state in '{{className}}'" },
2941
2933
  schema: []
2942
2934
  },
2943
- name: RULE_NAME$14,
2944
- create: create$14,
2935
+ name: RULE_NAME$7,
2936
+ create: create$7,
2945
2937
  defaultOptions: []
2946
2938
  });
2947
- function create$14(context) {
2939
+ function create$7(context) {
2948
2940
  const classEntries = [];
2949
2941
  const methodEntries = [];
2950
2942
  const constructorEntries = [];
@@ -3054,28 +3046,27 @@ function create$14(context) {
3054
3046
 
3055
3047
  //#endregion
3056
3048
  //#region src/rules/no-use-context.ts
3057
- const RULE_NAME$13 = "no-use-context";
3058
- const RULE_FEATURES$12 = ["MOD"];
3049
+ const RULE_NAME$6 = "no-use-context";
3050
+ const RULE_FEATURES$5 = ["MOD"];
3059
3051
  var no_use_context_default = createRule({
3060
3052
  meta: {
3061
3053
  type: "problem",
3062
3054
  docs: {
3063
3055
  description: "Replaces usages of `useContext` with `use`.",
3064
- [Symbol.for("rule_features")]: RULE_FEATURES$12
3056
+ [Symbol.for("rule_features")]: RULE_FEATURES$5
3065
3057
  },
3066
3058
  fixable: "code",
3067
3059
  messages: { noUseContext: "In React 19, 'use' is preferred over 'useContext' because it is more flexible." },
3068
3060
  schema: []
3069
3061
  },
3070
- name: RULE_NAME$13,
3071
- create: create$13,
3062
+ name: RULE_NAME$6,
3063
+ create: create$6,
3072
3064
  defaultOptions: []
3073
3065
  });
3074
- function create$13(context) {
3066
+ function create$6(context) {
3075
3067
  if (!context.sourceCode.text.includes("useContext")) return {};
3076
3068
  const settings$3 = getSettingsFromContext(context);
3077
3069
  if (compare(settings$3.version, "19.0.0", "<")) return {};
3078
- const useContextNames = /* @__PURE__ */ new Set();
3079
3070
  const hookCalls = /* @__PURE__ */ new Set();
3080
3071
  return {
3081
3072
  CallExpression(node) {
@@ -3091,30 +3082,26 @@ function create$13(context) {
3091
3082
  for (const specifier of node.specifiers) {
3092
3083
  if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) continue;
3093
3084
  if (specifier.imported.type !== AST_NODE_TYPES.Identifier) continue;
3094
- if (specifier.imported.name === "useContext") {
3095
- if (specifier.local.name !== "useContext") useContextNames.add(specifier.local.name);
3096
- context.report({
3097
- messageId: "noUseContext",
3098
- node: specifier,
3099
- fix(fixer) {
3100
- if (isUseImported) {
3101
- const tokenBefore = context.sourceCode.getTokenBefore(specifier);
3102
- return [
3103
- fixer.remove(specifier),
3104
- ...tokenBefore?.value === "," ? [fixer.replaceTextRange([tokenBefore.range[1], specifier.range[0]], "")] : [],
3105
- ...getCorrelativeTokens(context, specifier).map((token) => fixer.remove(token))
3106
- ];
3107
- }
3108
- return fixer.replaceText(specifier.imported, "use");
3085
+ if (specifier.imported.name === "useContext") context.report({
3086
+ messageId: "noUseContext",
3087
+ node: specifier,
3088
+ fix(fixer) {
3089
+ if (isUseImported) {
3090
+ const tokenBefore = context.sourceCode.getTokenBefore(specifier);
3091
+ return [
3092
+ fixer.remove(specifier),
3093
+ ...tokenBefore?.value === "," ? [fixer.replaceTextRange([tokenBefore.range[1], specifier.range[0]], "")] : [],
3094
+ ...getCorrelativeTokens(context, specifier).map((token) => fixer.remove(token))
3095
+ ];
3109
3096
  }
3110
- });
3111
- }
3097
+ return fixer.replaceText(specifier.imported, "use");
3098
+ }
3099
+ });
3112
3100
  }
3113
3101
  },
3114
3102
  "Program:exit"() {
3115
- const isUseContextCall = ER.isReactHookCallWithNameAlias(context, "useContext", [...useContextNames]);
3116
3103
  for (const node of hookCalls) {
3117
- if (!isUseContextCall(node)) continue;
3104
+ if (!ER.isUseContextCall(node)) continue;
3118
3105
  context.report({
3119
3106
  messageId: "noUseContext",
3120
3107
  node: node.callee,
@@ -3141,23 +3128,23 @@ function getCorrelativeTokens(context, node) {
3141
3128
 
3142
3129
  //#endregion
3143
3130
  //#region src/rules/no-useless-forward-ref.ts
3144
- const RULE_NAME$12 = "no-useless-forward-ref";
3145
- const RULE_FEATURES$11 = [];
3131
+ const RULE_NAME$5 = "no-useless-forward-ref";
3132
+ const RULE_FEATURES$4 = [];
3146
3133
  var no_useless_forward_ref_default = createRule({
3147
3134
  meta: {
3148
3135
  type: "problem",
3149
3136
  docs: {
3150
3137
  description: "Disallow useless `forwardRef` calls on components that don't use `ref`s.",
3151
- [Symbol.for("rule_features")]: RULE_FEATURES$11
3138
+ [Symbol.for("rule_features")]: RULE_FEATURES$4
3152
3139
  },
3153
3140
  messages: { noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set." },
3154
3141
  schema: []
3155
3142
  },
3156
- name: RULE_NAME$12,
3157
- create: create$12,
3143
+ name: RULE_NAME$5,
3144
+ create: create$5,
3158
3145
  defaultOptions: []
3159
3146
  });
3160
- function create$12(context) {
3147
+ function create$5(context) {
3161
3148
  return { CallExpression(node) {
3162
3149
  if (!ER.isForwardRefCall(context, node)) return;
3163
3150
  const [component] = node.arguments;
@@ -3173,7 +3160,7 @@ function create$12(context) {
3173
3160
 
3174
3161
  //#endregion
3175
3162
  //#region src/rules/no-useless-fragment.ts
3176
- const RULE_NAME$11 = "no-useless-fragment";
3163
+ const RULE_NAME$4 = "no-useless-fragment";
3177
3164
  const defaultOptions = [{ allowExpressions: true }];
3178
3165
  var no_useless_fragment_default = createRule({
3179
3166
  meta: {
@@ -3191,11 +3178,11 @@ var no_useless_fragment_default = createRule({
3191
3178
  } }
3192
3179
  }]
3193
3180
  },
3194
- name: RULE_NAME$11,
3195
- create: create$11,
3181
+ name: RULE_NAME$4,
3182
+ create: create$4,
3196
3183
  defaultOptions
3197
3184
  });
3198
- function create$11(context, [option]) {
3185
+ function create$4(context, [option]) {
3199
3186
  const { allowExpressions = true } = option;
3200
3187
  return {
3201
3188
  JSXElement(node) {
@@ -3302,8 +3289,8 @@ function canFix(context, node) {
3302
3289
 
3303
3290
  //#endregion
3304
3291
  //#region src/rules/prefer-destructuring-assignment.ts
3305
- const RULE_NAME$10 = "prefer-destructuring-assignment";
3306
- const RULE_FEATURES$10 = [];
3292
+ const RULE_NAME$3 = "prefer-destructuring-assignment";
3293
+ const RULE_FEATURES$3 = [];
3307
3294
  function isMemberExpressionWithObjectName(node) {
3308
3295
  return node.object.type === AST_NODE_TYPES.Identifier && "name" in node.object;
3309
3296
  }
@@ -3312,16 +3299,16 @@ var prefer_destructuring_assignment_default = createRule({
3312
3299
  type: "problem",
3313
3300
  docs: {
3314
3301
  description: "Enforces destructuring assignment for component props and context.",
3315
- [Symbol.for("rule_features")]: RULE_FEATURES$10
3302
+ [Symbol.for("rule_features")]: RULE_FEATURES$3
3316
3303
  },
3317
3304
  messages: { preferDestructuringAssignment: "Use destructuring assignment for {{name}}." },
3318
3305
  schema: []
3319
3306
  },
3320
- name: RULE_NAME$10,
3321
- create: create$10,
3307
+ name: RULE_NAME$3,
3308
+ create: create$3,
3322
3309
  defaultOptions: []
3323
3310
  });
3324
- function create$10(context) {
3311
+ function create$3(context) {
3325
3312
  const { ctx, listeners } = ER.useComponentCollector(context);
3326
3313
  const memberExpressionWithNames = [];
3327
3314
  return {
@@ -3368,24 +3355,24 @@ function create$10(context) {
3368
3355
 
3369
3356
  //#endregion
3370
3357
  //#region src/rules/prefer-namespace-import.ts
3371
- const RULE_NAME$9 = "prefer-namespace-import";
3372
- const RULE_FEATURES$9 = ["FIX"];
3358
+ const RULE_NAME$2 = "prefer-namespace-import";
3359
+ const RULE_FEATURES$2 = ["FIX"];
3373
3360
  var prefer_namespace_import_default = createRule({
3374
3361
  meta: {
3375
3362
  type: "problem",
3376
3363
  docs: {
3377
3364
  description: "Enforces React is imported via a namespace import.",
3378
- [Symbol.for("rule_features")]: RULE_FEATURES$9
3365
+ [Symbol.for("rule_features")]: RULE_FEATURES$2
3379
3366
  },
3380
3367
  fixable: "code",
3381
3368
  messages: { preferNamespaceImport: "Prefer importing React as 'import * as React from \"{{importSource}}\"';" },
3382
3369
  schema: []
3383
3370
  },
3384
- name: RULE_NAME$9,
3385
- create: create$9,
3371
+ name: RULE_NAME$2,
3372
+ create: create$2,
3386
3373
  defaultOptions: []
3387
3374
  });
3388
- function create$9(context) {
3375
+ function create$2(context) {
3389
3376
  const { importSource } = getSettingsFromContext(context);
3390
3377
  return { [`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
3391
3378
  const hasOtherSpecifiers = node.parent.specifiers.length > 1;
@@ -3410,23 +3397,23 @@ function create$9(context) {
3410
3397
 
3411
3398
  //#endregion
3412
3399
  //#region src/rules/prefer-read-only-props.ts
3413
- const RULE_NAME$8 = "prefer-read-only-props";
3414
- const RULE_FEATURES$8 = ["TSC", "EXP"];
3400
+ const RULE_NAME$1 = "prefer-read-only-props";
3401
+ const RULE_FEATURES$1 = ["TSC", "EXP"];
3415
3402
  var prefer_read_only_props_default = createRule({
3416
3403
  meta: {
3417
3404
  type: "problem",
3418
3405
  docs: {
3419
3406
  description: "Enforces read-only props in components.",
3420
- [Symbol.for("rule_features")]: RULE_FEATURES$8
3407
+ [Symbol.for("rule_features")]: RULE_FEATURES$1
3421
3408
  },
3422
3409
  messages: { preferReadOnlyProps: "A function component's props should be read-only." },
3423
3410
  schema: []
3424
3411
  },
3425
- name: RULE_NAME$8,
3426
- create: create$8,
3412
+ name: RULE_NAME$1,
3413
+ create: create$1,
3427
3414
  defaultOptions: []
3428
3415
  });
3429
- function create$8(context) {
3416
+ function create$1(context) {
3430
3417
  const services = ESLintUtils.getParserServices(context, false);
3431
3418
  const { ctx, listeners } = ER.useComponentCollector(context);
3432
3419
  return {
@@ -3460,8 +3447,8 @@ function isTypeReadonlyLoose(services, type) {
3460
3447
 
3461
3448
  //#endregion
3462
3449
  //#region src/rules/prefer-use-state-lazy-initialization.ts
3463
- const RULE_NAME$7 = "prefer-use-state-lazy-initialization";
3464
- const RULE_FEATURES$7 = ["EXP"];
3450
+ const RULE_NAME = "prefer-use-state-lazy-initialization";
3451
+ const RULE_FEATURES = ["EXP"];
3465
3452
  const ALLOW_LIST = [
3466
3453
  "Boolean",
3467
3454
  "String",
@@ -3472,27 +3459,24 @@ var prefer_use_state_lazy_initialization_default = createRule({
3472
3459
  type: "problem",
3473
3460
  docs: {
3474
3461
  description: "Enforces function calls made inside `useState` to be wrapped in an `initializer function`.",
3475
- [Symbol.for("rule_features")]: RULE_FEATURES$7
3462
+ [Symbol.for("rule_features")]: RULE_FEATURES
3476
3463
  },
3477
3464
  messages: { preferUseStateLazyInitialization: "To prevent re-computation, consider using lazy initial state for useState calls that involve function calls. Ex: 'useState(() => getValue())'." },
3478
3465
  schema: []
3479
3466
  },
3480
- name: RULE_NAME$7,
3481
- create: create$7,
3467
+ name: RULE_NAME,
3468
+ create,
3482
3469
  defaultOptions: []
3483
3470
  });
3484
- function create$7(context) {
3485
- const alias = getSettingsFromContext(context).additionalHooks.useState ?? [];
3486
- const isUseStateCall = ER.isReactHookCallWithNameAlias(context, "useState", alias);
3471
+ function create(context) {
3487
3472
  return { CallExpression(node) {
3488
- if (!ER.isReactHookCall(node)) return;
3489
- if (!isUseStateCall(node)) return;
3473
+ if (!ER.isUseStateCall(node)) return;
3490
3474
  const [useStateInput] = node.arguments;
3491
3475
  if (useStateInput == null) return;
3492
3476
  for (const expr of AST.getNestedNewExpressions(useStateInput)) {
3493
3477
  if (!("name" in expr.callee)) continue;
3494
3478
  if (ALLOW_LIST.includes(expr.callee.name)) continue;
3495
- if (AST.findParentNode(expr, (n) => ER.isUseCall(context, n)) != null) continue;
3479
+ if (AST.findParentNode(expr, ER.isUseCall) != null) continue;
3496
3480
  context.report({
3497
3481
  messageId: "preferUseStateLazyInitialization",
3498
3482
  node: expr
@@ -3502,7 +3486,7 @@ function create$7(context) {
3502
3486
  if (!("name" in expr.callee)) continue;
3503
3487
  if (ER.isReactHookName(expr.callee.name)) continue;
3504
3488
  if (ALLOW_LIST.includes(expr.callee.name)) continue;
3505
- if (AST.findParentNode(expr, (n) => ER.isUseCall(context, n)) != null) continue;
3489
+ if (AST.findParentNode(expr, ER.isUseCall) != null) continue;
3506
3490
  context.report({
3507
3491
  messageId: "preferUseStateLazyInitialization",
3508
3492
  node: expr
@@ -3511,272 +3495,6 @@ function create$7(context) {
3511
3495
  } };
3512
3496
  }
3513
3497
 
3514
- //#endregion
3515
- //#region src/rules-removed/avoid-shorthand-boolean.ts
3516
- const RULE_NAME$6 = "avoid-shorthand-boolean";
3517
- const RULE_FEATURES$6 = [];
3518
- var avoid_shorthand_boolean_default = createRule({
3519
- meta: {
3520
- type: "problem",
3521
- deprecated: true,
3522
- docs: {
3523
- description: "Enforces explicit boolean values for boolean attributes.",
3524
- [Symbol.for("rule_features")]: RULE_FEATURES$6
3525
- },
3526
- fixable: "code",
3527
- messages: { avoidShorthandBoolean: "Avoid using shorthand boolean attribute '{{propName}}'. Use '{{propName}}={true}' instead." },
3528
- replacedBy: ["react-x/jsx-shorthand-boolean"],
3529
- schema: []
3530
- },
3531
- name: RULE_NAME$6,
3532
- create: create$6,
3533
- defaultOptions: []
3534
- });
3535
- function create$6(context) {
3536
- return { JSXAttribute(node) {
3537
- if (node.value == null) context.report({
3538
- messageId: "avoidShorthandBoolean",
3539
- node,
3540
- data: { propName: ER.getAttributeName(context, node) },
3541
- fix: (fixer) => fixer.insertTextAfter(node.name, `={true}`)
3542
- });
3543
- } };
3544
- }
3545
-
3546
- //#endregion
3547
- //#region src/rules-removed/avoid-shorthand-fragment.ts
3548
- const RULE_NAME$5 = "avoid-shorthand-fragment";
3549
- const RULE_FEATURES$5 = [];
3550
- var avoid_shorthand_fragment_default = createRule({
3551
- meta: {
3552
- type: "problem",
3553
- deprecated: true,
3554
- docs: {
3555
- description: "Enforces explicit `<Fragment>` components instead of the shorthand `<>` or `</>` syntax.",
3556
- [Symbol.for("rule_features")]: RULE_FEATURES$5
3557
- },
3558
- messages: { avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use '{{jsxFragmentFactory}}' component instead." },
3559
- replacedBy: ["react-x/jsx-shorthand-fragment"],
3560
- schema: []
3561
- },
3562
- name: RULE_NAME$5,
3563
- create: create$5,
3564
- defaultOptions: []
3565
- });
3566
- function create$5(context) {
3567
- const jsxConfigFromContext = JsxConfig.getFromContext(context);
3568
- const jsxConfigFromAnnotation = JsxConfig.getFromAnnotation(context);
3569
- const jsxConfig = {
3570
- ...jsxConfigFromContext,
3571
- ...jsxConfigFromAnnotation
3572
- };
3573
- return { JSXFragment(node) {
3574
- context.report({
3575
- messageId: "avoidShorthandFragment",
3576
- node,
3577
- data: { jsxFragmentFactory: jsxConfig.jsxFragmentFactory }
3578
- });
3579
- } };
3580
- }
3581
-
3582
- //#endregion
3583
- //#region src/rules-removed/no-comment-textnodes.ts
3584
- const RULE_NAME$4 = "no-comment-textnodes";
3585
- const RULE_FEATURES$4 = [];
3586
- var no_comment_textnodes_default = createRule({
3587
- meta: {
3588
- type: "problem",
3589
- deprecated: true,
3590
- docs: {
3591
- description: "Prevents comments from being inserted as text nodes.",
3592
- [Symbol.for("rule_features")]: RULE_FEATURES$4
3593
- },
3594
- messages: { noCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
3595
- replacedBy: ["react-x/jsx-no-comment-textnodes"],
3596
- schema: []
3597
- },
3598
- name: RULE_NAME$4,
3599
- create: create$4,
3600
- defaultOptions: []
3601
- });
3602
- function create$4(context) {
3603
- function hasCommentLike(node) {
3604
- if (AST.isOneOf([AST_NODE_TYPES.JSXAttribute, AST_NODE_TYPES.JSXExpressionContainer])(node.parent)) return false;
3605
- const rawValue = context.sourceCode.getText(node);
3606
- return /^\s*\/(?:\/|\*)/mu.test(rawValue);
3607
- }
3608
- const visitorFunction = (node) => {
3609
- if (!AST.isOneOf([AST_NODE_TYPES.JSXElement, AST_NODE_TYPES.JSXFragment])(node.parent)) return;
3610
- if (!hasCommentLike(node)) return;
3611
- if (!node.parent.type.includes("JSX")) return;
3612
- context.report({
3613
- messageId: "noCommentTextnodes",
3614
- node
3615
- });
3616
- };
3617
- return {
3618
- JSXText: visitorFunction,
3619
- Literal: visitorFunction
3620
- };
3621
- }
3622
-
3623
- //#endregion
3624
- //#region src/rules-removed/no-complex-conditional-rendering.ts
3625
- const RULE_NAME$3 = "no-complex-conditional-rendering";
3626
- const RULE_FEATURES$3 = ["EXP"];
3627
- var no_complex_conditional_rendering_default = createRule({
3628
- meta: {
3629
- type: "problem",
3630
- deprecated: true,
3631
- docs: {
3632
- description: "Disallow complex conditional rendering in JSX expressions.",
3633
- [Symbol.for("rule_features")]: RULE_FEATURES$3
3634
- },
3635
- messages: { noComplexConditionalRendering: "Avoid complex conditional rendering. Extract the logic into separate elements or components." },
3636
- schema: []
3637
- },
3638
- name: RULE_NAME$3,
3639
- create: create$3,
3640
- defaultOptions: []
3641
- });
3642
- function create$3(context) {
3643
- const visitorFunction = (node) => {
3644
- const jsxExpContainer = node.parent?.parent;
3645
- if (!AST.is(AST_NODE_TYPES.JSXExpressionContainer)(jsxExpContainer)) return;
3646
- if (!AST.isOneOf([AST_NODE_TYPES.JSXElement, AST_NODE_TYPES.JSXFragment])(jsxExpContainer.parent)) return;
3647
- if (!jsxExpContainer.parent.children.includes(jsxExpContainer)) return;
3648
- context.report({
3649
- messageId: "noComplexConditionalRendering",
3650
- node: jsxExpContainer
3651
- });
3652
- };
3653
- return {
3654
- "JSXExpressionContainer > ConditionalExpression > ConditionalExpression": visitorFunction,
3655
- "JSXExpressionContainer > ConditionalExpression > LogicalExpression": visitorFunction,
3656
- "JSXExpressionContainer > LogicalExpression > ConditionalExpression": visitorFunction,
3657
- "JSXExpressionContainer > LogicalExpression[operator='&&'] > LogicalExpression[operator='||']": visitorFunction,
3658
- "JSXExpressionContainer > LogicalExpression[operator='||'] > LogicalExpression[operator='&&']": visitorFunction
3659
- };
3660
- }
3661
-
3662
- //#endregion
3663
- //#region src/rules-removed/prefer-react-namespace-import.ts
3664
- const RULE_NAME$2 = "prefer-react-namespace-import";
3665
- const RULE_FEATURES$2 = ["FIX"];
3666
- var prefer_react_namespace_import_default = createRule({
3667
- meta: {
3668
- type: "problem",
3669
- deprecated: true,
3670
- docs: {
3671
- description: "Enforces React is imported via a namespace import.",
3672
- [Symbol.for("rule_features")]: RULE_FEATURES$2
3673
- },
3674
- fixable: "code",
3675
- messages: { preferReactNamespaceImport: "Prefer importing React as 'import * as React from \"{{importSource}}\"';" },
3676
- replacedBy: ["react-x/prefer-namespace-import"],
3677
- schema: []
3678
- },
3679
- name: RULE_NAME$2,
3680
- create: create$2,
3681
- defaultOptions: []
3682
- });
3683
- function create$2(context) {
3684
- const { importSource } = getSettingsFromContext(context);
3685
- return { [`ImportDeclaration[source.value="${importSource}"] ImportDefaultSpecifier`](node) {
3686
- const hasOtherSpecifiers = node.parent.specifiers.length > 1;
3687
- context.report({
3688
- messageId: "preferReactNamespaceImport",
3689
- node: hasOtherSpecifiers ? node : node.parent,
3690
- data: { importSource },
3691
- fix(fixer) {
3692
- const importDeclarationText = context.sourceCode.getText(node.parent);
3693
- const semi = importDeclarationText.endsWith(";") ? ";" : "";
3694
- const quote = node.parent.source.raw.at(0) ?? "'";
3695
- const isTypeImport = node.parent.importKind === "type";
3696
- const importStringPrefix = `import${isTypeImport ? " type" : ""}`;
3697
- const importSourceQuoted = `${quote}${importSource}${quote}`;
3698
- if (!hasOtherSpecifiers) return fixer.replaceText(node.parent, `${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semi}`);
3699
- const specifiers = importDeclarationText.slice(importDeclarationText.indexOf("{"), importDeclarationText.indexOf("}") + 1);
3700
- return fixer.replaceText(node.parent, [`${importStringPrefix} * as ${node.local.name} from ${importSourceQuoted}${semi}`, `${importStringPrefix} ${specifiers} from ${importSourceQuoted}${semi}`].join("\n"));
3701
- }
3702
- });
3703
- } };
3704
- }
3705
-
3706
- //#endregion
3707
- //#region src/rules-removed/prefer-shorthand-boolean.ts
3708
- const RULE_NAME$1 = "prefer-shorthand-boolean";
3709
- const RULE_FEATURES$1 = ["FIX"];
3710
- var prefer_shorthand_boolean_default = createRule({
3711
- meta: {
3712
- type: "problem",
3713
- deprecated: true,
3714
- docs: {
3715
- description: "Enforces shorthand syntax for boolean attributes.",
3716
- [Symbol.for("rule_features")]: RULE_FEATURES$1
3717
- },
3718
- fixable: "code",
3719
- messages: { preferShorthandBoolean: "Use shorthand boolean attribute '{{propName}}'." },
3720
- replacedBy: ["react-x/jsx-shorthand-boolean"],
3721
- schema: []
3722
- },
3723
- name: RULE_NAME$1,
3724
- create: create$1,
3725
- defaultOptions: []
3726
- });
3727
- function create$1(context) {
3728
- return { JSXAttribute(node) {
3729
- const { value } = node;
3730
- const propName = ER.getAttributeName(context, node);
3731
- const hasValueTrue = value?.type === AST_NODE_TYPES.JSXExpressionContainer && value.expression.type === AST_NODE_TYPES.Literal && value.expression.value === true;
3732
- if (!hasValueTrue) return;
3733
- context.report({
3734
- messageId: "preferShorthandBoolean",
3735
- node: node.value ?? node,
3736
- data: { propName },
3737
- fix: (fixer) => fixer.removeRange([node.name.range[1], value.range[1]])
3738
- });
3739
- } };
3740
- }
3741
-
3742
- //#endregion
3743
- //#region src/rules-removed/prefer-shorthand-fragment.ts
3744
- const RULE_NAME = "prefer-shorthand-fragment";
3745
- const RULE_FEATURES = ["FIX"];
3746
- var prefer_shorthand_fragment_default = createRule({
3747
- meta: {
3748
- type: "problem",
3749
- deprecated: true,
3750
- docs: {
3751
- description: "Enforces shorthand syntax for fragments.",
3752
- [Symbol.for("rule_features")]: RULE_FEATURES
3753
- },
3754
- fixable: "code",
3755
- messages: { preferShorthandFragment: "Use fragment shorthand syntax instead of 'Fragment' component." },
3756
- replacedBy: ["react-x/jsx-shorthand-fragment"],
3757
- schema: []
3758
- },
3759
- name: RULE_NAME,
3760
- create,
3761
- defaultOptions: []
3762
- });
3763
- function create(context) {
3764
- return { JSXElement(node) {
3765
- if (!ER.isFragmentElement(context, node)) return;
3766
- const hasAttributes = node.openingElement.attributes.length > 0;
3767
- if (hasAttributes) return;
3768
- context.report({
3769
- messageId: "preferShorthandFragment",
3770
- node,
3771
- fix: (fixer) => {
3772
- const { closingElement, openingElement } = node;
3773
- if (closingElement == null) return [];
3774
- return [fixer.replaceTextRange([openingElement.range[0], openingElement.range[1]], "<>"), fixer.replaceTextRange([closingElement.range[0], closingElement.range[1]], "</>")];
3775
- }
3776
- });
3777
- } };
3778
- }
3779
-
3780
3498
  //#endregion
3781
3499
  //#region src/plugin.ts
3782
3500
  const plugin = {
@@ -3846,14 +3564,7 @@ const plugin = {
3846
3564
  "prefer-destructuring-assignment": prefer_destructuring_assignment_default,
3847
3565
  "prefer-namespace-import": prefer_namespace_import_default,
3848
3566
  "prefer-read-only-props": prefer_read_only_props_default,
3849
- "prefer-use-state-lazy-initialization": prefer_use_state_lazy_initialization_default,
3850
- "avoid-shorthand-boolean": avoid_shorthand_boolean_default,
3851
- "avoid-shorthand-fragment": avoid_shorthand_fragment_default,
3852
- "no-comment-textnodes": no_comment_textnodes_default,
3853
- "no-complex-conditional-rendering": no_complex_conditional_rendering_default,
3854
- "prefer-react-namespace-import": prefer_react_namespace_import_default,
3855
- "prefer-shorthand-boolean": prefer_shorthand_boolean_default,
3856
- "prefer-shorthand-fragment": prefer_shorthand_fragment_default
3567
+ "prefer-use-state-lazy-initialization": prefer_use_state_lazy_initialization_default
3857
3568
  }
3858
3569
  };
3859
3570