Dev/code style#3
Conversation
There was a problem hiding this comment.
Sorry @FortiShield, your pull request is larger than the review limit of 150000 diff characters
|
Important Review skippedToo many files! This PR contains 160 files, which is 10 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (160)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Review Summary by QodoApply comprehensive code style formatting improvements across CLI codebase
WalkthroughsDescription• Applied comprehensive code style formatting improvements across the entire CLI codebase • Reformatted import statements to break long lines across multiple lines for improved readability • Split function signatures, type definitions, and complex expressions to adhere to line length limits • Improved indentation and spacing consistency throughout test files and command implementations • Enhanced readability of object literals, array definitions, and method chains • Added trailing newline to package.json for consistency with code style standards • Affected 25+ files including commands, client utilities, tests, and configuration modules Diagramflowchart LR
A["CLI Codebase<br/>commands, clients,<br/>tests, config"] -- "Apply formatting<br/>rules" --> B["Reformatted Code<br/>improved readability<br/>consistent style"]
B -- "Line breaking" --> C["Long imports &<br/>signatures split"]
B -- "Indentation" --> D["Consistent spacing<br/>visual hierarchy"]
B -- "Type definitions" --> E["Union types &<br/>expressions formatted"]
File Changes1. cli/src/commands/worktree.ts
|
Code Review by Qodo
1. Broken ESLint flat config
|
| import js from '@eslint/js'; | ||
| import tseslint from 'typescript-eslint'; | ||
| import globals from 'globals'; | ||
|
|
||
| export default tseslint.config( | ||
| { ignores: ['**/dist/**', '**/node_modules/**', '**/.pnpm-store/**', '**/coverage/**'] }, | ||
| js.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| { | ||
| files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.mjs', '**/*.cjs'], | ||
| languageOptions: { | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| ...globals.es2021, | ||
| }, | ||
| }, | ||
| rules: { | ||
| '@typescript-eslint/no-unused-vars': ['off'], | ||
| '@typescript-eslint/no-explicit-any': 'off', | ||
| '@typescript-eslint/explicit-function-return-type': 'off', | ||
| '@typescript-eslint/no-empty-object-type': 'off', | ||
| '@typescript-eslint/no-namespace': 'off', | ||
| '@typescript-eslint/no-require-imports': 'off', | ||
| '@typescript-eslint/triple-slash-reference': 'off', | ||
| 'no-console': 'off', | ||
| 'no-useless-catch': 'off', | ||
| 'no-useless-escape': 'off', | ||
| 'prefer-const': 'warn', | ||
| 'no-empty': 'warn', | ||
| 'no-dupe-else-if': 'warn', | ||
| 'no-constant-binary-expression': 'warn', | ||
| 'no-control-regex': 'off', | ||
| 'no-regex-spaces': 'warn', | ||
| 'react-hooks/exhaustive-deps': 'off', | ||
| }, |
There was a problem hiding this comment.
1. Broken eslint flat config 🐞 Bug ☼ Reliability
eslint.config.mjs imports globals and configures react-hooks/exhaustive-deps without installing/registering the needed packages/plugins, so eslint . will fail (module/rule-not-found). This breaks the newly added root lint/lint:fix scripts and can block CI/dev workflows.
Agent Prompt
### Issue description
`eslint.config.mjs` currently:
- `import`s `globals` but the root package does not declare it as a dependency.
- references the rule `react-hooks/exhaustive-deps` but does not install or register the `react-hooks` plugin.
This causes `pnpm lint` / `eslint .` to fail at runtime.
### Issue Context
- The PR adds root scripts `lint` and `lint:fix`, so this config will be exercised.
- In flat config, plugin rules require explicitly registering `plugins: { ... }`.
### Fix Focus Areas
- eslint.config.mjs[1-36]
- package.json[40-55]
### Suggested changes
Option A (recommended if you want the rule present):
1. Add devDependencies:
- `globals`
- `eslint-plugin-react-hooks`
2. Update `eslint.config.mjs`:
- `import reactHooks from 'eslint-plugin-react-hooks'`
- add `plugins: { 'react-hooks': reactHooks }`
Option B (if you don't need it):
- Remove the `react-hooks/exhaustive-deps` rule line entirely.
(Also consider adding `globals` as a direct devDependency even if it happens to be transitive today, to keep pnpm resolution stable.)
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Thinking Path
What Changed
Verification
Risks
Model Used
Checklist