Skip to content

fix lint - #217

Open
nicholas-maestrello wants to merge 2 commits into
masterfrom
fix/lint
Open

fix lint#217
nicholas-maestrello wants to merge 2 commits into
masterfrom
fix/lint

Conversation

@nicholas-maestrello

Copy link
Copy Markdown
Contributor

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:

  • Type safety issues with + operator on mixed types (numbers/strings) in CostCenters.ts and transformOperation.ts
  • Implied eval security issue with setTimeout in Users.ts
  • Variable shadowing issue with duplicate audit declaration in audit.ts

How to test it?

  1. Run npm run lint - should pass with 0 errors (only warnings remain)
  2. Run npm run format - should format files correctly
  3. Verify that all auto-fixable issues were resolved
  4. Check that the code still functions as expected (no behavioral changes)

All errors fixed! Only warnings remain (mostly related to any types and best practice suggestions).

Describe alternatives you've considered, if any.

  • Could suppress the linting rules, but fixing the actual issues improves code quality and type safety
  • Could have typed the variables more strictly to avoid String() conversions, but template literals are more idiomatic

Related to / Depends on

N/A - Standalone lint fix

@vtex-io-ci-cd

vtex-io-ci-cd Bot commented Feb 10, 2026

Copy link
Copy Markdown

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:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

@vtex-io-docs-bot

vtex-io-docs-bot Bot commented Feb 10, 2026

Copy link
Copy Markdown

Beep boop 🤖

I noticed you didn't make any changes at the docs/ folder

  • There's nothing new to document 🤔
  • I'll do it later 😞

In order to keep track, I'll create an issue if you decide now is not a good time

  • I just updated 🎉🎉

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 audit client 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.

Comment thread CHANGELOG.md

### Fixed

- fix some error presented by lint

Copilot AI Feb 11, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changelog entry is grammatically awkward/inconsistent with other bullets (capitalization + pluralization). Consider rephrasing to something like “Fix some lint-reported errors.”

Suggested change
- fix some error presented by lint
- Fix some lint-reported errors.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +52
Number(hashCode(address.street)) +
Number(hashCode(address.complement)) +
Number(hashCode(address.city)) +
Number(hashCode(address.state))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants