eslint-plugin-react-debug 1.41.0 → 1.41.1-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 +22 -21
- package/dist/index.mjs +21 -21
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
var shared = require('@eslint-react/shared');
|
|
4
4
|
var ER2 = require('@eslint-react/core');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
|
+
var JSX = require('@eslint-react/jsx');
|
|
6
7
|
var kit = require('@eslint-react/kit');
|
|
8
|
+
var types = require('@typescript-eslint/types');
|
|
7
9
|
var tsPattern = require('ts-pattern');
|
|
8
10
|
var typescript = require('typescript');
|
|
9
11
|
|
|
@@ -26,6 +28,7 @@ function _interopNamespace(e) {
|
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
var ER2__namespace = /*#__PURE__*/_interopNamespace(ER2);
|
|
31
|
+
var JSX__namespace = /*#__PURE__*/_interopNamespace(JSX);
|
|
29
32
|
|
|
30
33
|
var __defProp = Object.defineProperty;
|
|
31
34
|
var __export = (target, all) => {
|
|
@@ -54,7 +57,7 @@ var settings = {
|
|
|
54
57
|
|
|
55
58
|
// package.json
|
|
56
59
|
var name2 = "eslint-plugin-react-debug";
|
|
57
|
-
var version = "1.41.
|
|
60
|
+
var version = "1.41.1-beta.2";
|
|
58
61
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
|
|
59
62
|
|
|
60
63
|
// src/rules/class-component.ts
|
|
@@ -246,11 +249,11 @@ var jsx_default = createRule({
|
|
|
246
249
|
meta: {
|
|
247
250
|
type: "problem",
|
|
248
251
|
docs: {
|
|
249
|
-
description: "Reports all
|
|
252
|
+
description: "Reports all JSX elements and fragments.",
|
|
250
253
|
[Symbol.for("rule_features")]: RULE_FEATURES5
|
|
251
254
|
},
|
|
252
255
|
messages: {
|
|
253
|
-
jsx: "[jsx] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
|
|
256
|
+
jsx: "[jsx {{type}}] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
|
|
254
257
|
},
|
|
255
258
|
schema: []
|
|
256
259
|
},
|
|
@@ -265,28 +268,26 @@ function create5(context) {
|
|
|
265
268
|
...jsxConfigFromContext,
|
|
266
269
|
...jsxConfigFromAnnotation
|
|
267
270
|
};
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
function getReportDescriptor(node) {
|
|
272
|
+
return {
|
|
273
|
+
messageId: "jsx",
|
|
274
|
+
node,
|
|
275
|
+
data: {
|
|
276
|
+
type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => JSX__namespace.isFragmentElement(n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
|
|
277
|
+
jsx: tsPattern.match(jsxConfig.jsx).with(typescript.JsxEmit.None, () => "none").with(typescript.JsxEmit.ReactJSX, () => "react-jsx").with(typescript.JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(typescript.JsxEmit.React, () => "react").with(typescript.JsxEmit.ReactNative, () => "react-native").with(typescript.JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
|
|
278
|
+
jsxFactory: jsxConfig.jsxFactory,
|
|
279
|
+
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
280
|
+
jsxImportSource: jsxConfig.jsxImportSource,
|
|
281
|
+
jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
}
|
|
278
285
|
return {
|
|
279
286
|
JSXElement(node) {
|
|
280
|
-
context.report(
|
|
281
|
-
...baseDescriptor,
|
|
282
|
-
node
|
|
283
|
-
});
|
|
287
|
+
context.report(getReportDescriptor(node));
|
|
284
288
|
},
|
|
285
289
|
JSXFragment(node) {
|
|
286
|
-
context.report(
|
|
287
|
-
...baseDescriptor,
|
|
288
|
-
node
|
|
289
|
-
});
|
|
290
|
+
context.report(getReportDescriptor(node));
|
|
290
291
|
}
|
|
291
292
|
};
|
|
292
293
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as ER2 from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
4
|
+
import * as JSX from '@eslint-react/jsx';
|
|
4
5
|
import { JsxConfig } from '@eslint-react/kit';
|
|
6
|
+
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
|
|
5
7
|
import { match, P } from 'ts-pattern';
|
|
6
8
|
import { JsxEmit } from 'typescript';
|
|
7
9
|
|
|
@@ -32,7 +34,7 @@ var settings = {
|
|
|
32
34
|
|
|
33
35
|
// package.json
|
|
34
36
|
var name2 = "eslint-plugin-react-debug";
|
|
35
|
-
var version = "1.41.
|
|
37
|
+
var version = "1.41.1-beta.2";
|
|
36
38
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
|
|
37
39
|
|
|
38
40
|
// src/rules/class-component.ts
|
|
@@ -224,11 +226,11 @@ var jsx_default = createRule({
|
|
|
224
226
|
meta: {
|
|
225
227
|
type: "problem",
|
|
226
228
|
docs: {
|
|
227
|
-
description: "Reports all
|
|
229
|
+
description: "Reports all JSX elements and fragments.",
|
|
228
230
|
[Symbol.for("rule_features")]: RULE_FEATURES5
|
|
229
231
|
},
|
|
230
232
|
messages: {
|
|
231
|
-
jsx: "[jsx] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
|
|
233
|
+
jsx: "[jsx {{type}}] jsx: '{{jsx}}', jsxFactory: '{{jsxFactory}}', jsxFragmentFactory: '{{jsxFragmentFactory}}', jsxRuntime: '{{jsxRuntime}}' jsxImportSource: '{{jsxImportSource}}'"
|
|
232
234
|
},
|
|
233
235
|
schema: []
|
|
234
236
|
},
|
|
@@ -243,28 +245,26 @@ function create5(context) {
|
|
|
243
245
|
...jsxConfigFromContext,
|
|
244
246
|
...jsxConfigFromAnnotation
|
|
245
247
|
};
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
248
|
+
function getReportDescriptor(node) {
|
|
249
|
+
return {
|
|
250
|
+
messageId: "jsx",
|
|
251
|
+
node,
|
|
252
|
+
data: {
|
|
253
|
+
type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => JSX.isFragmentElement(n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
|
|
254
|
+
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"),
|
|
255
|
+
jsxFactory: jsxConfig.jsxFactory,
|
|
256
|
+
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
257
|
+
jsxImportSource: jsxConfig.jsxImportSource,
|
|
258
|
+
jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
}
|
|
256
262
|
return {
|
|
257
263
|
JSXElement(node) {
|
|
258
|
-
context.report(
|
|
259
|
-
...baseDescriptor,
|
|
260
|
-
node
|
|
261
|
-
});
|
|
264
|
+
context.report(getReportDescriptor(node));
|
|
262
265
|
},
|
|
263
266
|
JSXFragment(node) {
|
|
264
|
-
context.report(
|
|
265
|
-
...baseDescriptor,
|
|
266
|
-
node
|
|
267
|
-
});
|
|
267
|
+
context.report(getReportDescriptor(node));
|
|
268
268
|
}
|
|
269
269
|
};
|
|
270
270
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.1-beta.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"./package.json"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@typescript-eslint/scope-manager": "^8.29.
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.29.
|
|
48
|
-
"@typescript-eslint/types": "^8.29.
|
|
49
|
-
"@typescript-eslint/utils": "^8.29.
|
|
46
|
+
"@typescript-eslint/scope-manager": "^8.29.1",
|
|
47
|
+
"@typescript-eslint/type-utils": "^8.29.1",
|
|
48
|
+
"@typescript-eslint/types": "^8.29.1",
|
|
49
|
+
"@typescript-eslint/utils": "^8.29.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.7.0",
|
|
52
|
-
"@eslint-react/ast": "1.41.
|
|
53
|
-
"@eslint-react/core": "1.41.
|
|
54
|
-
"@eslint-react/jsx": "1.41.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/kit": "1.41.
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.41.1-beta.2",
|
|
53
|
+
"@eslint-react/core": "1.41.1-beta.2",
|
|
54
|
+
"@eslint-react/jsx": "1.41.1-beta.2",
|
|
55
|
+
"@eslint-react/shared": "1.41.1-beta.2",
|
|
56
|
+
"@eslint-react/var": "1.41.1-beta.2",
|
|
57
|
+
"@eslint-react/kit": "1.41.1-beta.2",
|
|
58
|
+
"@eslint-react/eff": "1.41.1-beta.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.0",
|