fix lint - #217
Conversation
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
|
Beep boop 🤖 I noticed you didn't make any changes at the
In order to keep track, I'll create an issue if you decide now is not a good time
|
There was a problem hiding this comment.
Pull request overview
This PR addresses CI-blocking ESLint errors by applying targeted TypeScript-safe refactors (e.g., safer + operands), removing a linted setTimeout pattern, and resolving a variable-shadowing case in audit utilities—along with consistent formatting updates.
Changes:
- Fix
+operand type-safety issues (e.g.,Number(...)coercions in GUID hashing, string construction updates). - Replace the
setTimeout(resolve, ...)pattern with an explicit callback to satisfy lint/security rules. - Resolve variable shadowing by renaming the destructured
auditclient and apply repo-wide Prettier/ESLint formatting fixes.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Fixes file formatting (closing brace alignment). |
| node/utils/transformOperation.ts | Refactors string construction to satisfy lint rules and applies formatting. |
| node/utils/audit.ts | Fixes variable shadowing by renaming the audit client binding and applies formatting. |
| node/typings/domain/index.ts | Formatting-only change to global type declarations. |
| node/resolvers/directives/validateStoreUserAccess.ts | Formatting-only tweak (parenthesis/whitespace). |
| node/resolvers/Queries/Users.ts | Updates sleep to avoid the linted setTimeout usage and applies formatting. |
| node/resolvers/Queries/Settings.ts | Formatting-only tweaks (commas/blank lines). |
| node/resolvers/Queries/Organizations.ts | Formatting-only tweaks (commas/blank lines). |
| node/resolvers/Queries/MarketingTags.ts | Formatting-only tweaks (commas/blank lines). |
| node/resolvers/Queries/CostCenters.ts | Ensures numeric addition in setGUID by coercing hash results to numbers. |
| node/resolvers/Mutations/Users.ts | Formatting-only tweaks (object literals, trailing commas, whitespace). |
| node/resolvers/Mutations/Settings.ts | Formatting-only tweaks and line wrapping for readability/lint compliance. |
| node/resolvers/Mutations/Organizations.ts | Formatting-only tweaks; normalizes quotes for 'redacted'. |
| node/resolvers/Mutations/MarketingTags.ts | Formatting-only tweaks (trailing comma, whitespace). |
| node/resolvers/Mutations/CostCenters.ts | Formatting-only indentation fixes around audit.sendEvent payloads. |
| node/clients/audit.ts | Formatting/line-wrapping cleanup; no functional behavior change intended. |
| CHANGELOG.md | Adds an “Unreleased / Fixed” entry for the lint fixes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ### Fixed | ||
|
|
||
| - fix some error presented by lint |
There was a problem hiding this comment.
Changelog entry is grammatically awkward/inconsistent with other bullets (capitalization + pluralization). Consider rephrasing to something like “Fix some lint-reported errors.”
| - fix some error presented by lint | |
| - Fix some lint-reported errors. |
| Number(hashCode(address.street)) + | ||
| Number(hashCode(address.complement)) + | ||
| Number(hashCode(address.city)) + | ||
| Number(hashCode(address.state)) |
There was a problem hiding this comment.
não sei se converter para Number é a melhor coisa aqui. Em teoria aqui estamos definindo um GUID, que não precisa ser só números, certo? Apesar da função hashCode aparentemente retornar apenas números, se um dia ela passar a retornar outra coisa, esse código aqui pode quebrar.
What problem is this solving?
This PR fixes all ESLint errors in the codebase (7 errors total). The errors were blocking the CI/CD pipeline and preventing proper code quality checks.
Fixed errors:
+operator on mixed types (numbers/strings) inCostCenters.tsandtransformOperation.tssetTimeoutinUsers.tsauditdeclaration inaudit.tsHow to test it?
npm run lint- should pass with 0 errors (only warnings remain)npm run format- should format files correctlyAll errors fixed! Only warnings remain (mostly related to
anytypes and best practice suggestions).Describe alternatives you've considered, if any.
Related to / Depends on
N/A - Standalone lint fix