-
Notifications
You must be signed in to change notification settings - Fork 109
feat(eslint): support eslint for ReactLynx #1274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 93de49f The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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:compositewithoutdeclarationmay block downstream Type Script consumersWith
composite: trueenabled, TypeScript expects the project to emit declaration files.
Consider also enablingdeclaration(and optionallydeclarationMap) so that consumers of@lynx-js/eslint-config-reactlynxcan 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-lintSpecify 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": truepackages/rspeedy/create-rspeedy/template-eslint/ts/package.json (1)
5-10: Same dependency split as the JS template.For consistency and lean installs, move
eslinttodevDependenciesand mark the template asprivate."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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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-reactlynxpackage 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-hooksfor React Compiler support.
47-51: Fix plugin type assignments.The static analysis indicates that the plugin objects don't match the expected
Plugintype. 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-reactlynxas a devDependency with theworkspace:*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 attributionJust 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.jsThe
examples/react/package.jsonalready specifies"type": "module", so usingimportineslint.config.jsis valid in this context. No further action is required.examples/react/package.json (1)
9-17:eslintmissing – thelintscript will fail without it.The example adds a
lintscript but doesn’t listeslintas a (dev) dependency.
Unless it’s guaranteed to be hoisted from the workspace root, runningpnpm run lintinside 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
copyFolderfunction needed for the ESLint template copying functionality.
110-133: Implementation looks correct with proper template matching logic.The
mapESLintTemplateimplementation correctly:
- Finds the language by matching the template name against the TEMPLATES array
- Constructs the appropriate ESLint template folder path
- Uses
copyFolderwith proper parameters including merge settingsThe 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-reactlynxpackage to the workspace configuration.
51-51: LGTM!The create-rstack patch addition aligns with the provided patch file that extends the
mapESLintTemplatefunction signature.patches/create-rstack.patch (1)
1-35: LGTM!The patch correctly extends the
mapESLintTemplatefunction 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.0andeslint-plugin-react@7.37.5have 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.
packages/rspeedy/create-rspeedy/template-eslint/js/eslint.config.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 aboutdefineConfig()are no longer applicable.
🧹 Nitpick comments (1)
.github/workflows/test.yml (1)
152-157: Avoid unintentional nesting of the second sample projectAt this point the script is still inside
create-rspeedy-regression/.
Running the secondnpx create-rspeedy-canary … --dir create-rspeedy-regression-vitest-rltlwill 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/popdinstead of manualcdjuggling).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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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 callThe
--tools eslintflag and the subsequentpnpm run lintstep 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. Thetypescript-eslintpackage import and usage are correct.
79-84: Perfect! React hooks rules align with PR objectives.The inclusion of
react-hooks/rules-of-hooksandreact-hooks/exhaustive-depsdirectly supports the PR objective of enablingeslint-plugin-react-hooksas 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.
There was a problem hiding this 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/eslintand 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
📒 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 Performance ReportMerging #1274 will not alter performanceComparing Summary
Footnotes |
Web Explorer#3759 Bundle Size — 342.64KiB (0%).93de49f(current) vs bc1c452 main#3751(baseline) Bundle metrics
|
| Current #3759 |
Baseline #3751 |
|
|---|---|---|
142.33KiB |
142.33KiB |
|
31.84KiB |
31.84KiB |
|
0% |
41.49% |
|
7 |
7 |
|
7 |
7 |
|
211 |
211 |
|
17 |
17 |
|
3.96% |
3.96% |
|
4 |
4 |
|
0 |
0 |
Bundle size by type no changes
| Current #3759 |
Baseline #3751 |
|
|---|---|---|
227.85KiB |
227.85KiB |
|
82.95KiB |
82.95KiB |
|
31.84KiB |
31.84KiB |
Bundle analysis report Branch upupming:feat/eslint Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#3767 Bundle Size — 235.26KiB (0%).93de49f(current) vs bc1c452 main#3760(baseline) Bundle metrics
|
| Current #3767 |
Baseline #3760 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
159 |
159 |
|
64 |
64 |
|
45.81% |
45.81% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #3767 |
Baseline #3760 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
89.5KiB |
89.5KiB |
Bundle analysis report Branch upupming:feat/eslint Project dashboard
Generated by RelativeCI Documentation Report issue
There was a problem hiding this 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-reactlynxpackages/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
devDependenciesrather thandependenciesfor 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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/configis 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/configpackage).
- Verified
eslintdependency is v9.30.0 in package.json- All existing imports use
'eslint/config'and no@eslint/configpackage exists on npm- ESLint’s own docs reference
import { defineConfig } from 'eslint/config'as the supported entry pointLikely 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 ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
📢 Thoughts on this report? Let us know! |
packages/rspeedy/create-rspeedy/template-react-vitest-rltl-js/src/App.jsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com> Signed-off-by: Yiming Li <yimingli.cs@gmail.com>
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>
Summary
Support ESLint for ReactLynx.
As
eslint-plugin-react-hooksis the prerequisite eslint rule for React Compiler, we need to support eslint for ReactLynx before landing React Compiler.Related PR: #1269
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
onMountedtoonRenderin relevant components and tests for improved consistency.Style
Chores