eslint-plugin-react-x 1.43.1-next.0 → 1.43.2-beta.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 +15 -8
- package/dist/index.mjs +15 -8
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var shared = require('@eslint-react/shared');
|
|
4
4
|
var JSX8 = require('@eslint-react/jsx');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
|
+
var kit = require('@eslint-react/kit');
|
|
6
7
|
var types = require('@typescript-eslint/types');
|
|
7
8
|
var VAR2 = require('@eslint-react/var');
|
|
8
9
|
var tsPattern = require('ts-pattern');
|
|
9
|
-
var kit = require('@eslint-react/kit');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var AST8 = require('@eslint-react/ast');
|
|
12
12
|
var ER21 = require('@eslint-react/core');
|
|
@@ -141,7 +141,7 @@ var settings3 = {
|
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
143
|
var name4 = "eslint-plugin-react-x";
|
|
144
|
-
var version = "1.43.
|
|
144
|
+
var version = "1.43.2-beta.2";
|
|
145
145
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
146
146
|
|
|
147
147
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -180,8 +180,6 @@ function create(context) {
|
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
// src/rules/avoid-shorthand-fragment.ts
|
|
185
183
|
var RULE_NAME2 = "avoid-shorthand-fragment";
|
|
186
184
|
var RULE_FEATURES2 = [];
|
|
187
185
|
var avoid_shorthand_fragment_default = createRule({
|
|
@@ -192,7 +190,7 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
192
190
|
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
193
191
|
},
|
|
194
192
|
messages: {
|
|
195
|
-
avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use '
|
|
193
|
+
avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use '{{jsxFragmentFactory}}' component instead."
|
|
196
194
|
},
|
|
197
195
|
schema: []
|
|
198
196
|
},
|
|
@@ -201,11 +199,20 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
201
199
|
defaultOptions: []
|
|
202
200
|
});
|
|
203
201
|
function create2(context) {
|
|
202
|
+
const jsxConfigFromContext = kit.JsxConfig.getFromContext(context);
|
|
203
|
+
const jsxConfigFromAnnotation = kit.JsxConfig.getFromAnnotation(context);
|
|
204
|
+
const jsxConfig = {
|
|
205
|
+
...jsxConfigFromContext,
|
|
206
|
+
...jsxConfigFromAnnotation
|
|
207
|
+
};
|
|
204
208
|
return {
|
|
205
209
|
JSXFragment(node) {
|
|
206
210
|
context.report({
|
|
207
211
|
messageId: "avoidShorthandFragment",
|
|
208
|
-
node
|
|
212
|
+
node,
|
|
213
|
+
data: {
|
|
214
|
+
jsxFragmentFactory: jsxConfig.jsxFragmentFactory
|
|
215
|
+
}
|
|
209
216
|
});
|
|
210
217
|
}
|
|
211
218
|
};
|
|
@@ -857,11 +864,11 @@ var no_class_component_default = createRule({
|
|
|
857
864
|
meta: {
|
|
858
865
|
type: "problem",
|
|
859
866
|
docs: {
|
|
860
|
-
description: "Disallow class components.",
|
|
867
|
+
description: "Disallow class components except for error boundaries.",
|
|
861
868
|
[Symbol.for("rule_features")]: RULE_FEATURES15
|
|
862
869
|
},
|
|
863
870
|
messages: {
|
|
864
|
-
noClassComponent: "
|
|
871
|
+
noClassComponent: "Avoid using class components. Use function components instead."
|
|
865
872
|
},
|
|
866
873
|
schema: []
|
|
867
874
|
},
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, unsafeDecodeSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as JSX8 from '@eslint-react/jsx';
|
|
3
3
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
4
|
+
import { JsxConfig, createReport, SEL } from '@eslint-react/kit';
|
|
4
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
5
6
|
import * as VAR2 from '@eslint-react/var';
|
|
6
7
|
import { match, isMatching, P } from 'ts-pattern';
|
|
7
|
-
import { JsxConfig, createReport, SEL } from '@eslint-react/kit';
|
|
8
8
|
import ts, { JsxEmit } from 'typescript';
|
|
9
9
|
import * as AST8 from '@eslint-react/ast';
|
|
10
10
|
import * as ER21 from '@eslint-react/core';
|
|
@@ -113,7 +113,7 @@ var settings3 = {
|
|
|
113
113
|
|
|
114
114
|
// package.json
|
|
115
115
|
var name4 = "eslint-plugin-react-x";
|
|
116
|
-
var version = "1.43.
|
|
116
|
+
var version = "1.43.2-beta.2";
|
|
117
117
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
118
118
|
|
|
119
119
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -152,8 +152,6 @@ function create(context) {
|
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
|
-
|
|
156
|
-
// src/rules/avoid-shorthand-fragment.ts
|
|
157
155
|
var RULE_NAME2 = "avoid-shorthand-fragment";
|
|
158
156
|
var RULE_FEATURES2 = [];
|
|
159
157
|
var avoid_shorthand_fragment_default = createRule({
|
|
@@ -164,7 +162,7 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
164
162
|
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
165
163
|
},
|
|
166
164
|
messages: {
|
|
167
|
-
avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use '
|
|
165
|
+
avoidShorthandFragment: "Avoid using shorthand fragment syntax. Use '{{jsxFragmentFactory}}' component instead."
|
|
168
166
|
},
|
|
169
167
|
schema: []
|
|
170
168
|
},
|
|
@@ -173,11 +171,20 @@ var avoid_shorthand_fragment_default = createRule({
|
|
|
173
171
|
defaultOptions: []
|
|
174
172
|
});
|
|
175
173
|
function create2(context) {
|
|
174
|
+
const jsxConfigFromContext = JsxConfig.getFromContext(context);
|
|
175
|
+
const jsxConfigFromAnnotation = JsxConfig.getFromAnnotation(context);
|
|
176
|
+
const jsxConfig = {
|
|
177
|
+
...jsxConfigFromContext,
|
|
178
|
+
...jsxConfigFromAnnotation
|
|
179
|
+
};
|
|
176
180
|
return {
|
|
177
181
|
JSXFragment(node) {
|
|
178
182
|
context.report({
|
|
179
183
|
messageId: "avoidShorthandFragment",
|
|
180
|
-
node
|
|
184
|
+
node,
|
|
185
|
+
data: {
|
|
186
|
+
jsxFragmentFactory: jsxConfig.jsxFragmentFactory
|
|
187
|
+
}
|
|
181
188
|
});
|
|
182
189
|
}
|
|
183
190
|
};
|
|
@@ -829,11 +836,11 @@ var no_class_component_default = createRule({
|
|
|
829
836
|
meta: {
|
|
830
837
|
type: "problem",
|
|
831
838
|
docs: {
|
|
832
|
-
description: "Disallow class components.",
|
|
839
|
+
description: "Disallow class components except for error boundaries.",
|
|
833
840
|
[Symbol.for("rule_features")]: RULE_FEATURES15
|
|
834
841
|
},
|
|
835
842
|
messages: {
|
|
836
|
-
noClassComponent: "
|
|
843
|
+
noClassComponent: "Avoid using class components. Use function components instead."
|
|
837
844
|
},
|
|
838
845
|
schema: []
|
|
839
846
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.2-beta.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/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/eff": "1.43.
|
|
56
|
-
"@eslint-react/kit": "1.43.
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
59
|
-
"@eslint-react/jsx": "1.43.
|
|
53
|
+
"@eslint-react/core": "1.43.2-beta.2",
|
|
54
|
+
"@eslint-react/ast": "1.43.2-beta.2",
|
|
55
|
+
"@eslint-react/eff": "1.43.2-beta.2",
|
|
56
|
+
"@eslint-react/kit": "1.43.2-beta.2",
|
|
57
|
+
"@eslint-react/var": "1.43.2-beta.2",
|
|
58
|
+
"@eslint-react/shared": "1.43.2-beta.2",
|
|
59
|
+
"@eslint-react/jsx": "1.43.2-beta.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/react": "^19.1.0",
|