eslint-plugin-react-x 1.40.5-beta.1 → 1.40.5-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 +6 -18
- package/dist/index.mjs +7 -19
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -141,7 +141,7 @@ var settings3 = {
|
|
|
141
141
|
|
|
142
142
|
// package.json
|
|
143
143
|
var name4 = "eslint-plugin-react-x";
|
|
144
|
-
var version = "1.40.5-
|
|
144
|
+
var version = "1.40.5-next.0";
|
|
145
145
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
|
|
146
146
|
|
|
147
147
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -308,21 +308,17 @@ var jsx_uses_react_default = createRule({
|
|
|
308
308
|
defaultOptions: []
|
|
309
309
|
});
|
|
310
310
|
function create5(context) {
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
const
|
|
314
|
-
...jsxRuntimeOptionsFromContext,
|
|
315
|
-
...jsxRuntimeOptionsFromAnnotation
|
|
316
|
-
};
|
|
317
|
-
const { jsx, jsxFactory, jsxFragmentFactory } = jsxRuntimeOptions;
|
|
311
|
+
const jsxOptions = kit.JsxRuntime.getJsxRuntimeOptions(context);
|
|
312
|
+
const jsxAnnotation = kit.JsxRuntime.getJsxRuntimeAnnotation(context);
|
|
313
|
+
const jsx = jsxAnnotation.jsxRuntime === "classic" ? ts.JsxEmit.React : jsxOptions.jsx;
|
|
318
314
|
if (jsx === ts.JsxEmit.ReactJSX || jsx === ts.JsxEmit.ReactJSXDev) return {};
|
|
315
|
+
const jsxFactory = jsxAnnotation.jsx ?? jsxOptions.jsxFactory;
|
|
316
|
+
const jsxFragmentFactory = jsxAnnotation.jsxFrag ?? jsxOptions.jsxFragmentFactory;
|
|
319
317
|
function handleJsxElement(node) {
|
|
320
318
|
context.sourceCode.markVariableAsUsed(jsxFactory, node);
|
|
321
|
-
debugReport(context, node, jsxFactory);
|
|
322
319
|
}
|
|
323
320
|
function handleJsxFragment(node) {
|
|
324
321
|
context.sourceCode.markVariableAsUsed(jsxFragmentFactory, node);
|
|
325
|
-
debugReport(context, node, jsxFragmentFactory);
|
|
326
322
|
}
|
|
327
323
|
return {
|
|
328
324
|
JSXFragment: handleJsxFragment,
|
|
@@ -330,14 +326,6 @@ function create5(context) {
|
|
|
330
326
|
JSXOpeningFragment: handleJsxElement
|
|
331
327
|
};
|
|
332
328
|
}
|
|
333
|
-
function debugReport(context, node, name5) {
|
|
334
|
-
if (process.env["ESLINT_REACT_DEBUG"] !== "1") return;
|
|
335
|
-
context.report({
|
|
336
|
-
messageId: "jsxUsesReact",
|
|
337
|
-
node,
|
|
338
|
-
data: { name: name5 }
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
329
|
var RULE_NAME6 = "jsx-uses-vars";
|
|
342
330
|
var RULE_FEATURES6 = [];
|
|
343
331
|
var jsx_uses_vars_default = createRule({
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
|
5
5
|
import { _, flow, getOrUpdate, constTrue, constFalse } from '@eslint-react/eff';
|
|
6
6
|
import * as VAR2 from '@eslint-react/var';
|
|
7
7
|
import { match, isMatching, P } from 'ts-pattern';
|
|
8
|
-
import {
|
|
8
|
+
import { JsxRuntime, createReport } from '@eslint-react/kit';
|
|
9
9
|
import ts, { JsxEmit } from 'typescript';
|
|
10
10
|
import * as AST8 from '@eslint-react/ast';
|
|
11
11
|
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.40.5-
|
|
116
|
+
var version = "1.40.5-next.0";
|
|
117
117
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
|
|
118
118
|
|
|
119
119
|
// src/rules/avoid-shorthand-boolean.ts
|
|
@@ -280,21 +280,17 @@ var jsx_uses_react_default = createRule({
|
|
|
280
280
|
defaultOptions: []
|
|
281
281
|
});
|
|
282
282
|
function create5(context) {
|
|
283
|
-
const
|
|
284
|
-
const
|
|
285
|
-
const
|
|
286
|
-
...jsxRuntimeOptionsFromContext,
|
|
287
|
-
...jsxRuntimeOptionsFromAnnotation
|
|
288
|
-
};
|
|
289
|
-
const { jsx, jsxFactory, jsxFragmentFactory } = jsxRuntimeOptions;
|
|
283
|
+
const jsxOptions = JsxRuntime.getJsxRuntimeOptions(context);
|
|
284
|
+
const jsxAnnotation = JsxRuntime.getJsxRuntimeAnnotation(context);
|
|
285
|
+
const jsx = jsxAnnotation.jsxRuntime === "classic" ? JsxEmit.React : jsxOptions.jsx;
|
|
290
286
|
if (jsx === JsxEmit.ReactJSX || jsx === JsxEmit.ReactJSXDev) return {};
|
|
287
|
+
const jsxFactory = jsxAnnotation.jsx ?? jsxOptions.jsxFactory;
|
|
288
|
+
const jsxFragmentFactory = jsxAnnotation.jsxFrag ?? jsxOptions.jsxFragmentFactory;
|
|
291
289
|
function handleJsxElement(node) {
|
|
292
290
|
context.sourceCode.markVariableAsUsed(jsxFactory, node);
|
|
293
|
-
debugReport(context, node, jsxFactory);
|
|
294
291
|
}
|
|
295
292
|
function handleJsxFragment(node) {
|
|
296
293
|
context.sourceCode.markVariableAsUsed(jsxFragmentFactory, node);
|
|
297
|
-
debugReport(context, node, jsxFragmentFactory);
|
|
298
294
|
}
|
|
299
295
|
return {
|
|
300
296
|
JSXFragment: handleJsxFragment,
|
|
@@ -302,14 +298,6 @@ function create5(context) {
|
|
|
302
298
|
JSXOpeningFragment: handleJsxElement
|
|
303
299
|
};
|
|
304
300
|
}
|
|
305
|
-
function debugReport(context, node, name5) {
|
|
306
|
-
if (process.env["ESLINT_REACT_DEBUG"] !== "1") return;
|
|
307
|
-
context.report({
|
|
308
|
-
messageId: "jsxUsesReact",
|
|
309
|
-
node,
|
|
310
|
-
data: { name: name5 }
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
301
|
var RULE_NAME6 = "jsx-uses-vars";
|
|
314
302
|
var RULE_FEATURES6 = [];
|
|
315
303
|
var jsx_uses_vars_default = createRule({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "1.40.5-
|
|
3
|
+
"version": "1.40.5-next.0",
|
|
4
4
|
"description": "A set of composable linting rules 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.40.5-
|
|
54
|
-
"@eslint-react/core": "1.40.5-
|
|
55
|
-
"@eslint-react/eff": "1.40.5-
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/var": "1.40.5-
|
|
59
|
-
"@eslint-react/
|
|
53
|
+
"@eslint-react/ast": "1.40.5-next.0",
|
|
54
|
+
"@eslint-react/core": "1.40.5-next.0",
|
|
55
|
+
"@eslint-react/eff": "1.40.5-next.0",
|
|
56
|
+
"@eslint-react/jsx": "1.40.5-next.0",
|
|
57
|
+
"@eslint-react/kit": "1.40.5-next.0",
|
|
58
|
+
"@eslint-react/var": "1.40.5-next.0",
|
|
59
|
+
"@eslint-react/shared": "1.40.5-next.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/react": "^19.1.0",
|