eslint-plugin-react-x 2.4.0 → 2.4.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +43 -44
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var __export = (all, symbols) => {
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region package.json
|
|
36
36
|
var name$6 = "eslint-plugin-react-x";
|
|
37
|
-
var version = "2.4.0";
|
|
37
|
+
var version = "2.4.1-next.0";
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/create-rule.ts
|
|
@@ -128,7 +128,7 @@ const RULE_NAME$62 = "jsx-dollar";
|
|
|
128
128
|
var jsx_dollar_default = createRule({
|
|
129
129
|
meta: {
|
|
130
130
|
type: "problem",
|
|
131
|
-
docs: { description: "Prevents dollar signs from being inserted
|
|
131
|
+
docs: { description: "Prevents unnecessary dollar signs ('$') from being inserted before an expression in JSX." },
|
|
132
132
|
fixable: "code",
|
|
133
133
|
hasSuggestions: true,
|
|
134
134
|
messages: {
|
|
@@ -283,8 +283,8 @@ const RULE_NAME$58 = "jsx-no-iife";
|
|
|
283
283
|
var jsx_no_iife_default = createRule({
|
|
284
284
|
meta: {
|
|
285
285
|
type: "problem",
|
|
286
|
-
docs: { description: "Disallows 'IIFE' in JSX
|
|
287
|
-
messages: { jsxNoIife: "Avoid using IIFE in JSX
|
|
286
|
+
docs: { description: "Disallows 'IIFE' in JSX." },
|
|
287
|
+
messages: { jsxNoIife: "Avoid using IIFE in JSX." },
|
|
288
288
|
schema: []
|
|
289
289
|
},
|
|
290
290
|
name: RULE_NAME$58,
|
|
@@ -350,7 +350,7 @@ const schema$3 = [{
|
|
|
350
350
|
var jsx_shorthand_boolean_default = createRule({
|
|
351
351
|
meta: {
|
|
352
352
|
type: "problem",
|
|
353
|
-
docs: { description: "Enforces shorthand syntax for boolean attributes." },
|
|
353
|
+
docs: { description: "Enforces the use of shorthand syntax for boolean attributes." },
|
|
354
354
|
fixable: "code",
|
|
355
355
|
messages: { jsxShorthandBoolean: "{{message}}" },
|
|
356
356
|
schema: schema$3
|
|
@@ -396,7 +396,7 @@ const schema$2 = [{
|
|
|
396
396
|
var jsx_shorthand_fragment_default = createRule({
|
|
397
397
|
meta: {
|
|
398
398
|
type: "problem",
|
|
399
|
-
docs: { description: "Enforces shorthand syntax for fragments." },
|
|
399
|
+
docs: { description: "Enforces the use of shorthand syntax for fragments." },
|
|
400
400
|
fixable: "code",
|
|
401
401
|
messages: { jsxShorthandFragment: "{{message}}" },
|
|
402
402
|
schema: schema$2
|
|
@@ -522,7 +522,7 @@ function isKeyLiteral$2(node, key) {
|
|
|
522
522
|
var no_access_state_in_setstate_default = createRule({
|
|
523
523
|
meta: {
|
|
524
524
|
type: "problem",
|
|
525
|
-
docs: { description: "Disallow accessing
|
|
525
|
+
docs: { description: "Disallow accessing 'this.state' inside 'setState' calls." },
|
|
526
526
|
messages: { noAccessStateInSetstate: "Do not access 'this.state' within 'setState'. Use the update function instead." },
|
|
527
527
|
schema: []
|
|
528
528
|
},
|
|
@@ -717,7 +717,7 @@ const RULE_NAME$50 = "no-children-count";
|
|
|
717
717
|
var no_children_count_default = createRule({
|
|
718
718
|
meta: {
|
|
719
719
|
type: "problem",
|
|
720
|
-
docs: { description: "Disallow
|
|
720
|
+
docs: { description: "Disallow 'Children.count'." },
|
|
721
721
|
messages: { noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
722
722
|
schema: []
|
|
723
723
|
},
|
|
@@ -763,7 +763,7 @@ const RULE_NAME$48 = "no-children-map";
|
|
|
763
763
|
var no_children_map_default = createRule({
|
|
764
764
|
meta: {
|
|
765
765
|
type: "problem",
|
|
766
|
-
docs: { description: "Disallow
|
|
766
|
+
docs: { description: "Disallow 'Children.map'." },
|
|
767
767
|
messages: { noChildrenMap: "Using 'Children.map' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
768
768
|
schema: []
|
|
769
769
|
},
|
|
@@ -786,7 +786,7 @@ const RULE_NAME$47 = "no-children-only";
|
|
|
786
786
|
var no_children_only_default = createRule({
|
|
787
787
|
meta: {
|
|
788
788
|
type: "problem",
|
|
789
|
-
docs: { description: "Disallow
|
|
789
|
+
docs: { description: "Disallow 'Children.only'." },
|
|
790
790
|
messages: { noChildrenOnly: "Using 'Children.only' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
791
791
|
schema: []
|
|
792
792
|
},
|
|
@@ -809,7 +809,7 @@ const RULE_NAME$46 = "no-children-prop";
|
|
|
809
809
|
var no_children_prop_default = createRule({
|
|
810
810
|
meta: {
|
|
811
811
|
type: "problem",
|
|
812
|
-
docs: { description: "Disallow passing
|
|
812
|
+
docs: { description: "Disallow passing 'children' as a prop." },
|
|
813
813
|
messages: { noChildrenProp: "Do not pass 'children' as props." },
|
|
814
814
|
schema: []
|
|
815
815
|
},
|
|
@@ -833,7 +833,7 @@ const RULE_NAME$45 = "no-children-to-array";
|
|
|
833
833
|
var no_children_to_array_default = createRule({
|
|
834
834
|
meta: {
|
|
835
835
|
type: "problem",
|
|
836
|
-
docs: { description: "Disallow
|
|
836
|
+
docs: { description: "Disallow 'Children.toArray'." },
|
|
837
837
|
messages: { noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
838
838
|
schema: []
|
|
839
839
|
},
|
|
@@ -888,7 +888,7 @@ const RULE_NAME$43 = "no-clone-element";
|
|
|
888
888
|
var no_clone_element_default = createRule({
|
|
889
889
|
meta: {
|
|
890
890
|
type: "problem",
|
|
891
|
-
docs: { description: "Disallow
|
|
891
|
+
docs: { description: "Disallow 'cloneElement'." },
|
|
892
892
|
messages: { noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
893
893
|
schema: []
|
|
894
894
|
},
|
|
@@ -911,7 +911,7 @@ const RULE_NAME$42 = "no-component-will-mount";
|
|
|
911
911
|
var no_component_will_mount_default = createRule({
|
|
912
912
|
meta: {
|
|
913
913
|
type: "problem",
|
|
914
|
-
docs: { description: "
|
|
914
|
+
docs: { description: "Replaces usages of 'componentWillMount' with 'UNSAFE_componentWillMount'." },
|
|
915
915
|
fixable: "code",
|
|
916
916
|
messages: { noComponentWillMount: "[Deprecated] Use 'UNSAFE_componentWillMount' instead." },
|
|
917
917
|
schema: []
|
|
@@ -947,7 +947,7 @@ const RULE_NAME$41 = "no-component-will-receive-props";
|
|
|
947
947
|
var no_component_will_receive_props_default = createRule({
|
|
948
948
|
meta: {
|
|
949
949
|
type: "problem",
|
|
950
|
-
docs: { description: "
|
|
950
|
+
docs: { description: "Replaces usages of 'componentWillReceiveProps' with 'UNSAFE_componentWillReceiveProps'." },
|
|
951
951
|
fixable: "code",
|
|
952
952
|
messages: { noComponentWillReceiveProps: "[Deprecated] Use 'UNSAFE_componentWillReceiveProps' instead." },
|
|
953
953
|
schema: []
|
|
@@ -983,7 +983,7 @@ const RULE_NAME$40 = "no-component-will-update";
|
|
|
983
983
|
var no_component_will_update_default = createRule({
|
|
984
984
|
meta: {
|
|
985
985
|
type: "problem",
|
|
986
|
-
docs: { description: "
|
|
986
|
+
docs: { description: "Replaces usages of 'componentWillUpdate' with 'UNSAFE_componentWillUpdate'." },
|
|
987
987
|
fixable: "code",
|
|
988
988
|
messages: { noComponentWillUpdate: "[Deprecated] Use 'UNSAFE_componentWillUpdate' instead." },
|
|
989
989
|
schema: []
|
|
@@ -1019,7 +1019,7 @@ const RULE_NAME$39 = "no-context-provider";
|
|
|
1019
1019
|
var no_context_provider_default = createRule({
|
|
1020
1020
|
meta: {
|
|
1021
1021
|
type: "problem",
|
|
1022
|
-
docs: { description: "
|
|
1022
|
+
docs: { description: "Replaces usages of '<Context.Provider>' with '<Context>'." },
|
|
1023
1023
|
fixable: "code",
|
|
1024
1024
|
messages: { noContextProvider: "In React 19, you can render '<Context>' as a provider instead of '<Context.Provider>'." },
|
|
1025
1025
|
schema: []
|
|
@@ -1059,7 +1059,7 @@ const RULE_NAME$38 = "no-create-ref";
|
|
|
1059
1059
|
var no_create_ref_default = createRule({
|
|
1060
1060
|
meta: {
|
|
1061
1061
|
type: "problem",
|
|
1062
|
-
docs: { description: "Disallow
|
|
1062
|
+
docs: { description: "Disallow 'createRef' in function components." },
|
|
1063
1063
|
messages: { noCreateRef: "[Deprecated] Use 'useRef' instead." },
|
|
1064
1064
|
schema: []
|
|
1065
1065
|
},
|
|
@@ -1082,7 +1082,7 @@ const RULE_NAME$37 = "no-default-props";
|
|
|
1082
1082
|
var no_default_props_default = createRule({
|
|
1083
1083
|
meta: {
|
|
1084
1084
|
type: "problem",
|
|
1085
|
-
docs: { description: "Disallow
|
|
1085
|
+
docs: { description: "Disallow 'defaultProps' property in favor of ES6 default parameters." },
|
|
1086
1086
|
messages: { noDefaultProps: "[Deprecated] Use ES6 default parameters instead." },
|
|
1087
1087
|
schema: []
|
|
1088
1088
|
},
|
|
@@ -1117,7 +1117,7 @@ function isConstructorFunction(node) {
|
|
|
1117
1117
|
var no_direct_mutation_state_default = createRule({
|
|
1118
1118
|
meta: {
|
|
1119
1119
|
type: "problem",
|
|
1120
|
-
docs: { description: "Disallow direct mutation of
|
|
1120
|
+
docs: { description: "Disallow direct mutation of 'this.state'." },
|
|
1121
1121
|
messages: { noDirectMutationState: "Do not mutate state directly. Use 'setState()' instead." },
|
|
1122
1122
|
schema: []
|
|
1123
1123
|
},
|
|
@@ -1143,7 +1143,7 @@ const RULE_NAME$35 = "no-duplicate-key";
|
|
|
1143
1143
|
var no_duplicate_key_default = createRule({
|
|
1144
1144
|
meta: {
|
|
1145
1145
|
type: "problem",
|
|
1146
|
-
docs: { description: "Disallow duplicate
|
|
1146
|
+
docs: { description: "Disallow duplicate 'key' on elements in the same array or a list of 'children'." },
|
|
1147
1147
|
messages: { noDuplicateKey: "A key must be unique. '{{value}}' is duplicated." },
|
|
1148
1148
|
schema: []
|
|
1149
1149
|
},
|
|
@@ -1210,7 +1210,7 @@ const RULE_NAME$34 = "no-forward-ref";
|
|
|
1210
1210
|
var no_forward_ref_default = createRule({
|
|
1211
1211
|
meta: {
|
|
1212
1212
|
type: "problem",
|
|
1213
|
-
docs: { description: "Replaces usages of
|
|
1213
|
+
docs: { description: "Replaces usages of 'forwardRef' with passing 'ref' as a prop." },
|
|
1214
1214
|
fixable: "code",
|
|
1215
1215
|
messages: { noForwardRef: "In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead." },
|
|
1216
1216
|
schema: []
|
|
@@ -1318,7 +1318,7 @@ const RULE_NAME$33 = "no-implicit-key";
|
|
|
1318
1318
|
var no_implicit_key_default = createRule({
|
|
1319
1319
|
meta: {
|
|
1320
1320
|
type: "problem",
|
|
1321
|
-
docs: { description: "Prevents
|
|
1321
|
+
docs: { description: "Prevents 'key' from not being explicitly specified (e.g. spreading 'key' from objects)." },
|
|
1322
1322
|
messages: { noImplicitKey: "Do not use implicit 'key' props." },
|
|
1323
1323
|
schema: []
|
|
1324
1324
|
},
|
|
@@ -1411,7 +1411,7 @@ const RULE_NAME$31 = "no-missing-component-display-name";
|
|
|
1411
1411
|
var no_missing_component_display_name_default = createRule({
|
|
1412
1412
|
meta: {
|
|
1413
1413
|
type: "problem",
|
|
1414
|
-
docs: { description: "Enforces that all components have a
|
|
1414
|
+
docs: { description: "Enforces that all components have a 'displayName' which can be used in devtools." },
|
|
1415
1415
|
messages: { noMissingComponentDisplayName: "Add missing 'displayName' for component." },
|
|
1416
1416
|
schema: []
|
|
1417
1417
|
},
|
|
@@ -1449,7 +1449,7 @@ const RULE_NAME$30 = "no-missing-context-display-name";
|
|
|
1449
1449
|
var no_missing_context_display_name_default = createRule({
|
|
1450
1450
|
meta: {
|
|
1451
1451
|
type: "problem",
|
|
1452
|
-
docs: { description: "Enforces that all contexts have a
|
|
1452
|
+
docs: { description: "Enforces that all contexts have a 'displayName' which can be used in devtools." },
|
|
1453
1453
|
fixable: "code",
|
|
1454
1454
|
messages: { noMissingContextDisplayName: "Add missing 'displayName' for context." },
|
|
1455
1455
|
schema: []
|
|
@@ -1514,7 +1514,7 @@ const RULE_NAME$29 = "no-missing-key";
|
|
|
1514
1514
|
var no_missing_key_default = createRule({
|
|
1515
1515
|
meta: {
|
|
1516
1516
|
type: "problem",
|
|
1517
|
-
docs: { description: "Disallow missing
|
|
1517
|
+
docs: { description: "Disallow missing 'key' on items in list rendering." },
|
|
1518
1518
|
messages: {
|
|
1519
1519
|
missingKey: "Missing 'key' for element when rendering list.",
|
|
1520
1520
|
unexpectedFragmentSyntax: "Use fragment component instead of '<>' because it does not support `key`."
|
|
@@ -1607,8 +1607,7 @@ const RULE_NAME$28 = "no-misused-capture-owner-stack";
|
|
|
1607
1607
|
var no_misused_capture_owner_stack_default = createRule({
|
|
1608
1608
|
meta: {
|
|
1609
1609
|
type: "problem",
|
|
1610
|
-
docs: { description: "Prevents incorrect usage of
|
|
1611
|
-
fixable: "code",
|
|
1610
|
+
docs: { description: "Prevents incorrect usage of 'captureOwnerStack'." },
|
|
1612
1611
|
messages: {
|
|
1613
1612
|
missingDevelopmentOnlyCheck: `Don't call 'captureOwnerStack' directly. Use 'if (process.env.NODE_ENV !== "production") {...}' to conditionally access it.`,
|
|
1614
1613
|
useNamespaceImport: "Don't use named imports of 'captureOwnerStack' in files that are bundled for development and production. Use a namespace import instead."
|
|
@@ -1818,7 +1817,7 @@ const RULE_NAME$25 = "no-prop-types";
|
|
|
1818
1817
|
var no_prop_types_default = createRule({
|
|
1819
1818
|
meta: {
|
|
1820
1819
|
type: "problem",
|
|
1821
|
-
docs: { description: "Disallow
|
|
1820
|
+
docs: { description: "Disallow 'propTypes' in favor of TypeScript or another type-checking solution." },
|
|
1822
1821
|
messages: { noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead." },
|
|
1823
1822
|
schema: []
|
|
1824
1823
|
},
|
|
@@ -1861,7 +1860,7 @@ function isShouldComponentUpdate(node) {
|
|
|
1861
1860
|
var no_redundant_should_component_update_default = createRule({
|
|
1862
1861
|
meta: {
|
|
1863
1862
|
type: "problem",
|
|
1864
|
-
docs: { description: "Disallow
|
|
1863
|
+
docs: { description: "Disallow 'shouldComponentUpdate' when extending 'React.PureComponent'." },
|
|
1865
1864
|
messages: { noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'." },
|
|
1866
1865
|
schema: []
|
|
1867
1866
|
},
|
|
@@ -1894,7 +1893,7 @@ const RULE_NAME$23 = "no-set-state-in-component-did-mount";
|
|
|
1894
1893
|
var no_set_state_in_component_did_mount_default = createRule({
|
|
1895
1894
|
meta: {
|
|
1896
1895
|
type: "problem",
|
|
1897
|
-
docs: { description: "Disallow calling
|
|
1896
|
+
docs: { description: "Disallow calling 'this.setState' in 'componentDidMount' outside of functions, such as callbacks." },
|
|
1898
1897
|
messages: { noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions, such as callbacks." },
|
|
1899
1898
|
schema: []
|
|
1900
1899
|
},
|
|
@@ -1924,7 +1923,7 @@ const RULE_NAME$22 = "no-set-state-in-component-did-update";
|
|
|
1924
1923
|
var no_set_state_in_component_did_update_default = createRule({
|
|
1925
1924
|
meta: {
|
|
1926
1925
|
type: "problem",
|
|
1927
|
-
docs: { description: "Disallow calling
|
|
1926
|
+
docs: { description: "Disallow calling 'this.setState' in 'componentDidUpdate' outside of functions, such as callbacks." },
|
|
1928
1927
|
messages: { noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions, such as callbacks." },
|
|
1929
1928
|
schema: []
|
|
1930
1929
|
},
|
|
@@ -1954,7 +1953,7 @@ const RULE_NAME$21 = "no-set-state-in-component-will-update";
|
|
|
1954
1953
|
var no_set_state_in_component_will_update_default = createRule({
|
|
1955
1954
|
meta: {
|
|
1956
1955
|
type: "problem",
|
|
1957
|
-
docs: { description: "Disallow calling
|
|
1956
|
+
docs: { description: "Disallow calling 'this.setState' in 'componentWillUpdate' outside of functions, such as callbacks." },
|
|
1958
1957
|
messages: { noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions, such as callbacks." },
|
|
1959
1958
|
schema: []
|
|
1960
1959
|
},
|
|
@@ -2042,7 +2041,7 @@ const RULE_NAME$19 = "no-unnecessary-key";
|
|
|
2042
2041
|
var no_unnecessary_key_default = createRule({
|
|
2043
2042
|
meta: {
|
|
2044
2043
|
type: "problem",
|
|
2045
|
-
docs: { description: "Prevents
|
|
2044
|
+
docs: { description: "Prevents 'key' from being placed on non-top-level elements in a list rendering." },
|
|
2046
2045
|
messages: { noUnnecessaryKey: "Unnecessary `key` prop on this element. The `key` should be on the top-level element returned from the array." },
|
|
2047
2046
|
schema: []
|
|
2048
2047
|
},
|
|
@@ -2086,7 +2085,7 @@ const RULE_NAME$18 = "no-unnecessary-use-callback";
|
|
|
2086
2085
|
var no_unnecessary_use_callback_default = createRule({
|
|
2087
2086
|
meta: {
|
|
2088
2087
|
type: "problem",
|
|
2089
|
-
docs: { description: "Disallow unnecessary usage of
|
|
2088
|
+
docs: { description: "Disallow unnecessary usage of 'useCallback'." },
|
|
2090
2089
|
messages: {
|
|
2091
2090
|
noUnnecessaryUseCallback: "An 'useCallback' with empty deps and no references to the component scope may be unnecessary.",
|
|
2092
2091
|
noUnnecessaryUseCallbackInsideUseEffect: "{{name}} is only used inside 1 useEffect, which may be unnecessary. You can move the computation into useEffect directly and merge the dependency arrays."
|
|
@@ -2159,7 +2158,7 @@ const RULE_NAME$17 = "no-unnecessary-use-memo";
|
|
|
2159
2158
|
var no_unnecessary_use_memo_default = createRule({
|
|
2160
2159
|
meta: {
|
|
2161
2160
|
type: "problem",
|
|
2162
|
-
docs: { description: "Disallow unnecessary usage of
|
|
2161
|
+
docs: { description: "Disallow unnecessary usage of 'useMemo'." },
|
|
2163
2162
|
messages: {
|
|
2164
2163
|
noUnnecessaryUseMemo: "An 'useMemo' with empty deps and no references to the component scope may be unnecessary.",
|
|
2165
2164
|
noUnnecessaryUseMemoInsideUseEffect: "{{name}} is only used inside 1 useEffect, which may be unnecessary. You can move the computation into useEffect directly and merge the dependency arrays."
|
|
@@ -2240,7 +2239,7 @@ function containsUseComments(context, node) {
|
|
|
2240
2239
|
var no_unnecessary_use_prefix_default = createRule({
|
|
2241
2240
|
meta: {
|
|
2242
2241
|
type: "problem",
|
|
2243
|
-
docs: { description: "Enforces that a function with the
|
|
2242
|
+
docs: { description: "Enforces that a function with the 'use' prefix should use at least one Hook inside of it." },
|
|
2244
2243
|
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." },
|
|
2245
2244
|
schema: []
|
|
2246
2245
|
},
|
|
@@ -2275,7 +2274,7 @@ const RULE_NAME$15 = "no-unsafe-component-will-mount";
|
|
|
2275
2274
|
var no_unsafe_component_will_mount_default = createRule({
|
|
2276
2275
|
meta: {
|
|
2277
2276
|
type: "problem",
|
|
2278
|
-
docs: { description: "Warns the usage of
|
|
2277
|
+
docs: { description: "Warns the usage of 'UNSAFE_componentWillMount' in class components." },
|
|
2279
2278
|
messages: { noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'." },
|
|
2280
2279
|
schema: []
|
|
2281
2280
|
},
|
|
@@ -2306,7 +2305,7 @@ const RULE_NAME$14 = "no-unsafe-component-will-receive-props";
|
|
|
2306
2305
|
var no_unsafe_component_will_receive_props_default = createRule({
|
|
2307
2306
|
meta: {
|
|
2308
2307
|
type: "problem",
|
|
2309
|
-
docs: { description: "Warns the usage of
|
|
2308
|
+
docs: { description: "Warns the usage of 'UNSAFE_componentWillReceiveProps' in class components." },
|
|
2310
2309
|
messages: { noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'." },
|
|
2311
2310
|
schema: []
|
|
2312
2311
|
},
|
|
@@ -2337,7 +2336,7 @@ const RULE_NAME$13 = "no-unsafe-component-will-update";
|
|
|
2337
2336
|
var no_unsafe_component_will_update_default = createRule({
|
|
2338
2337
|
meta: {
|
|
2339
2338
|
type: "problem",
|
|
2340
|
-
docs: { description: "Warns the usage of
|
|
2339
|
+
docs: { description: "Warns the usage of 'UNSAFE_componentWillUpdate' in class components." },
|
|
2341
2340
|
messages: { noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'." },
|
|
2342
2341
|
schema: []
|
|
2343
2342
|
},
|
|
@@ -2368,7 +2367,7 @@ const RULE_NAME$12 = "no-unstable-context-value";
|
|
|
2368
2367
|
var no_unstable_context_value_default = createRule({
|
|
2369
2368
|
meta: {
|
|
2370
2369
|
type: "problem",
|
|
2371
|
-
docs: { description: "Prevents non-stable values (i.e. object literals) from being used as a value for
|
|
2370
|
+
docs: { description: "Prevents non-stable values (i.e. object literals) from being used as a value for 'Context.Provider'." },
|
|
2372
2371
|
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}}" },
|
|
2373
2372
|
schema: []
|
|
2374
2373
|
},
|
|
@@ -2857,7 +2856,7 @@ const RULE_NAME$7 = "no-use-context";
|
|
|
2857
2856
|
var no_use_context_default = createRule({
|
|
2858
2857
|
meta: {
|
|
2859
2858
|
type: "problem",
|
|
2860
|
-
docs: { description: "Replaces usages of
|
|
2859
|
+
docs: { description: "Replaces usages of 'useContext' with 'use'." },
|
|
2861
2860
|
fixable: "code",
|
|
2862
2861
|
messages: { noUseContext: "In React 19, 'use' is preferred over 'useContext' because it is more flexible." },
|
|
2863
2862
|
schema: []
|
|
@@ -2935,7 +2934,7 @@ const RULE_NAME$6 = "no-useless-forward-ref";
|
|
|
2935
2934
|
var no_useless_forward_ref_default = createRule({
|
|
2936
2935
|
meta: {
|
|
2937
2936
|
type: "problem",
|
|
2938
|
-
docs: { description: "Disallow useless
|
|
2937
|
+
docs: { description: "Disallow useless 'forwardRef' calls on components that don't use 'ref's." },
|
|
2939
2938
|
messages: { noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set." },
|
|
2940
2939
|
schema: []
|
|
2941
2940
|
},
|
|
@@ -3253,7 +3252,7 @@ const ALLOW_LIST = [
|
|
|
3253
3252
|
var prefer_use_state_lazy_initialization_default = createRule({
|
|
3254
3253
|
meta: {
|
|
3255
3254
|
type: "problem",
|
|
3256
|
-
docs: { description: "Enforces function calls made inside
|
|
3255
|
+
docs: { description: "Enforces function calls made inside 'useState' to be wrapped in an 'initializer function'." },
|
|
3257
3256
|
messages: { preferUseStateLazyInitialization: "To prevent re-computation, consider using lazy initial state for useState calls that involve function calls. Ex: 'useState(() => getValue())'." },
|
|
3258
3257
|
schema: []
|
|
3259
3258
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.4.0",
|
|
3
|
+
"version": "2.4.1-next.0",
|
|
4
4
|
"description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-api-utils": "^2.1.0",
|
|
48
48
|
"ts-pattern": "^5.9.0",
|
|
49
|
-
"@eslint-react/ast": "2.4.0",
|
|
50
|
-
"@eslint-react/core": "2.4.0",
|
|
51
|
-
"@eslint-react/eff": "2.4.0",
|
|
52
|
-
"@eslint-react/shared": "2.4.0",
|
|
53
|
-
"@eslint-react/var": "2.4.0"
|
|
49
|
+
"@eslint-react/ast": "2.4.1-next.0",
|
|
50
|
+
"@eslint-react/core": "2.4.1-next.0",
|
|
51
|
+
"@eslint-react/eff": "2.4.1-next.0",
|
|
52
|
+
"@eslint-react/shared": "2.4.1-next.0",
|
|
53
|
+
"@eslint-react/var": "2.4.1-next.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.7",
|