Skip to content

chore: Migrate to Vite+ toolchain, fix all lint errors, and remove async from synchronous code#1445

Merged
fadi-george merged 8 commits intomainfrom
fadi/vp-lint
Mar 24, 2026
Merged

chore: Migrate to Vite+ toolchain, fix all lint errors, and remove async from synchronous code#1445
fadi-george merged 8 commits intomainfrom
fadi/vp-lint

Conversation

@fadi-george
Copy link
Contributor

@fadi-george fadi-george commented Mar 23, 2026

Description

1 Line Summary

Migrate from Vite to Vite+ toolchain, resolve all lint/type errors, and remove unnecessary async from synchronous functions.

Details

  • Toolchain migration: Migrated from Vite to Vite+ (vp) toolchain for building, testing, and linting. Consolidated test config into the main Vite config and replaced vite-tsconfig-paths with builtin support.
  • Explicit test imports: Removed globals: true from vitest config and added explicit import { vi, describe, test, expect, ... } from 'vite-plus/test' across all 64 test files, fixing type resolution issues with vp check.
  • Lint fixes (256 issues across ~50 files):
    • no-floating-promises: added void for fire-and-forget calls
    • no-base-to-string / restrict-template-expressions: used JSON.stringify(), String(), .toISOString() for proper serialization
    • await-thenable: removed unnecessary await on non-Promise values
    • unbound-method: used .bind(), extracted spy variables, restructured method access
    • no-redundant-type-constituents: simplified types
    • no-misused-spread: replaced class instance spread with Object.assign()
  • require-await fixes: Removed async from functions that never await, or converted them to return Promise.resolve()/Promise.reject() where callers depend on the Promise return type. Affected source files include PermissionManager, SessionManager, ServiceWorkerManager, SlidedownManager, WorkerMessengerPage, ServiceWorker, init.ts, listeners.ts, and pageSdkInit.ts.
  • OneSignalDeferredLoadedCallback type update: Updated callback type from () => void to () => void | PromiseLike<void> so that await OneSignal.push(item) works without wrapping in Promise.resolve().
  • api.json: Updated setConsentRequired spec to isAsync: false / returnType: "void" to match the actual implementation.
  • Removed obsolete files: Deleted GitHub automation scripts (Asana integrations, release drafter) that are no longer in use.

Systems Affected

  • WebSDK
  • Backend
  • Dashboard

Validation

Tests

Info

All 484 tests pass across 57 test files. vp check reports 0 errors and 0 warnings across 287 source files.

Checklist

  • All the automated tests pass or I explained why that is not possible
  • I have personally tested this on my machine or explained why that is not possible
  • I have included test coverage for these changes or explained why they are not needed

Programming Checklist
Interfaces:

  • Don't use default export
  • New interfaces are in model files

Functions:

  • Don't use default export
  • All function signatures have return types
  • Helpers should not access any data but rather be given the data to operate on.

Typescript:

  • No Typescript warnings
  • Avoid silencing null/undefined warnings with the exclamation point

Other:

  • Iteration: refrain from using elem of array syntax. Prefer forEach or use map
  • Avoid using global OneSignal accessor for context if possible. Instead, we can pass it to function/constructor so that we don't call OneSignal.context

Screenshots

Info

No UI changes — this is a toolchain migration and lint cleanup.

Checklist

  • I have included screenshots/recordings of the intended results or explained why they are not needed

Related Tickets


Base automatically changed from fadi/sdk-4201-add-vite-to-web-sdk to main March 24, 2026 00:27
@fadi-george fadi-george changed the title fix: resolve all lint warnings and remove vitest globals Migrate to Vite+ toolchain, fix all lint errors, and remove async from synchronous code Mar 24, 2026
@fadi-george fadi-george merged commit 4728ca1 into main Mar 24, 2026
3 of 4 checks passed
@fadi-george fadi-george deleted the fadi/vp-lint branch March 24, 2026 01:17
@fadi-george fadi-george changed the title Migrate to Vite+ toolchain, fix all lint errors, and remove async from synchronous code chore: Migrate to Vite+ toolchain, fix all lint errors, and remove async from synchronous code Mar 24, 2026
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.

2 participants