chore(sdk): add linting, formatting support and CI workflow for SDK p…#238
Conversation
📝 WalkthroughWalkthroughIntroduces ESLint and Prettier configuration for the SDK package with a corresponding GitHub Actions workflow. The workflow runs on main push and pull requests, executing lint and format checks using frozen lockfile installation. Configuration files define TypeScript linting rules and code formatting standards. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/sdk/.eslintrc.json`:
- Around line 1-18: Replace the legacy .eslintrc.json by creating an
eslint.config.mjs that uses FlatCompat from "@eslint/eslintrc" to load the
existing configuration: map "parser" -> parser option for
"@typescript-eslint/parser", preserve "parserOptions.project" and "sourceType",
convert "extends" entries
("eslint:recommended","plugin:`@typescript-eslint/recommended`","prettier") into
FlatCompat.extend/config chain, include the "@typescript-eslint" plugin rules
via the plugin config, replicate "env" (node, es2024) and "ignorePatterns"
(dist, node_modules) by using FlatCompat and the flat config's ignore/glob
features, and export the final config as the default export from
eslint.config.mjs so ESLint v9 flat config is used instead of .eslintrc.json.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: d47a742e-b714-40cd-a208-15875ef5b54b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
.github/workflows/sdk.ymlpackages/sdk/.eslintrc.jsonpackages/sdk/.prettierrcpackages/sdk/package.json
| { | ||
| "root": true, | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "project": "./tsconfig.json", | ||
| "sourceType": "module" | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "prettier" | ||
| ], | ||
| "plugins": ["@typescript-eslint"], | ||
| "env": { | ||
| "node": true, | ||
| "es2024": true | ||
| }, | ||
| "ignorePatterns": ["dist", "node_modules"] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n --hidden --glob '!**/node_modules/**' \
'ESLINT_USE_FLAT_CONFIG|eslint\.config\.(js|mjs|cjs)|FlatCompat|@eslint/eslintrc' \
.Repository: Fundable-Protocol/stellar_client_os
Length of output: 647
🏁 Script executed:
fd -type f -name 'eslint.config.*'Repository: Fundable-Protocol/stellar_client_os
Length of output: 250
🏁 Script executed:
cat -n packages/sdk/package.json | head -40Repository: Fundable-Protocol/stellar_client_os
Length of output: 1391
🏁 Script executed:
if [ -f ./eslint.config.mjs ]; then cat -n ./eslint.config.mjs | head -50; else echo "No root eslint.config.mjs found"; fiRepository: Fundable-Protocol/stellar_client_os
Length of output: 111
🏁 Script executed:
rg -n 'ESLINT_USE_FLAT_CONFIG' .Repository: Fundable-Protocol/stellar_client_os
Length of output: 61
🏁 Script executed:
find . -type f \( -name '.eslintignore' -o -name 'package.json' -o -name '*.yml' -o -name '*.yaml' \) -path '*/.*' -o -name '*.sh' | head -20Repository: Fundable-Protocol/stellar_client_os
Length of output: 254
🏁 Script executed:
rg -n 'eslint' --type=yaml --type=json | grep -i 'legacy\|flat\|config' | head -20Repository: Fundable-Protocol/stellar_client_os
Length of output: 1313
🏁 Script executed:
cat -n ./.github/workflows/sdk.ymlRepository: Fundable-Protocol/stellar_client_os
Length of output: 1006
🏁 Script executed:
ls -la packages/sdk/ | grep -i eslintRepository: Fundable-Protocol/stellar_client_os
Length of output: 144
🏁 Script executed:
find packages/sdk -type f -name 'eslint*'Repository: Fundable-Protocol/stellar_client_os
Length of output: 61
Migrate this config to ESLint 9's flat config format.
ESLint v9 uses flat config by default and .eslintrc.* files only work when ESLINT_USE_FLAT_CONFIG=false is set. This file is still in legacy JSON format with no environment variable setup, so the linting may not work as expected. Since @eslint/eslintrc is already a dependency, migrate to eslint.config.mjs using FlatCompat for compatibility. See ESLint migration guide.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/sdk/.eslintrc.json` around lines 1 - 18, Replace the legacy
.eslintrc.json by creating an eslint.config.mjs that uses FlatCompat from
"@eslint/eslintrc" to load the existing configuration: map "parser" -> parser
option for "@typescript-eslint/parser", preserve "parserOptions.project" and
"sourceType", convert "extends" entries
("eslint:recommended","plugin:`@typescript-eslint/recommended`","prettier") into
FlatCompat.extend/config chain, include the "@typescript-eslint" plugin rules
via the plugin config, replicate "env" (node, es2024) and "ignorePatterns"
(dist, node_modules) by using FlatCompat and the flat config's ignore/glob
features, and export the final config as the default export from
eslint.config.mjs so ESLint v9 flat config is used instead of .eslintrc.json.
|
Fix merge conflict |
…ckage This PR's content has been fully absorbed by intervening merges (esp. PR Fundable-Protocol#229's lint/format CI): - main's sdk.yml has lint+format+test+build jobs - main's .eslintrc.json with explicit ESLint v8 + TS rules is in place - main's .prettierrc.json (singleQuote: false, width 80) is established - main's package.json already has lint/format scripts and devDeps Resolution: take main's versions for all conflicted files; drop this PR's .prettierrc (would conflict with main's .prettierrc.json which uses different style settings). Net diff vs main is zero — this PR can be merged as a no-op for attribution, or closed as superseded.
|
@divicbold47 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
close #199
PR Description
Title: chore(sdk): add linting, formatting, and SDK CI workflow
Summary:
Add linting and formatting support for the
@fundable/sdkpackage, and introduce a dedicated GitHub Actions workflow to enforce SDK quality on pushes and pull requests.What changed:
lint,format, andformat:checkscripts.@eslint/eslintrcto support ESLint v9 with.eslintrc.json.pnpm --filter @fundable/sdk lintandpnpm --filter @fundable/sdk format:check.Why:
This ensures the SDK package is linted and formatted consistently, and prevents regressions by running quality checks in CI specifically for sdk.
Testing / Verification:
pnpm installpnpm --filter @fundable/sdk lintpnpm --filter @fundable/sdk format:checkSummary by CodeRabbit