eslint-plugin-react-x 1.45.4-next.1 → 1.45.4-next.2
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 +10 -10
- package/dist/index.mjs +11 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -143,7 +143,7 @@ var settings3 = {
|
|
|
143
143
|
|
|
144
144
|
// package.json
|
|
145
145
|
var name4 = "eslint-plugin-react-x";
|
|
146
|
-
var version = "1.45.4-next.
|
|
146
|
+
var version = "1.45.4-next.2";
|
|
147
147
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
148
148
|
|
|
149
149
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -577,7 +577,7 @@ var no_array_index_key_default = createRule({
|
|
|
577
577
|
defaultOptions: []
|
|
578
578
|
});
|
|
579
579
|
function create8(context) {
|
|
580
|
-
const report = kit.
|
|
580
|
+
const report = kit.Report.make(context);
|
|
581
581
|
const indexParamNames = [];
|
|
582
582
|
function isArrayIndex(node) {
|
|
583
583
|
return node.type === types.AST_NODE_TYPES.Identifier && indexParamNames.some((name5) => name5 != null && name5 === node.name);
|
|
@@ -655,7 +655,7 @@ function create8(context) {
|
|
|
655
655
|
continue;
|
|
656
656
|
}
|
|
657
657
|
for (const descriptor of getReportDescriptors(prop.value)) {
|
|
658
|
-
report(descriptor);
|
|
658
|
+
report.send(descriptor);
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
},
|
|
@@ -673,7 +673,7 @@ function create8(context) {
|
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
for (const descriptor of getReportDescriptors(node.value.expression)) {
|
|
676
|
-
report(descriptor);
|
|
676
|
+
report.send(descriptor);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
};
|
|
@@ -1713,7 +1713,7 @@ function create29(context) {
|
|
|
1713
1713
|
return tsPattern.match(variableDefNode).with({ init: tsPattern.P.select({ type: tsPattern.P.not(types.AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => eff._);
|
|
1714
1714
|
}).otherwise(() => eff._);
|
|
1715
1715
|
}
|
|
1716
|
-
const visitorFunction = eff.flow(getReportDescriptor, kit.
|
|
1716
|
+
const visitorFunction = eff.flow(getReportDescriptor, kit.Report.make(context).send);
|
|
1717
1717
|
return {
|
|
1718
1718
|
"JSXExpressionContainer > ConditionalExpression": visitorFunction,
|
|
1719
1719
|
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
@@ -1848,7 +1848,7 @@ var no_missing_key_default = createRule({
|
|
|
1848
1848
|
defaultOptions: []
|
|
1849
1849
|
});
|
|
1850
1850
|
function create32(context) {
|
|
1851
|
-
const report = kit.
|
|
1851
|
+
const report = kit.Report.make(context);
|
|
1852
1852
|
const state = { isWithinChildrenToArray: false };
|
|
1853
1853
|
function checkIteratorElement(node) {
|
|
1854
1854
|
switch (node.type) {
|
|
@@ -1912,7 +1912,7 @@ function create32(context) {
|
|
|
1912
1912
|
const initialScope = context.sourceCode.getScope(node);
|
|
1913
1913
|
for (const element of elements) {
|
|
1914
1914
|
if (!JSX9__namespace.hasAttribute("key", element.openingElement.attributes, initialScope)) {
|
|
1915
|
-
report({
|
|
1915
|
+
report.send({
|
|
1916
1916
|
messageId: "missingKey",
|
|
1917
1917
|
node: element
|
|
1918
1918
|
});
|
|
@@ -1926,10 +1926,10 @@ function create32(context) {
|
|
|
1926
1926
|
if (!AST8__namespace.isFunction(callback)) return;
|
|
1927
1927
|
const body = callback.body;
|
|
1928
1928
|
if (body.type === types.AST_NODE_TYPES.BlockStatement) {
|
|
1929
|
-
checkBlockStatement(body).forEach(report);
|
|
1929
|
+
checkBlockStatement(body).forEach(report.send);
|
|
1930
1930
|
return;
|
|
1931
1931
|
}
|
|
1932
|
-
report(checkExpression(body));
|
|
1932
|
+
report.send(checkExpression(body));
|
|
1933
1933
|
},
|
|
1934
1934
|
"CallExpression:exit"(node) {
|
|
1935
1935
|
if (!ER22__namespace.isChildrenToArrayCall(context, node)) {
|
|
@@ -1942,7 +1942,7 @@ function create32(context) {
|
|
|
1942
1942
|
return;
|
|
1943
1943
|
}
|
|
1944
1944
|
if (node.parent.type === types.AST_NODE_TYPES.ArrayExpression) {
|
|
1945
|
-
report({
|
|
1945
|
+
report.send({
|
|
1946
1946
|
messageId: "unexpectedFragmentSyntax",
|
|
1947
1947
|
node
|
|
1948
1948
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, unsafeDecodeSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as JSX9 from '@eslint-react/jsx';
|
|
3
3
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
-
import { JsxConfig,
|
|
4
|
+
import { JsxConfig, Report, SEL } from '@eslint-react/kit';
|
|
5
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
6
6
|
import * as VAR2 from '@eslint-react/var';
|
|
7
7
|
import { match, isMatching, P } from 'ts-pattern';
|
|
@@ -115,7 +115,7 @@ var settings3 = {
|
|
|
115
115
|
|
|
116
116
|
// package.json
|
|
117
117
|
var name4 = "eslint-plugin-react-x";
|
|
118
|
-
var version = "1.45.4-next.
|
|
118
|
+
var version = "1.45.4-next.2";
|
|
119
119
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
120
120
|
|
|
121
121
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -549,7 +549,7 @@ var no_array_index_key_default = createRule({
|
|
|
549
549
|
defaultOptions: []
|
|
550
550
|
});
|
|
551
551
|
function create8(context) {
|
|
552
|
-
const report =
|
|
552
|
+
const report = Report.make(context);
|
|
553
553
|
const indexParamNames = [];
|
|
554
554
|
function isArrayIndex(node) {
|
|
555
555
|
return node.type === AST_NODE_TYPES.Identifier && indexParamNames.some((name5) => name5 != null && name5 === node.name);
|
|
@@ -627,7 +627,7 @@ function create8(context) {
|
|
|
627
627
|
continue;
|
|
628
628
|
}
|
|
629
629
|
for (const descriptor of getReportDescriptors(prop.value)) {
|
|
630
|
-
report(descriptor);
|
|
630
|
+
report.send(descriptor);
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
},
|
|
@@ -645,7 +645,7 @@ function create8(context) {
|
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
647
|
for (const descriptor of getReportDescriptors(node.value.expression)) {
|
|
648
|
-
report(descriptor);
|
|
648
|
+
report.send(descriptor);
|
|
649
649
|
}
|
|
650
650
|
}
|
|
651
651
|
};
|
|
@@ -1685,7 +1685,7 @@ function create29(context) {
|
|
|
1685
1685
|
return match(variableDefNode).with({ init: P.select({ type: P.not(AST_NODE_TYPES.VariableDeclaration) }) }, getReportDescriptor).otherwise(() => _);
|
|
1686
1686
|
}).otherwise(() => _);
|
|
1687
1687
|
}
|
|
1688
|
-
const visitorFunction = flow(getReportDescriptor,
|
|
1688
|
+
const visitorFunction = flow(getReportDescriptor, Report.make(context).send);
|
|
1689
1689
|
return {
|
|
1690
1690
|
"JSXExpressionContainer > ConditionalExpression": visitorFunction,
|
|
1691
1691
|
"JSXExpressionContainer > LogicalExpression": visitorFunction
|
|
@@ -1820,7 +1820,7 @@ var no_missing_key_default = createRule({
|
|
|
1820
1820
|
defaultOptions: []
|
|
1821
1821
|
});
|
|
1822
1822
|
function create32(context) {
|
|
1823
|
-
const report =
|
|
1823
|
+
const report = Report.make(context);
|
|
1824
1824
|
const state = { isWithinChildrenToArray: false };
|
|
1825
1825
|
function checkIteratorElement(node) {
|
|
1826
1826
|
switch (node.type) {
|
|
@@ -1884,7 +1884,7 @@ function create32(context) {
|
|
|
1884
1884
|
const initialScope = context.sourceCode.getScope(node);
|
|
1885
1885
|
for (const element of elements) {
|
|
1886
1886
|
if (!JSX9.hasAttribute("key", element.openingElement.attributes, initialScope)) {
|
|
1887
|
-
report({
|
|
1887
|
+
report.send({
|
|
1888
1888
|
messageId: "missingKey",
|
|
1889
1889
|
node: element
|
|
1890
1890
|
});
|
|
@@ -1898,10 +1898,10 @@ function create32(context) {
|
|
|
1898
1898
|
if (!AST8.isFunction(callback)) return;
|
|
1899
1899
|
const body = callback.body;
|
|
1900
1900
|
if (body.type === AST_NODE_TYPES.BlockStatement) {
|
|
1901
|
-
checkBlockStatement(body).forEach(report);
|
|
1901
|
+
checkBlockStatement(body).forEach(report.send);
|
|
1902
1902
|
return;
|
|
1903
1903
|
}
|
|
1904
|
-
report(checkExpression(body));
|
|
1904
|
+
report.send(checkExpression(body));
|
|
1905
1905
|
},
|
|
1906
1906
|
"CallExpression:exit"(node) {
|
|
1907
1907
|
if (!ER22.isChildrenToArrayCall(context, node)) {
|
|
@@ -1914,7 +1914,7 @@ function create32(context) {
|
|
|
1914
1914
|
return;
|
|
1915
1915
|
}
|
|
1916
1916
|
if (node.parent.type === AST_NODE_TYPES.ArrayExpression) {
|
|
1917
|
-
report({
|
|
1917
|
+
report.send({
|
|
1918
1918
|
messageId: "unexpectedFragmentSyntax",
|
|
1919
1919
|
node
|
|
1920
1920
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.45.4-next.
|
|
3
|
+
"version": "1.45.4-next.2",
|
|
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",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"is-immutable-type": "^5.0.1",
|
|
51
51
|
"string-ts": "^2.2.1",
|
|
52
52
|
"ts-pattern": "^5.7.0",
|
|
53
|
-
"@eslint-react/ast": "1.45.4-next.
|
|
54
|
-
"@eslint-react/core": "1.45.4-next.
|
|
55
|
-
"@eslint-react/jsx": "1.45.4-next.
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/var": "1.45.4-next.
|
|
59
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.45.4-next.2",
|
|
54
|
+
"@eslint-react/core": "1.45.4-next.2",
|
|
55
|
+
"@eslint-react/jsx": "1.45.4-next.2",
|
|
56
|
+
"@eslint-react/shared": "1.45.4-next.2",
|
|
57
|
+
"@eslint-react/kit": "1.45.4-next.2",
|
|
58
|
+
"@eslint-react/var": "1.45.4-next.2",
|
|
59
|
+
"@eslint-react/eff": "1.45.4-next.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/react": "^19.1.1",
|