You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "CritasWang (via GitHub)" <gi...@apache.org> on 2026/09/11 04:14:43 UTC

[PR] chore: fix all ESLint errors [iotdb-client-nodejs]

CritasWang opened a new pull request, #30:
URL: https://github.com/apache/iotdb-client-nodejs/pull/30

   `npm run lint` fails on `develop` with **56 errors** (no CI job currently runs ESLint, so this has accumulated). This PR makes it pass.
   
   ### Changes
   
   **Unused code** — removed unused imports / locals:
   `src/client/ColumnDecoder.ts` (unused `logger`), `src/client/Session.ts` (unused `RedirectException`), `src/client/TableSessionPool.ts` (unused `TableTablet` / `TreeTablet` types), `benchmark/*` (dead `SENSOR_TYPES`, `cleanupSchema`, `runBatchBenchmark`, `loopStartTime`).
   
   **Unused catch bindings** — replaced with the optional catch binding (`catch (e) {}` -> `catch {}`) in `tests/e2e/*` and `benchmark/*`. No behaviour change; the two `TableSessionPool` cases that actually re-throw still keep their binding.
   
   **Real rule violations in `src/`**:
   - `src/client/Session.ts` — the variable-length branch of `getRowCount` declared `let count` inside a `case` (`no-case-declarations`); the body is now wrapped in a block.
   - `src/client/SessionDataSet.ts` — `new Promise((resolve, reject) => ...)` never used `reject`; the parameter is dropped.
   - `src/utils/ProcessCleanup.ts` — `NodeJS.Signals` was reported as `no-undef`. `no-undef` cannot resolve type namespaces coming from `@types/node`, so the `NodeJS` namespace is now declared in `eslint.config.mjs` (rather than disabling the rule for TypeScript files).
   
   **Examples** — `examples/*` constructed several sessions/pools purely to document the alternative constructor signatures and never used them. They are now closed in the existing `finally` blocks instead of being dropped, so the examples no longer leak connections and still show every construction style. The two demo helpers in `concurrent-operations.ts` and `selfSignedExample` in `ssl-connection.ts` are intentionally not called from `main()` (they need a live IoTDB); they are now exported so the unused-variable rule does not flag them.
   
   ### Verification
   
   - `npm run lint` -> **exit 0, 0 errors** (166 warnings remain, all `no-explicit-any`, which is configured as `warn`)
   - `npm run build` -> passes
   - `npm run test:unit` -> 12 suites / 173 tests pass
   - Changed tests and examples were type-checked explicitly with `tsc --noEmit --strict` (they are outside `tsconfig.json`'s `src` root, so the build never sees them)
   
   ### Notes
   
   - Type-checking `tests/` directly surfaces two **pre-existing** type errors unrelated to this change: `tests/e2e/Redirection.test.ts` (`maxRedirectRetries` is not part of `PoolConfig`) and `tests/unit/Config.test.ts` (`host`/`port` on `string | EndPoint`). Left untouched here; happy to fix in a follow-up.
   - The Dependabot alerts on `develop` are partly covered by the open PRs #24 (`brace-expansion`), #26 (`@humanfs/node`), #27 (`browserslist`) and #28 (`baseline-browser-mapping`). `js-yaml` (4 high + 2 medium) and `@babel/core` (1 low) currently have **no** PR; those are transitive devDependencies of the test tooling and can be handled separately to avoid conflicting lockfile edits.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: fix all ESLint errors [iotdb-client-nodejs]

Posted by "HTHou (via GitHub)" <gi...@apache.org>.
HTHou merged PR #30:
URL: https://github.com/apache/iotdb-client-nodejs/pull/30


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org