eslint-plugin-react-jsx 5.30.0-beta.9 → 5.30.0-rc.1

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -6
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var __exportAll = (all, no_symbols) => {
19
19
  };
20
20
  // package.json
21
21
  var name$2 = "eslint-plugin-react-jsx";
22
- var version = "5.30.0-beta.9";
22
+ var version = "5.30.0-rc.1";
23
23
  // src/utils/create-rule.ts
24
24
  function getDocsUrl(ruleName) {
25
25
  return `https://eslint-react.xyz/docs/rules/jsx-${ruleName}`;
@@ -113,8 +113,9 @@ function create$6(context) {
113
113
  JSXElement(node) {
114
114
  const prop = findAttribute(node, "children");
115
115
  if (prop == null || hasMeaningfulChildren(node)) return;
116
+ const hasFollowingSpread = node.openingElement.attributes.some((a) => a.type === AST_NODE_TYPES.JSXSpreadAttribute && a.range[0] > prop.range[0]);
116
117
  const childrenText = getChildrenText(context, prop);
117
- if (childrenText == null) {
118
+ if (childrenText == null || hasFollowingSpread) {
118
119
  context.report({
119
120
  messageId: "default",
120
121
  node: prop
@@ -368,7 +369,11 @@ var no_leaked_semicolon_default = createRule({
368
369
  function create$2(context) {
369
370
  return { JSXText(node) {
370
371
  if (!Check.isJSXElementOrFragment(node.parent)) return;
371
- if (!/^;+[ \t]*(?:\r\n|\r|\n)/u.test(getText(context, node))) return;
372
+ const text = getText(context, node);
373
+ const children = node.parent.children;
374
+ const previous = children.at(-2);
375
+ const isSameLineLeak = children.at(-1) === node && previous != null && Check.isJSXElementOrFragment(previous) && /^;+[ \t]*$/u.test(text);
376
+ if (!/^;+[ \t]*(?:\r\n|\r|\n)/u.test(text) && !isSameLineLeak) return;
372
377
  context.report({
373
378
  messageId: "default",
374
379
  node,
@@ -428,9 +433,9 @@ var no_useless_fragment_default = createRule({
428
433
  create
429
434
  });
430
435
  function create(context) {
431
- const options = { ...context.options[0] ?? {} };
432
- const allowEmptyFragment = options.allowEmptyFragment ??= false;
433
- const allowExpressions = options.allowExpressions ??= true;
436
+ const options = context.options[0] ?? {};
437
+ const allowEmptyFragment = options.allowEmptyFragment ?? false;
438
+ const allowExpressions = options.allowExpressions ?? true;
434
439
  const { jsxFragmentFactory } = core.getJSXConfig(context);
435
440
  return {
436
441
  JSXElement(node) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-jsx",
3
- "version": "5.30.0-beta.9",
3
+ "version": "5.30.0-rc.1",
4
4
  "description": "ESLint React's ESLint plugin for React Flavored JSX rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,11 +37,11 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@eslint-react/ast": "5.30.0-beta.9",
41
- "@eslint-react/core": "5.30.0-beta.9",
42
- "@eslint-react/eslint": "5.30.0-beta.9",
43
- "@eslint-react/jsx": "5.30.0-beta.9",
44
- "@eslint-react/shared": "5.30.0-beta.9",
40
+ "@eslint-react/ast": "5.30.0-rc.1",
41
+ "@eslint-react/core": "5.30.0-rc.1",
42
+ "@eslint-react/eslint": "5.30.0-rc.1",
43
+ "@eslint-react/jsx": "5.30.0-rc.1",
44
+ "@eslint-react/shared": "5.30.0-rc.1",
45
45
  "@typescript-eslint/types": "^8.72.1",
46
46
  "@typescript-eslint/utils": "^8.72.1"
47
47
  },
@@ -54,8 +54,8 @@
54
54
  "@types/react": "^19.3.0",
55
55
  "@types/react-dom": "^19.3.0",
56
56
  "dedent": "^1.7.2",
57
- "eslint": "^10.13.0",
58
- "tsdown": "^0.23.2",
57
+ "eslint": "^10.14.0",
58
+ "tsdown": "^0.23.5",
59
59
  "typescript": "6.0.3"
60
60
  },
61
61
  "peerDependencies": {