Repository navigation
Introduced oxfmt - #17431
Introduced oxfmt#17431
Conversation
📝 WalkthroughWalkthroughThe web workflow now uses isolated ChangesWeb tooling migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lefthook.yml`:
- Around line 84-91: Pin the isolated hook installation in the HOOKBIN setup to
the versions recorded in web/package-lock.json, specifically the locked oxfmt
and oxlint versions, rather than allowing npm install to resolve compatible
updates. Update the npm install command while preserving the existing minimal
hook-only installation behavior.
In `@web/.oxlintrc.json`:
- Around line 7-24: Update the Oxlint configuration to use native plugin names
and rule namespaces: replace `@typescript-eslint` and react-hooks plugin entries
with the supported minimal plugins, map rules such as
`@typescript-eslint/no-use-before-define` and `@typescript-eslint/no-explicit-any`
to eslint/no-use-before-define and typescript/no-explicit-any, keep React Hooks
rules under react, and place any rules still requiring ESLint plugins under
jsPlugins.
In `@web/package.json`:
- Around line 167-168: Update the Node version constraint in the web package’s
engines declaration to match the locked oxfmt requirement, using a minimum
compatible range that excludes Node 18 while supporting Node 20.19.0+ and Node
22.12.0+.
In `@web/README.md`:
- Line 15: Add descriptive alternate text to the launch screenshot Markdown
image in README.md by placing it inside the image syntax, preserving the
existing image URL and documenting the key information conveyed by the
screenshot.
In `@web/src/components/jsonjoy-builder/index.css`:
- Around line 223-225: Update the --font-sans declaration so the unquoted font
family names BlinkMacSystemFont, Roboto, and Arial use lowercase spelling, while
preserving the quoted Inter and existing fallback order.
In `@web/src/components/ui/badge.tsx`:
- Around line 29-30: Revert the change to the shared UI component declaration in
badge.tsx, restoring the original React.HTMLAttributes<HTMLDivElement> typing.
Do not modify files under web/src/components/ui; apply any required
customization from outside that directory only with explicit approval.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e3d1b91f-090f-4182-bb05-13a376c141b3
⛔ Files ignored due to path filters (2)
web/package-lock.jsonis excluded by!**/package-lock.jsonweb/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (33)
lefthook.ymlweb/.eslintrc.cjsweb/.oxfmtrc.jsonweb/.oxlintrc.jsonweb/.prettierignoreweb/README.mdweb/index.htmlweb/package.jsonweb/src/components/document-preview/hooks.tsweb/src/components/image/index.tsxweb/src/components/json-edit/css/index.lessweb/src/components/jsonjoy-builder/index.cssweb/src/components/jsonjoy-builder/types/validation.tsweb/src/components/line-chart/index.tsxweb/src/components/ui/badge.tsxweb/src/interfaces/database/mcp-server.tsweb/src/interfaces/database/plugin.tsweb/src/locales/ar.tsweb/src/pages/agent/form/bgpt-form/index.tsxweb/src/pages/agent/form/categorize-form/index.tsxweb/src/pages/agent/form/retrieval-form/next.tsxweb/src/pages/agent/form/tool-form/retrieval-form/index.tsxweb/src/pages/agent/hooks/use-export-json.tsweb/src/pages/agents/agent-tag-editor.tsxweb/src/pages/dataset/compilation/hooks/use-wiki-detail-content.tsweb/src/pages/dataset/compilation/utils/parse-wiki-link.tsweb/src/pages/dataset/components/metedata/manage-modal-column.tsxweb/src/pages/dataset/dataset-setting/configuration/book.tsxweb/src/pages/dataset/dataset-setting/configuration/laws.tsxweb/src/pages/dataset/dataset-setting/configuration/manual.tsxweb/src/pages/dataset/dataset-setting/configuration/one.tsxweb/src/pages/dataset/dataset-setting/configuration/paper.tsxweb/src/pages/dataset/dataset-setting/configuration/presentation.tsx
💤 Files with no reviewable changes (2)
- web/.prettierignore
- web/.eslintrc.cjs
| HOOKBIN=web/node_modules/.hookbin | ||
| if [ ! -x "$HOOKBIN/node_modules/.bin/oxfmt" ] \ | ||
| || [ ! -x "$HOOKBIN/node_modules/.bin/oxlint" ]; then | ||
| echo '==> installing oxfmt + oxlint only (no full web toolchain)' | ||
| mkdir -p "$HOOKBIN" | ||
| [ -f "$HOOKBIN/package.json" ] \ | ||
| || printf '{"name":"hookbin","version":"1.0.0","private":true}\n' > "$HOOKBIN/package.json" | ||
| npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev oxfmt oxlint |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== lefthook.yml relevant section =="
sed -n '70,120p' lefthook.yml || true
echo
echo "== web/package.json package refs =="
python3 - <<'PY'
import json
from pathlib import Path
p=Path('web/package.json')
if p.exists():
data=json.loads(p.read_text())
for k in ['dependencies','devDependencies','peerDependencies','optionalDependencies']:
for name in ['oxfmt','oxlint']:
if k in data and name in data[k]:
print(f'{k}:{name}={data[k][name]}')
else:
print('web/package.json not found')
PY
echo
echo "== web/package-lock.json refs for oxfmt/oxlint =="
python3 - <<'PY'
import json
from pathlib import Path
p=Path('web/package-lock.json')
if p.exists():
data=json.loads(p.read_text())
root=data.get('packages',{}).get('',{})
print('root dependencies devDependencies:', {k:data['packages'][''].get('devDependencies',{}).get(k) for k in ['oxfmt','oxlint']})
for name in ['oxfmt','oxlint']:
pkg=data.get('packages',{}).get('node_modules/'+name)
print(f'node_modules/{name}: version={pkg.get("version") if pkg else None} resolved={pkg.get("resolved") if pkg else None} integrity={pkg.get("integrity") if pkg else None}')
else:
print('web/package-lock.json not found')
PY
echo
echo "== npm bin lookup behavior in a temporary npm install =="
if command -v npm >/dev/null 2>&1; then
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
npm init -y >/dev/null 2>&1
npm install --no-audit --no-fund --save-dev oxfmt oxlint >/dev/null 2>&1
echo "-- package.json --"
cat package.json
echo "-- package-lock.json oxfmt/oxlint --"
node - <<'JS'
const fs = require('fs');
const lock = JSON.parse(fs.readFileSync('package-lock.json','utf8'));
for (const name of ['oxfmt','oxlint']) {
const p = lock.packages?.['node_modules/'+name];
console.log(name, ':', p ? `version=${p.version} resolved=${p.resolved}` : 'not found');
}
JS
else
echo "npm not available"
fiRepository: infiniflow/ragflow
Length of output: 3739
Pin the hook install to web/package-lock.json.
npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev oxfmt oxlint does not consume web/package-lock.json, so the isolated hook can resolve newer compatible versions than the locked 0.60.0 / 1.75.0 used by the web toolchain. Install the exact locked versions or use a committed hook lockfile.
Suggested direction
+ OXFMT_VERSION=$(node -p "require('./web/package-lock.json').packages['node_modules/oxfmt'].version")
+ OXLINT_VERSION=$(node -p "require('./web/package-lock.json').packages['node_modules/oxlint'].version")
- npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev oxfmt oxlint
+ npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev \
+ "oxfmt@$OXFMT_VERSION" "oxlint@$OXLINT_VERSION"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| HOOKBIN=web/node_modules/.hookbin | |
| if [ ! -x "$HOOKBIN/node_modules/.bin/oxfmt" ] \ | |
| || [ ! -x "$HOOKBIN/node_modules/.bin/oxlint" ]; then | |
| echo '==> installing oxfmt + oxlint only (no full web toolchain)' | |
| mkdir -p "$HOOKBIN" | |
| [ -f "$HOOKBIN/package.json" ] \ | |
| || printf '{"name":"hookbin","version":"1.0.0","private":true}\n' > "$HOOKBIN/package.json" | |
| npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev oxfmt oxlint | |
| OXFMT_VERSION=$(node -p "require('./web/package-lock.json').packages['node_modules/oxfmt'].version") | |
| OXLINT_VERSION=$(node -p "require('./web/package-lock.json').packages['node_modules/oxlint'].version") | |
| npm install --prefix "$HOOKBIN" --no-audit --no-fund --save-dev \ | |
| "oxfmt@$OXFMT_VERSION" "oxlint@$OXLINT_VERSION" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@lefthook.yml` around lines 84 - 91, Pin the isolated hook installation in the
HOOKBIN setup to the versions recorded in web/package-lock.json, specifically
the locked oxfmt and oxlint versions, rather than allowing npm install to
resolve compatible updates. Update the npm install command while preserving the
existing minimal hook-only installation behavior.
| "plugins": ["@typescript-eslint", "react", "react-hooks"], | ||
| "settings": { | ||
| "react": { | ||
| "version": "18.2.0" | ||
| } | ||
| }, | ||
| "rules": { | ||
| "@typescript-eslint/no-use-before-define": [ | ||
| "warn", | ||
| { | ||
| "functions": false, | ||
| "variables": true | ||
| } | ||
| ], | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/ban-ts-comment": "off", | ||
| "@typescript-eslint/no-empty-function": "off", | ||
| "@typescript-eslint/no-non-null-assertion": "off", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
cd web
target=$(find src -type f \( -name '*.ts' -o -name '*.tsx' \) -print -quit)
./node_modules/.bin/oxlint --print-config "$target"
./node_modules/.bin/oxlint "$target"Repository: infiniflow/ragflow
Length of output: 228
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## repository files around web config"
git ls-files | rg '(^web/|oxlintrc|oxlint|package.json|pnpm-lock.yaml|package-lock.json|yarn.lock)' | sed -n '1,200p'
echo
echo "## web/.oxlintrc.json"
cat -n web/.oxlintrc.json
echo
echo "## oxlint references in tracked files"
rg -n '"oxlint"|oxlint|\.oxlintrc|typescript-eslint|react-hooks|jsPlugins' --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' .Repository: infiniflow/ragflow
Length of output: 21072
🌐 Web query:
Oxlint plugins react-hooks no-use-before-define no-explicit-any rule names @typescript-eslint react
💡 Result:
Oxlint provides native, high-performance support for the rules and plugins you mentioned through its built-in Rust-based implementation [1]. Key details for your requested rules and plugins: Plugins and Rule Mapping - React and React Hooks: Oxlint includes a native react plugin [1] that covers rules from eslint-plugin-react and eslint-plugin-react-hooks [2][1]. You can enable it in your configuration file by adding react to the plugins array [3][4]. - TypeScript: Oxlint includes a native typescript plugin [1] that provides rules equivalent to @typescript-eslint [1]. Specific Rule Support - no-explicit-any: This rule is supported natively under the typescript namespace as typescript/no-explicit-any [5][6]. - no-use-before-define: This rule is supported natively under the eslint namespace as eslint/no-use-before-define [5]. - React Hooks: The standard hooks rules (such as rules-of-hooks and exhaustive-deps) are included in the native react plugin [2][1]. Note that newer React Compiler rules are also available as react/react-compiler [7]. Configuration and Usage - Reserved Names: The names react and typescript are reserved for Oxlint's native plugins [3][4]. You do not need to install them as external dependencies; they are built into the Oxlint binary [1]. - Type-Aware Linting: For rules that require type information (like certain @typescript-eslint rules), Oxlint now supports stable type-aware linting via its tsgolint engine [8][9]. You can enable this by setting the typeAware option in your configuration file or using the --type-aware CLI flag [9][10][4]. If you have specific legacy rules not yet covered by Oxlint's native implementation, Oxlint also provides a JavaScript Plugin System (alpha) that allows you to load standard ESLint plugins directly by configuring them in the jsPlugins section of your configuration file [11][4].
Citations:
- 1: https://oxc.rs/docs/guide/usage/linter/plugins.html
- 2: fix(tasks/lint_rules): Integrate react and react-hooks rules oxc-project/oxc#3315
- 3: https://oxc.rs/docs/guide/usage/linter/config-file-reference.html
- 4: https://oxc.rs/docs/guide/usage/linter/config.html
- 5: https://oxc.rs/docs/guide/usage/linter/rules.html
- 6: https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-explicit-any
- 7: https://oxc.rs/docs/guide/usage/linter/rules/react/react-compiler.html
- 8: https://oxc.rs/docs/guide/usage/linter/type-aware.html
- 9: https://oxc.rs/blog/2026-07-22-type-aware-linting-stable.html
- 10: https://oxc.rs/docs/guide/usage/linter/migrate-from-eslint.md
- 11: https://oxc.rs/docs/guide/usage/linter/js-plugins.html
Translate the ESLint plugin and rule namespaces for Oxlint.
.oxlintrc.json is read by Oxlint, whose native plugins use typescript and react; React Hooks rules are included under react, and this config does not install/load any external @typescript-eslint/eslint-plugin/eslint-plugin-react-hooks packages. Keep plugins/plugins.default minimal, use Oxlint-native rule namespaces such as eslint/no-use-before-define and typescript/no-explicit-any, and move any remaining ESLint rules to jsPlugins.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/.oxlintrc.json` around lines 7 - 24, Update the Oxlint configuration to
use native plugin names and rule namespaces: replace `@typescript-eslint` and
react-hooks plugin entries with the supported minimal plugins, map rules such as
`@typescript-eslint/no-use-before-define` and `@typescript-eslint/no-explicit-any`
to eslint/no-use-before-define and typescript/no-explicit-any, keep React Hooks
rules under react, and place any rules still requiring ESLint plugins under
jsPlugins.
| "oxfmt": "^0.60.0", | ||
| "oxlint": "^1.75.0", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
rg -n --hidden -g '!**/node_modules/**' \
-g '.nvmrc' -g '.node-version' -g '.tool-versions' \
-g 'package.json' -g 'Dockerfile*' -g '*.yml' -g '*.yaml' \
'node-version|FROM node:|NODE_VERSION|"engines"' .Repository: infiniflow/ragflow
Length of output: 279
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## package files with engines"
rg -n --hidden -g '!**/node_modules/**' -g 'package.json' '"engines"' .
echo
echo "## node version declarations"
for f in .nvmrc .node-version .tool-versions; do
if [ -f "$f" ]; then
echo "-- $f"
cat -n "$f"
fi
done
echo
echo "## oxfmt package metadata from lockfile / registry"
rg -n --hidden -g '!**/node_modules/**' -g 'package.json' -g 'package-lock.json' -g 'npm-shrinkwrap.json' -g 'yarn.lock' -g 'pnpm-lock.yaml' 'oxfmt|oxlint'Repository: infiniflow/ragflow
Length of output: 306
🏁 Script executed:
#!/usr/bin/env bash
set -u
echo "## web/package.json engines block"
sed -n '193,203p' web/package.json | cat -n
echo
echo "## workflow files referencing node or install"
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' \
'(uses: actions/setup-node|NODE_VERSION|setup-node|install|npm ci|npm install|pnpm|yarn)' .github '**/.github' . 2>/dev/null | head -200 || true
echo
echo "## repo root/package files"
git ls-files | rg '(^|/)(package\.json|package-lock\.json|npm-shrinkwrap\.json|yarn\.lock|pnpm-lock\.yaml|\.nvmrc|\.node-version|\.tool-versions|Dockerfile)$' || trueRepository: infiniflow/ragflow
Length of output: 25190
Raise web’s engine requirement to the locked oxfmt range.
web/package.json declares "engines": { "node": ">=18.20.4" }, but oxfmt requires Node ^20.19.0 || >=22.12.0; bump the declared engine minimum to avoid installation/failure on supported local or CI node 18 environments.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/package.json` around lines 167 - 168, Update the Node version constraint
in the web package’s engines declaration to match the locked oxfmt requirement,
using a minimum compatible range that excludes Node 18 while supporting Node
20.19.0+ and Node 22.12.0+.
| _The following output confirms a successful launch of the system:_ | ||
|
|
||
|  | ||
|  |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add alternate text to the launch screenshot.
The screenshot is informative but currently inaccessible to screen readers and triggers MD045.
Proposed fix
-
+📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
|  | |
|  |
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)
[warning] 15-15: Images should have alternate text (alt text)
(MD045, no-alt-text)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/README.md` at line 15, Add descriptive alternate text to the launch
screenshot Markdown image in README.md by placing it inside the image syntax,
preserving the existing image URL and documenting the key information conveyed
by the screenshot.
Source: Linters/SAST tools
| --font-sans: | ||
| 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, | ||
| 'Helvetica Neue', Arial, sans-serif; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the Stylelint font-keyword casing errors.
Stylelint reports BlinkMacSystemFont, Roboto, and Arial at Line [224]-[225]. Lowercase these unquoted family names so the stylesheet check passes.
Proposed fix
- 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
- 'Helvetica Neue', Arial, sans-serif;
+ 'Inter', system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', roboto,
+ 'Helvetica Neue', arial, sans-serif;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| --font-sans: | |
| 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, | |
| 'Helvetica Neue', Arial, sans-serif; | |
| --font-sans: | |
| 'Inter', system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, | |
| 'Helvetica Neue', arial, sans-serif; |
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 224-224: Expected "BlinkMacSystemFont" to be "blinkmacsystemfont" (value-keyword-case)
(value-keyword-case)
[error] 224-224: Expected "Roboto" to be "roboto" (value-keyword-case)
(value-keyword-case)
[error] 225-225: Expected "Arial" to be "arial" (value-keyword-case)
(value-keyword-case)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/components/jsonjoy-builder/index.css` around lines 223 - 225, Update
the --font-sans declaration so the unquoted font family names
BlinkMacSystemFont, Roboto, and Arial use lowercase spelling, while preserving
the quoted Inter and existing fallback order.
Source: Linters/SAST tools
| extends | ||
| React.HTMLAttributes<HTMLDivElement>, |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Revert this protected UI-file change unless explicitly approved.
web/src/components/ui/**/* must not be modified without explicit user approval. As per coding guidelines, shared UI components may only be customized from outside this directory.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@web/src/components/ui/badge.tsx` around lines 29 - 30, Revert the change to
the shared UI component declaration in badge.tsx, restoring the original
React.HTMLAttributes<HTMLDivElement> typing. Do not modify files under
web/src/components/ui; apply any required customization from outside that
directory only with explicit approval.
Source: Coding guidelines
Introduced oxfmt