eslint-plugin-react-x 2.0.0-next.16 → 2.0.0-next.18
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 +8 -14
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -126,7 +126,7 @@ var settings3 = {
|
|
|
126
126
|
|
|
127
127
|
// package.json
|
|
128
128
|
var name4 = "eslint-plugin-react-x";
|
|
129
|
-
var version = "2.0.0-next.
|
|
129
|
+
var version = "2.0.0-next.18";
|
|
130
130
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
131
131
|
|
|
132
132
|
// src/rules/jsx-key-before-spread.ts
|
|
@@ -159,7 +159,10 @@ function create(context) {
|
|
|
159
159
|
firstSpreadAttributeIndex ??= index;
|
|
160
160
|
continue;
|
|
161
161
|
}
|
|
162
|
-
if (
|
|
162
|
+
if (firstSpreadAttributeIndex == null) {
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (attr.name.name === "key" && index > firstSpreadAttributeIndex) {
|
|
163
166
|
context.report({
|
|
164
167
|
messageId: "jsxKeyBeforeSpread",
|
|
165
168
|
node: attr
|
|
@@ -3065,9 +3068,6 @@ function getPreferredLoc(context, id) {
|
|
|
3065
3068
|
}
|
|
3066
3069
|
var RULE_NAME47 = "no-unsafe-component-will-mount";
|
|
3067
3070
|
var RULE_FEATURES47 = [];
|
|
3068
|
-
function isUnsafeComponentWillMount(node) {
|
|
3069
|
-
return AST7.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
3070
|
-
}
|
|
3071
3071
|
var no_unsafe_component_will_mount_default = createRule({
|
|
3072
3072
|
meta: {
|
|
3073
3073
|
type: "problem",
|
|
@@ -3094,7 +3094,7 @@ function create47(context) {
|
|
|
3094
3094
|
for (const { node: component } of components.values()) {
|
|
3095
3095
|
const { body } = component.body;
|
|
3096
3096
|
for (const member of body) {
|
|
3097
|
-
if (isUnsafeComponentWillMount(member)) {
|
|
3097
|
+
if (ER27.isUnsafeComponentWillMount(member)) {
|
|
3098
3098
|
context.report({
|
|
3099
3099
|
messageId: "noUnsafeComponentWillMount",
|
|
3100
3100
|
node: member
|
|
@@ -3107,9 +3107,6 @@ function create47(context) {
|
|
|
3107
3107
|
}
|
|
3108
3108
|
var RULE_NAME48 = "no-unsafe-component-will-receive-props";
|
|
3109
3109
|
var RULE_FEATURES48 = [];
|
|
3110
|
-
function isUnsafeComponentWillReceiveProps(node) {
|
|
3111
|
-
return AST7.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
3112
|
-
}
|
|
3113
3110
|
var no_unsafe_component_will_receive_props_default = createRule({
|
|
3114
3111
|
meta: {
|
|
3115
3112
|
type: "problem",
|
|
@@ -3138,7 +3135,7 @@ function create48(context) {
|
|
|
3138
3135
|
for (const { node: component } of components.values()) {
|
|
3139
3136
|
const { body } = component.body;
|
|
3140
3137
|
for (const member of body) {
|
|
3141
|
-
if (isUnsafeComponentWillReceiveProps(member)) {
|
|
3138
|
+
if (ER27.isUnsafeComponentWillReceiveProps(member)) {
|
|
3142
3139
|
context.report({
|
|
3143
3140
|
messageId: "noUnsafeComponentWillReceiveProps",
|
|
3144
3141
|
node: member
|
|
@@ -3151,9 +3148,6 @@ function create48(context) {
|
|
|
3151
3148
|
}
|
|
3152
3149
|
var RULE_NAME49 = "no-unsafe-component-will-update";
|
|
3153
3150
|
var RULE_FEATURES49 = [];
|
|
3154
|
-
function isUnsafeComponentWillUpdate(node) {
|
|
3155
|
-
return AST7.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
3156
|
-
}
|
|
3157
3151
|
var no_unsafe_component_will_update_default = createRule({
|
|
3158
3152
|
meta: {
|
|
3159
3153
|
type: "problem",
|
|
@@ -3180,7 +3174,7 @@ function create49(context) {
|
|
|
3180
3174
|
for (const { node: component } of components.values()) {
|
|
3181
3175
|
const { body } = component.body;
|
|
3182
3176
|
for (const member of body) {
|
|
3183
|
-
if (isUnsafeComponentWillUpdate(member)) {
|
|
3177
|
+
if (ER27.isUnsafeComponentWillUpdate(member)) {
|
|
3184
3178
|
context.report({
|
|
3185
3179
|
messageId: "noUnsafeComponentWillUpdate",
|
|
3186
3180
|
node: member
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.18",
|
|
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",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"is-immutable-type": "^5.0.1",
|
|
43
43
|
"string-ts": "^2.2.1",
|
|
44
44
|
"ts-pattern": "^5.7.0",
|
|
45
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
46
|
-
"@eslint-react/core": "2.0.0-next.
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
45
|
+
"@eslint-react/ast": "2.0.0-next.18",
|
|
46
|
+
"@eslint-react/core": "2.0.0-next.18",
|
|
47
|
+
"@eslint-react/eff": "2.0.0-next.18",
|
|
48
|
+
"@eslint-react/var": "2.0.0-next.18",
|
|
49
|
+
"@eslint-react/kit": "2.0.0-next.18",
|
|
50
|
+
"@eslint-react/shared": "2.0.0-next.18"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.1.3",
|