You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Verifies that automatic effect dependencies are compiled if opted-in',
639
-
recommended: true,
652
+
recommended: false,
640
653
};
641
654
}
642
655
caseErrorCategory.CapitalizedCalls: {
@@ -652,7 +665,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
652
665
return{
653
666
category,
654
667
name: 'config',
655
-
description: 'Validates the configuration',
668
+
description: 'Validates the compiler configuration options',
656
669
recommended: true,
657
670
};
658
671
}
@@ -678,7 +691,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
678
691
category,
679
692
name: 'set-state-in-effect',
680
693
description:
681
-
'Validates against calling setState synchronously in an effect',
694
+
'Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance',
682
695
recommended: true,
683
696
};
684
697
}
@@ -687,7 +700,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
687
700
category,
688
701
name: 'error-boundaries',
689
702
description:
690
-
'Validates usage of error boundaries instead of try/catch for errors in JSX',
703
+
'Validates usage of error boundaries instead of try/catch for errors in child components',
691
704
recommended: true,
692
705
};
693
706
}
@@ -711,7 +724,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
711
724
return{
712
725
category,
713
726
name: 'gating',
714
-
description: 'Validates configuration of gating mode',
727
+
description:
728
+
'Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)',
715
729
recommended: true,
716
730
};
717
731
}
@@ -720,7 +734,8 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
720
734
category,
721
735
name: 'globals',
722
736
description:
723
-
'Validates against assignment/mutation of globals during render',
737
+
'Validates against assignment/mutation of globals during render, part of ensuring that '+
738
+
'[side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)',
724
739
recommended: true,
725
740
};
726
741
}
@@ -742,7 +757,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
742
757
category,
743
758
name: 'immutability',
744
759
description:
745
-
'Validates that immutable values (props, state, etc) are not mutated',
760
+
'Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)',
746
761
recommended: true,
747
762
};
748
763
}
@@ -759,7 +774,9 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
759
774
category,
760
775
name: 'preserve-manual-memoization',
761
776
description:
762
-
'Validates that existing manual memoized is preserved by the compiler',
777
+
'Validates that existing manual memoized is preserved by the compiler. '+
778
+
'React Compiler will only compile components and hooks if its inference '+
779
+
'[matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)',
763
780
recommended: true,
764
781
};
765
782
}
@@ -768,7 +785,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
768
785
category,
769
786
name: 'purity',
770
787
description:
771
-
'Validates that the component/hook is pure, and does not call known-impure functions',
788
+
'Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions',
772
789
recommended: true,
773
790
};
774
791
}
@@ -777,15 +794,16 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
777
794
category,
778
795
name: 'refs',
779
796
description:
780
-
'Validates correct usage of refs, not reading/writing during render',
797
+
'Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)',
781
798
recommended: true,
782
799
};
783
800
}
784
801
caseErrorCategory.RenderSetState: {
785
802
return{
786
803
category,
787
804
name: 'set-state-in-render',
788
-
description: 'Validates against setting state during render',
805
+
description:
806
+
'Validates against setting state during render, which can trigger additional renders and potential infinite render loops',
789
807
recommended: true,
790
808
};
791
809
}
@@ -794,7 +812,7 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
794
812
category,
795
813
name: 'static-components',
796
814
description:
797
-
'Validates that components are static, not recreated every render',
815
+
'Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering',
798
816
recommended: true,
799
817
};
800
818
}
@@ -826,15 +844,17 @@ export function getRuleForCategory(category: ErrorCategory): LintRule {
826
844
return{
827
845
category,
828
846
name: 'unsupported-syntax',
829
-
description: 'Validates against syntax that we do not plan to support',
847
+
description:
848
+
'Validates against syntax that we do not plan to support in React Compiler',
830
849
recommended: true,
831
850
};
832
851
}
833
852
caseErrorCategory.UseMemo: {
834
853
return{
835
854
category,
836
855
name: 'use-memo',
837
-
description: 'Validates usage of the useMemo() hook',
856
+
description:
857
+
'Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
0 commit comments