eslint-plugin-react-debug 2.0.0-next.178 → 2.0.0-next.179
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 +12 -11
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS, getConfigAdapters, getDocsUrl, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
2
|
import * as ER from "@eslint-react/core";
|
|
3
|
+
import { JsxEmit, getElementType, getJsxConfigFromAnnotation, getJsxConfigFromContext, isFragmentElement } from "@eslint-react/core";
|
|
3
4
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
4
5
|
import { flow } from "@eslint-react/eff";
|
|
5
|
-
import {
|
|
6
|
+
import { report } from "@eslint-react/kit";
|
|
6
7
|
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from "@typescript-eslint/types";
|
|
7
8
|
import { P, match } from "ts-pattern";
|
|
8
9
|
|
|
9
10
|
//#region rolldown:runtime
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
|
-
var __export = (
|
|
12
|
+
var __export = (all) => {
|
|
13
|
+
let target = {};
|
|
12
14
|
for (var name$2 in all) __defProp(target, name$2, {
|
|
13
15
|
get: all[name$2],
|
|
14
16
|
enumerable: true
|
|
15
17
|
});
|
|
18
|
+
return target;
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
//#endregion
|
|
19
22
|
//#region src/configs/all.ts
|
|
20
|
-
var all_exports = {
|
|
21
|
-
__export(all_exports, {
|
|
23
|
+
var all_exports = __export({
|
|
22
24
|
name: () => name$1,
|
|
23
25
|
rules: () => rules,
|
|
24
26
|
settings: () => settings
|
|
@@ -36,7 +38,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
36
38
|
//#endregion
|
|
37
39
|
//#region package.json
|
|
38
40
|
var name = "eslint-plugin-react-debug";
|
|
39
|
-
var version = "2.0.0-next.
|
|
41
|
+
var version = "2.0.0-next.179";
|
|
40
42
|
|
|
41
43
|
//#endregion
|
|
42
44
|
//#region src/utils/create-rule.ts
|
|
@@ -217,7 +219,6 @@ function isFromReact(node, importSource, initialScope) {
|
|
|
217
219
|
|
|
218
220
|
//#endregion
|
|
219
221
|
//#region src/rules/jsx.ts
|
|
220
|
-
const { JsxEmit } = JsxConfig;
|
|
221
222
|
const RULE_NAME = "jsx";
|
|
222
223
|
const RULE_FEATURES = ["DBG"];
|
|
223
224
|
var jsx_default = createRule({
|
|
@@ -235,8 +236,8 @@ var jsx_default = createRule({
|
|
|
235
236
|
defaultOptions: []
|
|
236
237
|
});
|
|
237
238
|
function create(context) {
|
|
238
|
-
const jsxConfigFromContext =
|
|
239
|
-
const jsxConfigFromAnnotation =
|
|
239
|
+
const jsxConfigFromContext = getJsxConfigFromContext(context);
|
|
240
|
+
const jsxConfigFromAnnotation = getJsxConfigFromAnnotation(context);
|
|
240
241
|
const jsxConfig = {
|
|
241
242
|
...jsxConfigFromContext,
|
|
242
243
|
...jsxConfigFromAnnotation
|
|
@@ -246,8 +247,8 @@ function create(context) {
|
|
|
246
247
|
messageId: "jsx",
|
|
247
248
|
node,
|
|
248
249
|
data: { json: stringify({
|
|
249
|
-
kind: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) =>
|
|
250
|
-
type:
|
|
250
|
+
kind: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => isFragmentElement(context$1, n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
|
|
251
|
+
type: getElementType(context$1, node),
|
|
251
252
|
jsx: match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
|
|
252
253
|
jsxFactory: jsxConfig.jsxFactory,
|
|
253
254
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
@@ -256,7 +257,7 @@ function create(context) {
|
|
|
256
257
|
}) }
|
|
257
258
|
});
|
|
258
259
|
}
|
|
259
|
-
return { "JSXElement, JSXFragment": flow(getReportDescriptor(context),
|
|
260
|
+
return { "JSXElement, JSXFragment": flow(getReportDescriptor(context), report(context)) };
|
|
260
261
|
}
|
|
261
262
|
|
|
262
263
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.179",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"@typescript-eslint/utils": "^8.43.0",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
43
|
"ts-pattern": "^5.8.0",
|
|
44
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
44
|
+
"@eslint-react/ast": "2.0.0-next.179",
|
|
45
|
+
"@eslint-react/core": "2.0.0-next.179",
|
|
46
|
+
"@eslint-react/eff": "2.0.0-next.179",
|
|
47
|
+
"@eslint-react/kit": "2.0.0-next.179",
|
|
48
|
+
"@eslint-react/shared": "2.0.0-next.179",
|
|
49
|
+
"@eslint-react/var": "2.0.0-next.179"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/react": "^19.1.12",
|