eslint-plugin-react-x 2.4.1-next.0 → 2.4.1-next.10
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 +56 -57
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { camelCase } from "string-ts";
|
|
|
17
17
|
|
|
18
18
|
//#region rolldown:runtime
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
20
|
-
var
|
|
20
|
+
var __exportAll = (all, symbols) => {
|
|
21
21
|
let target = {};
|
|
22
22
|
for (var name$7 in all) {
|
|
23
23
|
__defProp(target, name$7, {
|
|
@@ -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.1-next.
|
|
37
|
+
var version = "2.4.1-next.10";
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/create-rule.ts
|
|
@@ -217,7 +217,7 @@ const RULE_NAME$60 = "jsx-no-comment-textnodes";
|
|
|
217
217
|
var jsx_no_comment_textnodes_default = createRule({
|
|
218
218
|
meta: {
|
|
219
219
|
type: "problem",
|
|
220
|
-
docs: { description: "Prevents
|
|
220
|
+
docs: { description: "Prevents comment strings (e.g., beginning with '//' or '/*') from being accidentally inserted into the JSX element's textnodes." },
|
|
221
221
|
messages: { jsxNoCommentTextnodes: "Possible misused comment in text node. Comments inside children section of tag should be placed inside braces." },
|
|
222
222
|
schema: []
|
|
223
223
|
},
|
|
@@ -250,7 +250,7 @@ const RULE_NAME$59 = "jsx-no-duplicate-props";
|
|
|
250
250
|
var jsx_no_duplicate_props_default = createRule({
|
|
251
251
|
meta: {
|
|
252
252
|
type: "problem",
|
|
253
|
-
docs: { description: "
|
|
253
|
+
docs: { description: "Disallows duplicate props in JSX elements." },
|
|
254
254
|
messages: { jsxNoDuplicateProps: "This JSX property is assigned multiple times." },
|
|
255
255
|
schema: []
|
|
256
256
|
},
|
|
@@ -314,7 +314,7 @@ const RULE_NAME$57 = "jsx-no-undef";
|
|
|
314
314
|
var jsx_no_undef_default = createRule({
|
|
315
315
|
meta: {
|
|
316
316
|
type: "problem",
|
|
317
|
-
docs: { description: "
|
|
317
|
+
docs: { description: "Prevents using variables in JSX that are not defined in the scope." },
|
|
318
318
|
messages: { jsxNoUndef: "JSX variable '{{name}}' is not defined." },
|
|
319
319
|
schema: []
|
|
320
320
|
},
|
|
@@ -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: "
|
|
525
|
+
docs: { description: "Disallows 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
|
},
|
|
@@ -639,7 +639,7 @@ function getIdentifiersFromBinaryExpression(side) {
|
|
|
639
639
|
var no_array_index_key_default = createRule({
|
|
640
640
|
meta: {
|
|
641
641
|
type: "problem",
|
|
642
|
-
docs: { description: "
|
|
642
|
+
docs: { description: "Disallows an item's index in the array as its key." },
|
|
643
643
|
messages: { noArrayIndexKey: "Do not use item index in the array as its key." },
|
|
644
644
|
schema: []
|
|
645
645
|
},
|
|
@@ -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: "
|
|
720
|
+
docs: { description: "Disallows the use of 'Children.count' from the 'react' package." },
|
|
721
721
|
messages: { noChildrenCount: "Using 'Children.count' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
722
722
|
schema: []
|
|
723
723
|
},
|
|
@@ -740,7 +740,7 @@ const RULE_NAME$49 = "no-children-for-each";
|
|
|
740
740
|
var no_children_for_each_default = createRule({
|
|
741
741
|
meta: {
|
|
742
742
|
type: "problem",
|
|
743
|
-
docs: { description: "
|
|
743
|
+
docs: { description: "Disallows the use of 'Children.forEach' from the 'react' package." },
|
|
744
744
|
messages: { noChildrenForEach: "Using 'Children.forEach' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
745
745
|
schema: []
|
|
746
746
|
},
|
|
@@ -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: "
|
|
766
|
+
docs: { description: "Disallows the use of 'Children.map' from the 'react' package." },
|
|
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: "
|
|
789
|
+
docs: { description: "Disallows the use of 'Children.only' from the 'react' package." },
|
|
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: "
|
|
812
|
+
docs: { description: "Disallows 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: "
|
|
836
|
+
docs: { description: "Disallows the use of 'Children.toArray' from the 'react' package." },
|
|
837
837
|
messages: { noChildrenToArray: "Using 'Children.toArray' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
838
838
|
schema: []
|
|
839
839
|
},
|
|
@@ -856,7 +856,7 @@ const RULE_NAME$44 = "no-class-component";
|
|
|
856
856
|
var no_class_component_default = createRule({
|
|
857
857
|
meta: {
|
|
858
858
|
type: "problem",
|
|
859
|
-
docs: { description: "
|
|
859
|
+
docs: { description: "Disallows class components except for error boundaries." },
|
|
860
860
|
messages: { noClassComponent: "Avoid using class components. Use function components instead." },
|
|
861
861
|
schema: []
|
|
862
862
|
},
|
|
@@ -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: "
|
|
891
|
+
docs: { description: "Disallows 'cloneElement'." },
|
|
892
892
|
messages: { noCloneElement: "Using 'cloneElement' is uncommon and can lead to fragile code. Use alternatives instead." },
|
|
893
893
|
schema: []
|
|
894
894
|
},
|
|
@@ -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: "
|
|
1062
|
+
docs: { description: "Disallows '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: "
|
|
1085
|
+
docs: { description: "Disallows the '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: "
|
|
1120
|
+
docs: { description: "Disallows 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: "
|
|
1146
|
+
docs: { description: "Disallows 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
|
},
|
|
@@ -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 'key' from not being explicitly specified (e.g
|
|
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 'displayName'
|
|
1414
|
+
docs: { description: "Enforces that all components have a 'displayName' that 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 'displayName'
|
|
1452
|
+
docs: { description: "Enforces that all contexts have a 'displayName' that 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: "
|
|
1517
|
+
docs: { description: "Disallows 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`."
|
|
@@ -1644,8 +1644,7 @@ function create$28(context) {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
function isDevelopmentOnlyCheck(node) {
|
|
1646
1646
|
if (node.type !== AST_NODE_TYPES.IfStatement) return false;
|
|
1647
|
-
|
|
1648
|
-
return false;
|
|
1647
|
+
return AST.isProcessEnvNodeEnvCompare(node.test, "!==", "production");
|
|
1649
1648
|
}
|
|
1650
1649
|
|
|
1651
1650
|
//#endregion
|
|
@@ -1654,7 +1653,7 @@ const RULE_NAME$27 = "no-nested-component-definitions";
|
|
|
1654
1653
|
var no_nested_component_definitions_default = createRule({
|
|
1655
1654
|
meta: {
|
|
1656
1655
|
type: "problem",
|
|
1657
|
-
docs: { description: "
|
|
1656
|
+
docs: { description: "Disallows nesting component definitions inside other components." },
|
|
1658
1657
|
messages: { noNestedComponentDefinitions: "Do not nest component definitions inside other components or props. {{suggestion}}" },
|
|
1659
1658
|
schema: []
|
|
1660
1659
|
},
|
|
@@ -1774,7 +1773,7 @@ const RULE_NAME$26 = "no-nested-lazy-component-declarations";
|
|
|
1774
1773
|
var no_nested_lazy_component_declarations_default = createRule({
|
|
1775
1774
|
meta: {
|
|
1776
1775
|
type: "problem",
|
|
1777
|
-
docs: { description: "
|
|
1776
|
+
docs: { description: "Disallows nesting lazy component declarations inside other components." },
|
|
1778
1777
|
messages: { noNestedLazyComponentDeclarations: "Do not declare lazy components inside other components. Instead, always declare them at the top level of your module." },
|
|
1779
1778
|
schema: []
|
|
1780
1779
|
},
|
|
@@ -1817,7 +1816,7 @@ const RULE_NAME$25 = "no-prop-types";
|
|
|
1817
1816
|
var no_prop_types_default = createRule({
|
|
1818
1817
|
meta: {
|
|
1819
1818
|
type: "problem",
|
|
1820
|
-
docs: { description: "
|
|
1819
|
+
docs: { description: "Disallows 'propTypes' in favor of TypeScript or another type-checking solution." },
|
|
1821
1820
|
messages: { noPropTypes: "[Deprecated] Use TypeScript or another type-checking solution instead." },
|
|
1822
1821
|
schema: []
|
|
1823
1822
|
},
|
|
@@ -1860,7 +1859,7 @@ function isShouldComponentUpdate(node) {
|
|
|
1860
1859
|
var no_redundant_should_component_update_default = createRule({
|
|
1861
1860
|
meta: {
|
|
1862
1861
|
type: "problem",
|
|
1863
|
-
docs: { description: "
|
|
1862
|
+
docs: { description: "Disallows 'shouldComponentUpdate' when extending 'React.PureComponent'." },
|
|
1864
1863
|
messages: { noRedundantShouldComponentUpdate: "'{{componentName}}' does not need 'shouldComponentUpdate' when extending 'React.PureComponent'." },
|
|
1865
1864
|
schema: []
|
|
1866
1865
|
},
|
|
@@ -1893,8 +1892,8 @@ const RULE_NAME$23 = "no-set-state-in-component-did-mount";
|
|
|
1893
1892
|
var no_set_state_in_component_did_mount_default = createRule({
|
|
1894
1893
|
meta: {
|
|
1895
1894
|
type: "problem",
|
|
1896
|
-
docs: { description: "
|
|
1897
|
-
messages: { noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions
|
|
1895
|
+
docs: { description: "Disallows calling 'this.setState' in 'componentDidMount' outside of functions such as callbacks." },
|
|
1896
|
+
messages: { noSetStateInComponentDidMount: "Do not call `this.setState` in `componentDidMount` outside of functions such as callbacks." },
|
|
1898
1897
|
schema: []
|
|
1899
1898
|
},
|
|
1900
1899
|
name: RULE_NAME$23,
|
|
@@ -1923,8 +1922,8 @@ const RULE_NAME$22 = "no-set-state-in-component-did-update";
|
|
|
1923
1922
|
var no_set_state_in_component_did_update_default = createRule({
|
|
1924
1923
|
meta: {
|
|
1925
1924
|
type: "problem",
|
|
1926
|
-
docs: { description: "
|
|
1927
|
-
messages: { noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions
|
|
1925
|
+
docs: { description: "Disallows calling 'this.setState' in 'componentDidUpdate' outside of functions such as callbacks." },
|
|
1926
|
+
messages: { noSetStateInComponentDidUpdate: "Do not call `this.setState` in `componentDidUpdate` outside of functions such as callbacks." },
|
|
1928
1927
|
schema: []
|
|
1929
1928
|
},
|
|
1930
1929
|
name: RULE_NAME$22,
|
|
@@ -1953,8 +1952,8 @@ const RULE_NAME$21 = "no-set-state-in-component-will-update";
|
|
|
1953
1952
|
var no_set_state_in_component_will_update_default = createRule({
|
|
1954
1953
|
meta: {
|
|
1955
1954
|
type: "problem",
|
|
1956
|
-
docs: { description: "
|
|
1957
|
-
messages: { noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions
|
|
1955
|
+
docs: { description: "Disallows calling 'this.setState' in 'componentWillUpdate' outside of functions such as callbacks." },
|
|
1956
|
+
messages: { noSetStateInComponentWillUpdate: "Do not call `this.setState` in `componentWillUpdate` outside of functions such as callbacks." },
|
|
1958
1957
|
schema: []
|
|
1959
1958
|
},
|
|
1960
1959
|
name: RULE_NAME$21,
|
|
@@ -2041,7 +2040,7 @@ const RULE_NAME$19 = "no-unnecessary-key";
|
|
|
2041
2040
|
var no_unnecessary_key_default = createRule({
|
|
2042
2041
|
meta: {
|
|
2043
2042
|
type: "problem",
|
|
2044
|
-
docs: { description: "Prevents 'key' from being placed on non-top-level elements in
|
|
2043
|
+
docs: { description: "Prevents 'key' from being placed on non-top-level elements in list rendering." },
|
|
2045
2044
|
messages: { noUnnecessaryKey: "Unnecessary `key` prop on this element. The `key` should be on the top-level element returned from the array." },
|
|
2046
2045
|
schema: []
|
|
2047
2046
|
},
|
|
@@ -2085,7 +2084,7 @@ const RULE_NAME$18 = "no-unnecessary-use-callback";
|
|
|
2085
2084
|
var no_unnecessary_use_callback_default = createRule({
|
|
2086
2085
|
meta: {
|
|
2087
2086
|
type: "problem",
|
|
2088
|
-
docs: { description: "
|
|
2087
|
+
docs: { description: "Disallows unnecessary usage of 'useCallback'." },
|
|
2089
2088
|
messages: {
|
|
2090
2089
|
noUnnecessaryUseCallback: "An 'useCallback' with empty deps and no references to the component scope may be unnecessary.",
|
|
2091
2090
|
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."
|
|
@@ -2158,7 +2157,7 @@ const RULE_NAME$17 = "no-unnecessary-use-memo";
|
|
|
2158
2157
|
var no_unnecessary_use_memo_default = createRule({
|
|
2159
2158
|
meta: {
|
|
2160
2159
|
type: "problem",
|
|
2161
|
-
docs: { description: "
|
|
2160
|
+
docs: { description: "Disallows unnecessary usage of 'useMemo'." },
|
|
2162
2161
|
messages: {
|
|
2163
2162
|
noUnnecessaryUseMemo: "An 'useMemo' with empty deps and no references to the component scope may be unnecessary.",
|
|
2164
2163
|
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."
|
|
@@ -2239,7 +2238,7 @@ function containsUseComments(context, node) {
|
|
|
2239
2238
|
var no_unnecessary_use_prefix_default = createRule({
|
|
2240
2239
|
meta: {
|
|
2241
2240
|
type: "problem",
|
|
2242
|
-
docs: { description: "Enforces that a function with the 'use' prefix
|
|
2241
|
+
docs: { description: "Enforces that a function with the 'use' prefix uses at least one Hook inside it." },
|
|
2243
2242
|
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." },
|
|
2244
2243
|
schema: []
|
|
2245
2244
|
},
|
|
@@ -2274,7 +2273,7 @@ const RULE_NAME$15 = "no-unsafe-component-will-mount";
|
|
|
2274
2273
|
var no_unsafe_component_will_mount_default = createRule({
|
|
2275
2274
|
meta: {
|
|
2276
2275
|
type: "problem",
|
|
2277
|
-
docs: { description: "Warns the usage of 'UNSAFE_componentWillMount' in class components." },
|
|
2276
|
+
docs: { description: "Warns about the usage of 'UNSAFE_componentWillMount' in class components." },
|
|
2278
2277
|
messages: { noUnsafeComponentWillMount: "Do not use 'UNSAFE_componentWillMount'." },
|
|
2279
2278
|
schema: []
|
|
2280
2279
|
},
|
|
@@ -2305,7 +2304,7 @@ const RULE_NAME$14 = "no-unsafe-component-will-receive-props";
|
|
|
2305
2304
|
var no_unsafe_component_will_receive_props_default = createRule({
|
|
2306
2305
|
meta: {
|
|
2307
2306
|
type: "problem",
|
|
2308
|
-
docs: { description: "Warns the usage of 'UNSAFE_componentWillReceiveProps' in class components." },
|
|
2307
|
+
docs: { description: "Warns about the usage of 'UNSAFE_componentWillReceiveProps' in class components." },
|
|
2309
2308
|
messages: { noUnsafeComponentWillReceiveProps: "Do not use 'UNSAFE_componentWillReceiveProps'." },
|
|
2310
2309
|
schema: []
|
|
2311
2310
|
},
|
|
@@ -2336,7 +2335,7 @@ const RULE_NAME$13 = "no-unsafe-component-will-update";
|
|
|
2336
2335
|
var no_unsafe_component_will_update_default = createRule({
|
|
2337
2336
|
meta: {
|
|
2338
2337
|
type: "problem",
|
|
2339
|
-
docs: { description: "Warns the usage of 'UNSAFE_componentWillUpdate' in class components." },
|
|
2338
|
+
docs: { description: "Warns about the usage of 'UNSAFE_componentWillUpdate' in class components." },
|
|
2340
2339
|
messages: { noUnsafeComponentWillUpdate: "Do not use 'UNSAFE_componentWillUpdate'." },
|
|
2341
2340
|
schema: []
|
|
2342
2341
|
},
|
|
@@ -2367,7 +2366,7 @@ const RULE_NAME$12 = "no-unstable-context-value";
|
|
|
2367
2366
|
var no_unstable_context_value_default = createRule({
|
|
2368
2367
|
meta: {
|
|
2369
2368
|
type: "problem",
|
|
2370
|
-
docs: { description: "Prevents non-stable values (i.e
|
|
2369
|
+
docs: { description: "Prevents non-stable values (i.e., object literals) from being used as a value for 'Context.Provider'." },
|
|
2371
2370
|
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}}" },
|
|
2372
2371
|
schema: []
|
|
2373
2372
|
},
|
|
@@ -2523,7 +2522,7 @@ function isKeyLiteral$1(node, key) {
|
|
|
2523
2522
|
var no_unused_class_component_members_default = createRule({
|
|
2524
2523
|
meta: {
|
|
2525
2524
|
type: "problem",
|
|
2526
|
-
docs: { description: "Warns unused class component methods and properties." },
|
|
2525
|
+
docs: { description: "Warns about unused class component methods and properties." },
|
|
2527
2526
|
messages: { noUnusedClassComponentMembers: "Unused method or property '{{methodName}}'' of class '{{className}}'." },
|
|
2528
2527
|
schema: []
|
|
2529
2528
|
},
|
|
@@ -2616,7 +2615,7 @@ const RULE_NAME$9 = "no-unused-props";
|
|
|
2616
2615
|
var no_unused_props_default = createRule({
|
|
2617
2616
|
meta: {
|
|
2618
2617
|
type: "problem",
|
|
2619
|
-
docs: { description: "Warns component props that are defined but never used." },
|
|
2618
|
+
docs: { description: "Warns about component props that are defined but never used." },
|
|
2620
2619
|
messages: { noUnusedProps: "Prop `{{name}}` is declared but never used" },
|
|
2621
2620
|
schema: []
|
|
2622
2621
|
},
|
|
@@ -2735,7 +2734,7 @@ function isKeyLiteral(node, key) {
|
|
|
2735
2734
|
var no_unused_state_default = createRule({
|
|
2736
2735
|
meta: {
|
|
2737
2736
|
type: "problem",
|
|
2738
|
-
docs: { description: "Warns unused class component state." },
|
|
2737
|
+
docs: { description: "Warns about unused class component state." },
|
|
2739
2738
|
messages: { noUnusedState: "Unused class component state in '{{className}}'" },
|
|
2740
2739
|
schema: []
|
|
2741
2740
|
},
|
|
@@ -2934,7 +2933,7 @@ const RULE_NAME$6 = "no-useless-forward-ref";
|
|
|
2934
2933
|
var no_useless_forward_ref_default = createRule({
|
|
2935
2934
|
meta: {
|
|
2936
2935
|
type: "problem",
|
|
2937
|
-
docs: { description: "
|
|
2936
|
+
docs: { description: "Disallows useless 'forwardRef' calls on components that don't use 'ref's." },
|
|
2938
2937
|
messages: { noUselessForwardRef: "A 'forwardRef' is used with this component but no 'ref' parameter is set." },
|
|
2939
2938
|
schema: []
|
|
2940
2939
|
},
|
|
@@ -2980,7 +2979,7 @@ var no_useless_fragment_default = createRule({
|
|
|
2980
2979
|
meta: {
|
|
2981
2980
|
type: "problem",
|
|
2982
2981
|
defaultOptions: [...defaultOptions$1],
|
|
2983
|
-
docs: { description: "
|
|
2982
|
+
docs: { description: "Disallows useless fragment elements." },
|
|
2984
2983
|
fixable: "code",
|
|
2985
2984
|
messages: { noUselessFragment: "A fragment {{reason}} is useless." },
|
|
2986
2985
|
schema
|
|
@@ -3154,7 +3153,7 @@ const RULE_NAME$3 = "prefer-namespace-import";
|
|
|
3154
3153
|
var prefer_namespace_import_default = createRule({
|
|
3155
3154
|
meta: {
|
|
3156
3155
|
type: "problem",
|
|
3157
|
-
docs: { description: "Enforces React
|
|
3156
|
+
docs: { description: "Enforces importing React via a namespace import." },
|
|
3158
3157
|
fixable: "code",
|
|
3159
3158
|
messages: { preferNamespaceImport: "Prefer importing React as 'import * as React from \"{{importSource}}\"';" },
|
|
3160
3159
|
schema: []
|
|
@@ -3252,7 +3251,7 @@ const ALLOW_LIST = [
|
|
|
3252
3251
|
var prefer_use_state_lazy_initialization_default = createRule({
|
|
3253
3252
|
meta: {
|
|
3254
3253
|
type: "problem",
|
|
3255
|
-
docs: { description: "Enforces function calls made inside 'useState'
|
|
3254
|
+
docs: { description: "Enforces wrapping function calls made inside 'useState' in an 'initializer function'." },
|
|
3256
3255
|
messages: { preferUseStateLazyInitialization: "To prevent re-computation, consider using lazy initial state for useState calls that involve function calls. Ex: 'useState(() => getValue())'." },
|
|
3257
3256
|
schema: []
|
|
3258
3257
|
},
|
|
@@ -3304,7 +3303,7 @@ var no_forbidden_props_default = createRule({
|
|
|
3304
3303
|
url: "https://eslint.org/docs/latest/rules/no-restricted-syntax"
|
|
3305
3304
|
} }]
|
|
3306
3305
|
},
|
|
3307
|
-
docs: { description: "
|
|
3306
|
+
docs: { description: "Disallows certain props on components." },
|
|
3308
3307
|
messages: { [messageId]: "Prop \"{{name}}\" is forbidden." },
|
|
3309
3308
|
schema: [{
|
|
3310
3309
|
type: "object",
|
|
@@ -3448,7 +3447,7 @@ const plugin = {
|
|
|
3448
3447
|
|
|
3449
3448
|
//#endregion
|
|
3450
3449
|
//#region src/configs/recommended.ts
|
|
3451
|
-
var recommended_exports = /* @__PURE__ */
|
|
3450
|
+
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
3452
3451
|
name: () => name$5,
|
|
3453
3452
|
plugins: () => plugins$5,
|
|
3454
3453
|
rules: () => rules$6,
|
|
@@ -3513,7 +3512,7 @@ const rules$5 = {
|
|
|
3513
3512
|
|
|
3514
3513
|
//#endregion
|
|
3515
3514
|
//#region src/configs/recommended-typescript.ts
|
|
3516
|
-
var recommended_typescript_exports = /* @__PURE__ */
|
|
3515
|
+
var recommended_typescript_exports = /* @__PURE__ */ __exportAll({
|
|
3517
3516
|
name: () => name$4,
|
|
3518
3517
|
plugins: () => plugins$4,
|
|
3519
3518
|
rules: () => rules$4,
|
|
@@ -3529,7 +3528,7 @@ const settings$4 = { ...settings$5 };
|
|
|
3529
3528
|
|
|
3530
3529
|
//#endregion
|
|
3531
3530
|
//#region src/configs/recommended-type-checked.ts
|
|
3532
|
-
var recommended_type_checked_exports = /* @__PURE__ */
|
|
3531
|
+
var recommended_type_checked_exports = /* @__PURE__ */ __exportAll({
|
|
3533
3532
|
name: () => name$3,
|
|
3534
3533
|
plugins: () => plugins$3,
|
|
3535
3534
|
rules: () => rules$3,
|
|
@@ -3545,7 +3544,7 @@ const settings$3 = { ...settings$4 };
|
|
|
3545
3544
|
|
|
3546
3545
|
//#endregion
|
|
3547
3546
|
//#region src/configs/strict.ts
|
|
3548
|
-
var strict_exports = /* @__PURE__ */
|
|
3547
|
+
var strict_exports = /* @__PURE__ */ __exportAll({
|
|
3549
3548
|
name: () => name$2,
|
|
3550
3549
|
plugins: () => plugins$2,
|
|
3551
3550
|
rules: () => rules$2,
|
|
@@ -3573,7 +3572,7 @@ const settings$2 = { ...settings$5 };
|
|
|
3573
3572
|
|
|
3574
3573
|
//#endregion
|
|
3575
3574
|
//#region src/configs/strict-typescript.ts
|
|
3576
|
-
var strict_typescript_exports = /* @__PURE__ */
|
|
3575
|
+
var strict_typescript_exports = /* @__PURE__ */ __exportAll({
|
|
3577
3576
|
name: () => name$1,
|
|
3578
3577
|
plugins: () => plugins$1,
|
|
3579
3578
|
rules: () => rules$1,
|
|
@@ -3589,7 +3588,7 @@ const settings$1 = { ...settings$2 };
|
|
|
3589
3588
|
|
|
3590
3589
|
//#endregion
|
|
3591
3590
|
//#region src/configs/strict-type-checked.ts
|
|
3592
|
-
var strict_type_checked_exports = /* @__PURE__ */
|
|
3591
|
+
var strict_type_checked_exports = /* @__PURE__ */ __exportAll({
|
|
3593
3592
|
name: () => name,
|
|
3594
3593
|
plugins: () => plugins,
|
|
3595
3594
|
rules: () => rules,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.4.1-next.
|
|
3
|
+
"version": "2.4.1-next.10",
|
|
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",
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
"compare-versions": "^6.1.1",
|
|
45
45
|
"is-immutable-type": "^5.0.1",
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
|
-
"ts-api-utils": "^2.
|
|
47
|
+
"ts-api-utils": "^2.3.0",
|
|
48
48
|
"ts-pattern": "^5.9.0",
|
|
49
|
-
"@eslint-react/ast": "2.4.1-next.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "2.4.1-next.10",
|
|
50
|
+
"@eslint-react/eff": "2.4.1-next.10",
|
|
51
|
+
"@eslint-react/shared": "2.4.1-next.10",
|
|
52
|
+
"@eslint-react/var": "2.4.1-next.10",
|
|
53
|
+
"@eslint-react/core": "2.4.1-next.10"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.7",
|
|
57
57
|
"@types/react-dom": "^19.2.3",
|
|
58
|
-
"tsdown": "^0.18.
|
|
58
|
+
"tsdown": "^0.18.3",
|
|
59
59
|
"@local/configs": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|