Skip to content

Conversation

@upupming
Copy link
Collaborator

@upupming upupming commented Jul 11, 2025

Summary

Support ESLint for ReactLynx.

As eslint-plugin-react-hooks is the prerequisite eslint rule for React Compiler, we need to support eslint for ReactLynx before landing React Compiler.

Related PR: #1269

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Summary by CodeRabbit

  • New Features

    • Added ESLint support for ReactLynx templates, including integration with React Hooks and React Refresh linting rules.
    • Enabled linting for example TypeScript and TSX files.
    • Implemented ESLint template mapping for React JavaScript and TypeScript projects.
  • Bug Fixes

    • Updated callback prop from onMounted to onRender in relevant components and tests for improved consistency.
  • Style

    • Refined JSX syntax by converting empty elements to self-closing tags.
  • Chores

    • Updated test workflows to include ESLint checks.
    • Added new ESLint plugins to development dependencies.
    • Added a changeset documenting ESLint support.

@upupming upupming requested a review from colinaaa as a code owner July 11, 2025 09:57
@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2025

🦋 Changeset detected

Latest commit: 93de49f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
create-rspeedy Patch
@lynx-js/rspeedy Patch
upgrade-rspeedy Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 11, 2025

📝 Walkthrough

Walkthrough

This update introduces ESLint support for ReactLynx templates, modifies ESLint configuration and dependencies, adjusts test and template files for consistency, and improves the handling of ESLint templates within the project generator. Several JSX files are refactored for syntax clarity, and callback prop names are updated for consistency across components and their tests.

Changes

Cohort / File(s) Change Summary
ESLint Configuration & Tooling
eslint.config.js, package.json
Added React-specific ESLint plugins and configuration blocks, removed ignore for examples/**, and updated devDependencies for ESLint plugins.
Project Generator Logic
packages/rspeedy/create-rspeedy/src/index.ts
Implemented and updated the mapESLintTemplate function to map template names to ESLint folders based on language detection.
GitHub Actions CI Linting
.github/workflows/test.yml
Updated workflow to include ESLint tooling in test projects and added linting steps after project creation.
Template JSX Syntax Updates
packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx, .../template-react-ts/src/App.tsx
Changed empty <view> elements to self-closing tags for JSX syntax consistency.
Template Callback Logic & Syntax
.../template-react-vitest-rltl-js/src/App.jsx, .../template-react-vitest-rltl-ts/src/App.tsx, .../template-react-vitest-rltl-ts/src/__tests__/index.test.tsx
Changed callback prop from onMounted to onRender, moved callback invocation from useEffect to render phase, and updated corresponding tests. Also refactored JSX <view> to self-closing tags.
TypeScript Lint Directive
.../template-common/src/rspeedy-env.d.ts
Added an ESLint disable comment for an empty object type rule above the GlobalProps interface declaration.
Changeset Metadata
.changeset/floppy-singers-chew.md
Added a changeset file documenting the patch update for ESLint support in ReactLynx templates.
Example Project Config & Imports
examples/react/lynx.config.js, examples/react/test/jsx-runtime.test-d.tsx, examples/react/tsconfig.json, examples/tailwindcss/lynx.config.js, examples/tailwindcss/src/App.tsx, examples/tailwindcss/src/index.tsx, examples/tailwindcss/src/utils.ts, examples/tailwindcss/test/App.test-d.ts, examples/tailwindcss/tsconfig.json
Minor import reorderings, blank line additions, import splitting, module-level handler addition in tests, and expansion of included files in tsconfig.json for examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Suggested reviewers

  • colinaaa

Poem

In the warren of code, we lint and we hop,
ESLint now checks where the React bunnies stop.
With plugins and configs, the carrots align,
Templates refactored, all code looking fine.
Our tests and our views, in harmony dwell—
A patch well delivered, all’s hopping quite well! 🥕🐇

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 20d001b and 93de49f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (5)
packages/eslint-config-reactlynx/src/index.ts (1)

18-20: Address the TODO comment about parser usage.

The TODO comment suggests that the custom Babel parser may no longer be necessary for modern JavaScript usage. Consider evaluating whether the default ESLint parser can be used instead.

Would you like me to help analyze the codebase to determine if class property initializers are still being used, or help create a plan to migrate away from the custom parser?

packages/eslint-config-reactlynx/tsconfig.json (1)

3-8: composite without declaration may block downstream Type Script consumers

With composite: true enabled, TypeScript expects the project to emit declaration files.
Consider also enabling declaration (and optionally declarationMap) so that consumers of @lynx-js/eslint-config-reactlynx can benefit from proper types.

     "rootDir": "./src",
     "composite": true,
+    "declaration": true,
+    "declarationMap": true,
packages/eslint-config-reactlynx/README.md (1)

9-11: Add a language specifier to silence markdown-lint

Specify the shell language for the install snippet to satisfy MD040.

-```
+```bash
 npm i -D eslint @lynx-js/eslint-config-reactlynx

</blockquote></details>
<details>
<summary>packages/rspeedy/create-rspeedy/template-eslint/js/package.json (1)</summary><blockquote>

`5-10`: **Put `eslint` under `devDependencies` (and mark the template package as private).**

A linter is a development-time tool and should not ship with the production dependency graph.  
Moving it keeps the runtime install set minimal and prevents accidental version skew when consumers install this template.

```diff
   "dependencies": {
-    "eslint": "^9.30.0"
+  },
+  "devDependencies": {
+    "eslint": "^9.30.0",
+    "@lynx-js/eslint-config-reactlynx": "workspace:*"
   },
-  "devDependencies": {
-    "@lynx-js/eslint-config-reactlynx": "workspace:*"
-  }
+  "private": true
packages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1)

5-10: Same dependency split as the JS template.

For consistency and lean installs, move eslint to devDependencies and mark the template as private.

   "dependencies": {
-    "eslint": "^9.30.0"
-  },
-  "devDependencies": {
-    "@lynx-js/eslint-config-reactlynx": "workspace:*"
-  }
+  },
+  "devDependencies": {
+    "eslint": "^9.30.0",
+    "@lynx-js/eslint-config-reactlynx": "workspace:*"
+  },
+  "private": true
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b75469 and 63bcbee.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • examples/react/eslint.config.js (1 hunks)
  • examples/react/package.json (1 hunks)
  • examples/react/src/App.tsx (1 hunks)
  • examples/react/tsconfig.json (1 hunks)
  • packages/eslint-config-reactlynx/LICENSE (1 hunks)
  • packages/eslint-config-reactlynx/README.md (1 hunks)
  • packages/eslint-config-reactlynx/package.json (1 hunks)
  • packages/eslint-config-reactlynx/src/index.ts (1 hunks)
  • packages/eslint-config-reactlynx/src/ts.ts (1 hunks)
  • packages/eslint-config-reactlynx/tsconfig.json (1 hunks)
  • packages/rspeedy/create-rspeedy/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/src/index.ts (2 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/js/eslint.config.js (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/js/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/ts/eslint.config.js (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1 hunks)
  • patches/create-rstack.patch (1 hunks)
  • pnpm-workspace.yaml (2 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
packages/eslint-config-reactlynx/README.md

9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🪛 GitHub Check: code-style-check
packages/eslint-config-reactlynx/src/ts.ts

[failure] 14-14:
Type 'LanguageOptions | { parser: typeof import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@typescript-eslint+parser@8.36.0_eslint@9.30.0_jiti@2.4.2__typescript@5.8.3/node_modules/@typescript-eslint/parser/dist/index"); parserOptions: { ...; }; } | undefined' is not assignable to type 'LanguageOptions | undefined'.


[failure] 12-12:
Type 'Config' is not assignable to type 'InfiniteArray'.


[failure] 11-11:
Type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.RulesRecord>[]' is not assignable to type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.RulesRecord>[]'.

packages/eslint-config-reactlynx/src/index.ts

[failure] 50-50:
Type 'typeof import("/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint-plugin-react-hooks@5.2.0_eslint@9.30.0_jiti@2.4.2/node_modules/eslint-plugin-react-hooks/index")' is not assignable to type 'Plugin'.


[failure] 49-49:
Type '{ deprecatedRules: Partial<{ 'boolean-prop-naming': RuleModule; 'button-has-type': RuleModule; 'checked-requires-onchange-or-readonly': RuleModule; 'default-props-match-prop-types': RuleModule; ... 98 more ...; 'void-dom-elements-no-children': RuleModule; }>; rules: { ...; }; configs: { ...; } & { ...; }; }' is not assignable to type 'Plugin'.


[failure] 48-48:
Type '{ config: { "flat/recommended": FlatConfig; recommended: Config; }; meta: { name: string; version: string; }; configs: { ...; }; rules: { ...; }; }' is not assignable to type 'Plugin'.


[failure] 14-14:
Type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.RulesRecord>[]' is not assignable to type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.RulesRecord>[]'.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: CodeQL Analyze (actions)
  • GitHub Check: CodeQL Analyze (javascript-typescript)
  • GitHub Check: zizmor
🔇 Additional comments (16)
tsconfig.json (1)

127-130: LGTM! Correct TypeScript project reference integration.

The new project reference correctly integrates the @lynx-js/eslint-config-reactlynx package into the TypeScript composite build system, following the existing pattern used by other packages in the monorepo.

packages/eslint-config-reactlynx/src/index.ts (2)

64-154: Comprehensive ESLint rule configuration looks good.

The ESLint rules are well-organized and cover appropriate areas:

  • React and JSX best practices
  • React hooks rules (essential for React Compiler compatibility)
  • General JavaScript error prevention
  • Stylistic preferences

The rule selections are appropriate for a React/Preact project and align with the PR objective of enabling eslint-plugin-react-hooks for React Compiler support.


47-51: Fix plugin type assignments.

The static analysis indicates that the plugin objects don't match the expected Plugin type. This is likely due to version mismatches or incorrect plugin imports.

Consider updating the plugin assignments to match the expected ESLint plugin interface:

    plugins: {
-      compat,
-      react,
-      'react-hooks': reactHooks,
+      compat: compat,
+      react: react,
+      'react-hooks': reactHooks,
    },

Alternatively, verify that the plugin imports are correct for the ESLint version being used.

Likely an incorrect or invalid review comment.

packages/rspeedy/create-rspeedy/package.json (1)

41-41: LGTM! Correct workspace dependency addition.

The addition of @lynx-js/eslint-config-reactlynx as a devDependency with the workspace:* version specifier is appropriate for integrating the new ESLint configuration package into the create-rspeedy tooling.

examples/react/src/App.tsx (1)

48-48: LGTM! Good JSX syntax optimization.

Converting the empty <view> element to a self-closing tag is a good practice that improves code conciseness while maintaining the same functionality.

examples/react/tsconfig.json (1)

12-12: LGTM! Correct inclusion of ESLint configuration file.

Adding "eslint.config.js" to the include array ensures that TypeScript tooling can properly process the ESLint configuration file, which is necessary for the new ESLint setup.

packages/eslint-config-reactlynx/LICENSE (1)

3-4: Confirm dual copyright attribution

Just double-check with legal that referencing both the “Preact Authors” and “Lynx Authors” is intended and that the upstream license permits this style of attribution.

examples/react/eslint.config.js (1)

1-9: No changes needed for ESM import in eslint.config.js

The examples/react/package.json already specifies "type": "module", so using import in eslint.config.js is valid in this context. No further action is required.

examples/react/package.json (1)

9-17: eslint missing – the lint script will fail without it.

The example adds a lint script but doesn’t list eslint as a (dev) dependency.
Unless it’s guaranteed to be hoisted from the workspace root, running pnpm run lint inside this package will error.

   "devDependencies": {
+    "eslint": "^9.30.0",
     "@lynx-js/eslint-config-reactlynx": "workspace:*",

If the root already provides ESLint, add a comment explaining the intentional omission.

packages/rspeedy/create-rspeedy/template-eslint/ts/eslint.config.js (1)

1-9: LGTM – template correctly layers project-specific globs over the shared config.

packages/rspeedy/create-rspeedy/src/index.ts (2)

11-17: LGTM!

The expanded import statement correctly includes the copyFolder function needed for the ESLint template copying functionality.


110-133: Implementation looks correct with proper template matching logic.

The mapESLintTemplate implementation correctly:

  • Finds the language by matching the template name against the TEMPLATES array
  • Constructs the appropriate ESLint template folder path
  • Uses copyFolder with proper parameters including merge settings

The logic handles the case where no matching template is found by returning null, which aligns with the expected interface.

pnpm-workspace.yaml (2)

4-4: LGTM!

Correctly adds the new @lynx-js/eslint-config-reactlynx package to the workspace configuration.


51-51: LGTM!

The create-rstack patch addition aligns with the provided patch file that extends the mapESLintTemplate function signature.

patches/create-rstack.patch (1)

1-35: LGTM!

The patch correctly extends the mapESLintTemplate function signature to provide additional context (distFolder, version, skipFiles) to the callback. This enhancement enables the template copying functionality implemented in the create-rspeedy package.

The changes are properly applied to both the TypeScript declaration and the implementation.

packages/eslint-config-reactlynx/package.json (1)

1-53: Dependencies Verified: No Security Issues and Up-to-Date

  • eslint-plugin-react-hooks@5.2.0 and eslint-plugin-react@7.37.5 have no known advisories.
  • Both are pinned to the latest published versions and align with the package.json ranges.

The ESLint configuration package.json is correctly structured and ready to merge.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
packages/eslint-config-reactlynx/src/ts.ts (1)

13-13: The past review comment about type issues is outdated.

The current implementation correctly uses tseslint.config() with proper typing (tseslint.ConfigArray). The previous concerns about defineConfig() are no longer applicable.

🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

152-157: Avoid unintentional nesting of the second sample project

At this point the script is still inside create-rspeedy-regression/.
Running the second npx create-rspeedy-canary … --dir create-rspeedy-regression-vitest-rltl will therefore create & install the Vitest template inside the first sample’s folder, mixing two independent projects and their lock-files.

A quick fix:

         pnpm run lint
+        cd ..
         npx --registry http://localhost:4873 create-rspeedy-canary@latest --template react-vitest-rltl --dir create-rspeedy-regression-vitest-rltl --tools eslint
-        cd create-rspeedy-regression-vitest-rltl
+        cd create-rspeedy-regression-vitest-rltl

(or pushd/popd instead of manual cd juggling).

This keeps each scaffolded project at the same directory depth and prevents accidental workspace contamination.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0df8dc8 and 8209889.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • .github/workflows/test.yml (1 hunks)
  • packages/eslint-config-reactlynx/package.json (1 hunks)
  • packages/eslint-config-reactlynx/src/index.ts (1 hunks)
  • packages/eslint-config-reactlynx/src/ts.ts (1 hunks)
  • packages/rspeedy/create-rspeedy/package.json (1 hunks)
  • packages/rspeedy/create-rspeedy/src/index.ts (2 hunks)
  • packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/App.tsx (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/rspeedy-env.d.ts (1 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx (2 hunks)
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx (2 hunks)
  • pnpm-workspace.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • packages/rspeedy/create-rspeedy/template-react-ts/src/App.tsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx
  • packages/rspeedy/create-rspeedy/template-react-vitest-rltl-ts/src/App.tsx
  • packages/rspeedy/create-rspeedy/template-react-js/src/App.jsx
  • packages/rspeedy/create-rspeedy/template-react-ts/src/rspeedy-env.d.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • pnpm-workspace.yaml
  • packages/rspeedy/create-rspeedy/package.json
  • packages/rspeedy/create-rspeedy/src/index.ts
  • packages/eslint-config-reactlynx/package.json
  • packages/eslint-config-reactlynx/src/index.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: Validate PR title
  • GitHub Check: CodeQL Analyze (actions)
  • GitHub Check: zizmor
  • GitHub Check: code-style-check
  • GitHub Check: CodeQL Analyze (javascript-typescript)
  • GitHub Check: sherif
🔇 Additional comments (5)
.github/workflows/test.yml (1)

146-151: ESLint now enforced on the generated React regression project – good call

The --tools eslint flag and the subsequent pnpm run lint step make the generated sample project fail fast on style / quality issues. Nothing to add here.

packages/eslint-config-reactlynx/src/ts.ts (4)

1-12: LGTM! Correct TypeScript ESLint configuration approach.

The imports and setup using tseslint.config() are properly structured for TypeScript ESLint v8. The typescript-eslint package import and usage are correct.


79-84: Perfect! React hooks rules align with PR objectives.

The inclusion of react-hooks/rules-of-hooks and react-hooks/exhaustive-deps directly supports the PR objective of enabling eslint-plugin-react-hooks as a prerequisite for React Compiler integration.


85-140: Comprehensive JavaScript rules configuration.

The general JavaScript error avoidance and stylistic rules are well-configured and appropriate for a TypeScript/React project. The rule severity levels are reasonable.


142-142: Clean export statement.

The default export is correct and follows ES module conventions.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/eslint-config-reactlynx/src/index.ts (1)

14-14: Fix TypeScript type compatibility issues.

The static analysis indicates type mismatches between ESLint configuration types. This suggests version incompatibilities between @types/eslint and the actual ESLint package being used.

🧹 Nitpick comments (1)
packages/eslint-config-reactlynx/src/index.ts (1)

20-21: Clarify or remove outdated TODO comment.

The TODO comment mentions "class property initializer methods, which are seeing declining usage." Since this appears to be a new ESLint configuration, consider whether this parser customization is still necessary or if the comment should be updated to reflect current usage patterns.

-      // TODO: this is really only required for class property initializer methods, which are seeing declining usage.
-      // At some point, we should un-ship the custom parser and let ESLint use esprima.
+      // Custom parser required for class property initializer methods and JSX syntax
+      // Consider migrating to native ESLint parser when class properties are no longer needed
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8209889 and 5015c6b.

📒 Files selected for processing (2)
  • packages/eslint-config-reactlynx/src/index.ts (1 hunks)
  • packages/eslint-config-reactlynx/src/ts.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/eslint-config-reactlynx/src/ts.ts
🧰 Additional context used
🪛 GitHub Check: code-style-check
packages/eslint-config-reactlynx/src/index.ts

[failure] 52-52:
Type 'typeof import("/home/runner/work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint-plugin-react-hooks@5.2.0_eslint@9.30.0_jiti@2.4.2/node_modules/eslint-plugin-react-hooks/index")' is not assignable to type 'Plugin'.


[failure] 51-51:
Type '{ deprecatedRules: Partial<{ 'boolean-prop-naming': RuleModule; 'button-has-type': RuleModule; 'checked-requires-onchange-or-readonly': RuleModule; 'default-props-match-prop-types': RuleModule; ... 98 more ...; 'void-dom-elements-no-children': RuleModule; }>; rules: { ...; }; configs: { ...; } & { ...; }; }' is not assignable to type 'Plugin'.


[failure] 50-50:
Type '{ config: { "flat/recommended": FlatConfig; recommended: Config; }; meta: { name: string; version: string; }; configs: { ...; }; rules: { ...; }; }' is not assignable to type 'Plugin'.


[failure] 14-14:
Type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/@types+eslint@9.6.1/node_modules/@types/eslint/index").Linter.RulesRecord>[]' is not assignable to type 'import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.Config<import("/home/runner/_work/lynx-stack/lynx-stack/node_modules/.pnpm/eslint@9.30.0_jiti@2.4.2/node_modules/eslint/lib/types/index").Linter.RulesRecord>[]'.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: CodeQL Analyze (actions)
  • GitHub Check: zizmor
  • GitHub Check: CodeQL Analyze (javascript-typescript)
🔇 Additional comments (2)
packages/eslint-config-reactlynx/src/index.ts (2)

66-156: Comprehensive rule configuration looks good.

The ESLint rules are well-organized into logical sections (Preact/JSX, Hooks, JavaScript error avoidance, stylistic rules) with appropriate severity levels. The configuration properly enables React hooks rules and includes necessary React/JSX best practices.


160-160: Clean default export.

The export statement is straightforward and appropriate for an ESLint configuration module.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 14, 2025

CodSpeed Performance Report

Merging #1274 will not alter performance

Comparing upupming:feat/eslint (93de49f) with main (5b6cdc3)1

Summary

✅ 10 untouched benchmarks

Footnotes

  1. No successful run was found on main (ca8dc3c) during the generation of this report, so 5b6cdc3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@relativeci
Copy link

relativeci bot commented Jul 14, 2025

Web Explorer

#3759 Bundle Size — 342.64KiB (0%).

93de49f(current) vs bc1c452 main#3751(baseline)

Bundle metrics  no changes
                 Current
#3759
     Baseline
#3751
No change  Initial JS 142.33KiB 142.33KiB
No change  Initial CSS 31.84KiB 31.84KiB
Change  Cache Invalidation 0% 41.49%
No change  Chunks 7 7
No change  Assets 7 7
No change  Modules 211 211
No change  Duplicate Modules 17 17
No change  Duplicate Code 3.96% 3.96%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#3759
     Baseline
#3751
No change  JS 227.85KiB 227.85KiB
No change  Other 82.95KiB 82.95KiB
No change  CSS 31.84KiB 31.84KiB

Bundle analysis reportBranch upupming:feat/eslintProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link

relativeci bot commented Jul 14, 2025

React Example

#3767 Bundle Size — 235.26KiB (0%).

93de49f(current) vs bc1c452 main#3760(baseline)

Bundle metrics  no changes
                 Current
#3767
     Baseline
#3760
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 159 159
No change  Duplicate Modules 64 64
No change  Duplicate Code 45.81% 45.81%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#3767
     Baseline
#3760
No change  IMG 145.76KiB 145.76KiB
No change  Other 89.5KiB 89.5KiB

Bundle analysis reportBranch upupming:feat/eslintProject dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/eslint-config-reactlynx/README.md (1)

9-11: Add language specification to the code block.

The installation code block is missing a language specification, which is flagged by markdownlint.

-```
+```bash
 npm i -D eslint @lynx-js/eslint-config-reactlynx
packages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1)

5-7: Consider moving ESLint to devDependencies.

ESLint is typically used as a development tool and could be moved to devDependencies rather than dependencies for better semantic clarity.

- "dependencies": {
-   "eslint": "^9.30.0"
- },
  "devDependencies": {
    "@lynx-js/eslint-config-reactlynx": "workspace:*",
+   "eslint": "^9.30.0",
    "typescript-eslint": "^8.35.1"
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d5f233 and 2cb1a7d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • examples/react/eslint.config.js (1 hunks)
  • examples/react/package.json (1 hunks)
  • packages/eslint-config-reactlynx/README.md (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/js/eslint.config.js (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/ts/eslint.config.js (1 hunks)
  • packages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/rspeedy/create-rspeedy/template-eslint/js/eslint.config.js
  • examples/react/eslint.config.js
  • examples/react/package.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/rspeedy/create-rspeedy/template-eslint/ts/eslint.config.js (1)
examples/react/eslint.config.js (1)
  • config (7-13)
🪛 markdownlint-cli2 (0.17.2)
packages/eslint-config-reactlynx/README.md

9-9: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
packages/eslint-config-reactlynx/README.md (1)

18-18: No change needed: eslint/config is the correct import for ESLint v9+.

All occurrences of

import { defineConfig, globalIgnores } from 'eslint/config';

are consistent with the official ESLint v9+ API (there is no published @eslint/config package).

  • Verified eslint dependency is v9.30.0 in package.json
  • All existing imports use 'eslint/config' and no @eslint/config package exists on npm
  • ESLint’s own docs reference import { defineConfig } from 'eslint/config' as the supported entry point

Likely an incorrect or invalid review comment.

packages/rspeedy/create-rspeedy/template-eslint/ts/eslint.config.js (2)

1-1: Verify the ESLint import path is correct.

Same potential import issue as in the README - please verify that 'eslint/config' is the correct import path for ESLint v9+, as it may need to be '@eslint/config'.


6-15: LGTM! Well-structured ESLint configuration.

The configuration follows proper patterns:

  • Correctly uses tseslint.config() for TypeScript projects
  • Properly spreads the base configs from the ReactLynx package
  • Includes appropriate file patterns for source files
  • Applies global ignores for build artifacts
packages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1)

8-11: LGTM! Proper ESLint configuration dependencies.

The devDependencies are correctly configured:

  • Workspace reference for the ReactLynx ESLint config package
  • Current version of typescript-eslint for TypeScript support

@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/rspeedy/create-rspeedy/src/index.ts 0.00% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

@upupming upupming requested review from Yradex, gaoachao and hzy July 15, 2025 08:41
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 16, 2025
Co-authored-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
Signed-off-by: Yiming Li <yimingli.cs@gmail.com>
colinaaa
colinaaa previously approved these changes Aug 6, 2025
@colinaaa colinaaa merged commit 6baeb9f into lynx-family:main Aug 6, 2025
69 of 72 checks passed
colinaaa pushed a commit that referenced this pull request Aug 9, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/react@0.112.2

### Patch Changes

- Supports `recyclable` attribute in `<list-item>` to control whether
the list item is recyclable. The `recyclable` attribute depends on Lynx
Engine 3.4 or later.
([#1388](#1388))

    ```jsx
    <list-item recyclable={false} />
    ```

- feat: Support using a host element as direct child of Suspense
([#1455](#1455))

- Add profile in production build:
([#1336](#1336))

    1.  `diff:__COMPONENT_NAME__`: how long ReactLynx diff took.
    2.  `render:__COMPONENT_NAME__`: how long your render function took.
3. `setState`: an instant trace event, indicate when your setState was
called.

NOTE: `__COMPONENT_NAME__` may be unreadable when minified, setting
`displayName` may help.

- Add `onBackgroundSnapshotInstanceUpdateId` event on dev for Preact
Devtools to keep the correct snapshotInstanceId info.
([#1173](#1173))

- fix: Prevent error when spreading component props onto an element
([#1459](#1459))

- fix: Correctly check for the existence of background functions in MTS
([#1416](#1416))

    ```ts
    function handleTap() {
      "main thread";
      // The following check always returned false before this fix
      if (myHandleTap) {
        runOnBackground(myHandleTap)();
      }
    }
    ```

## @lynx-js/rspeedy@0.10.6

### Patch Changes

- Remove the experimental `provider` option.
([#1432](#1432))

- Add `output.filename.wasm` and `output.filename.assets` options.
([#1449](#1449))

- fix deno compatibility
([#1412](#1412))

- Should call the `api.onCloseBuild` hook after the build finished.
([#1446](#1446))

- Bump Rsbuild v1.4.15.
([#1423](#1423))

- Support using function in `output.filename.*`.
([#1449](#1449))

## create-rspeedy@0.10.6

### Patch Changes

- Support ESLint for ReactLynx templates
([#1274](#1274))

## @lynx-js/react-rsbuild-plugin@0.10.11

### Patch Changes

- Updated dependencies
\[[`c8ce6aa`](c8ce6aa)]:
    -   @lynx-js/react-alias-rsbuild-plugin@0.10.11
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4
    -   @lynx-js/react-webpack-plugin@0.6.19

## @lynx-js/react-alias-rsbuild-plugin@0.10.11

### Patch Changes

- Fix the `Package subpath './compat' is not defined by "exports"`
error. ([#1460](#1460))

## @lynx-js/testing-environment@0.1.5

### Patch Changes

- Fix `GlobalEventEmitter` type definition, the `emit(eventName: string,
data: unknown)` function should recevie an array typed `data` and pass
as param list of listeners.
([#1479](#1479))

## @lynx-js/web-constants@0.15.5

### Patch Changes

- fix: load main-thread chunk in ESM format
([#1437](#1437))

See [nodejs/node#59362](nodejs/node#59362) for
more details.

- feat: support path() for `createQuerySelector`
([#1456](#1456))

- Added `getPathInfo` API to `NativeApp` and its cross-thread handler
for retrieving the path from a DOM node to the root.
- Implemented endpoint and handler registration in both background and
UI threads.
    -   Implemented `nativeApp.getPathInfo()`

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.15.5

## @lynx-js/web-core@0.15.5

### Patch Changes

- fix: load main-thread chunk in ESM format
([#1437](#1437))

See [nodejs/node#59362](nodejs/node#59362) for
more details.

- feat: support path() for `createQuerySelector`
([#1456](#1456))

- Added `getPathInfo` API to `NativeApp` and its cross-thread handler
for retrieving the path from a DOM node to the root.
- Implemented endpoint and handler registration in both background and
UI threads.
    -   Implemented `nativeApp.getPathInfo()`

- fix: when `onNativeModulesCall` is delayed in mounting, the
NativeModules execution result may be undefined.
([#1457](#1457))

- fix: `onNativeModulesCall` && `onNapiModulesCall` use getter to get.
([#1466](#1466))

- Updated dependencies
\[[`29434ae`](29434ae),
[`fb7096b`](fb7096b)]:
    -   @lynx-js/web-mainthread-apis@0.15.5
    -   @lynx-js/web-constants@0.15.5
    -   @lynx-js/web-worker-runtime@0.15.5
    -   @lynx-js/web-worker-rpc@0.15.5

## @lynx-js/web-core-server@0.15.5

### Patch Changes

- fix: load main-thread chunk in ESM format
([#1437](#1437))

See [nodejs/node#59362](nodejs/node#59362) for
more details.

## @lynx-js/web-elements@0.8.4

### Patch Changes

- feat: add autocomplete attribute support for x-input component
([#1444](#1444))

Implements autocomplete attribute forwarding from the x-input custom
element to the internal HTML input element in the shadow DOM. This
enables standard browser autocomplete functionality for x-input
elements.

- Add referrerpolicy attribute support to x-image web component
([#1420](#1420))

-   Updated dependencies \[]:
    -   @lynx-js/web-elements-template@0.8.4

## @lynx-js/web-mainthread-apis@0.15.5

### Patch Changes

- fix: load main-thread chunk in ESM format
([#1437](#1437))

See [nodejs/node#59362](nodejs/node#59362) for
more details.

- Updated dependencies
\[[`29434ae`](29434ae),
[`fb7096b`](fb7096b)]:
    -   @lynx-js/web-constants@0.15.5
    -   @lynx-js/web-style-transformer@0.15.5

## @lynx-js/web-worker-runtime@0.15.5

### Patch Changes

- feat: support path() for `createQuerySelector`
([#1456](#1456))

- Added `getPathInfo` API to `NativeApp` and its cross-thread handler
for retrieving the path from a DOM node to the root.
- Implemented endpoint and handler registration in both background and
UI threads.
    -   Implemented `nativeApp.getPathInfo()`

- Updated dependencies
\[[`29434ae`](29434ae),
[`fb7096b`](fb7096b)]:
    -   @lynx-js/web-mainthread-apis@0.15.5
    -   @lynx-js/web-constants@0.15.5
    -   @lynx-js/web-worker-rpc@0.15.5

## upgrade-rspeedy@0.10.6



## @lynx-js/web-elements-template@0.8.4



## @lynx-js/web-style-transformer@0.15.5



## @lynx-js/web-worker-rpc@0.15.5

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants