Add stricter compiler options - #103
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR enables stricter TypeScript and ESLint settings, converts interfaces to type aliases, updates discriminator construction, simplifies inferred typings, and makes small runtime-safe callback and property changes. ChangesTypeScript strictness and type-style migration
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
- Fix 10 ESLint errors surfaced by the stricter linting rules (non-null assertion, invalid void type, strict-boolean-expressions, class-literal-property-style, dynamic delete, extraneous static class) - Switch consistent-type-definitions to prefer type over interface, since interfaces don't get an implicit index signature the way type aliases do, which was causing real type errors (and, more importantly, was silently defeating attribute key/value type checking in getAttribute/setAttribute across the whole device hierarchy - K extended plain string instead of AttributeKeyOf<T>) - Remove now-unnecessary explicit index signatures and extends workarounds that were needed while interface was still enforced
- ObjectDiscriminator: convert from a static-only abstract base class (extended by DeviceDiscriminator/GenericDeviceAttributeDiscriminator overriding a static discriminatorMap) to a concrete class taking discriminatorMap via constructor, with the two former subclasses becoming pre-built exported instances instead. Removes the need for no-extraneous-class's allowStaticOnly. - BufferedDeviceUpdater.handleUpdate: no longer needs an explicit `this: void` parameter to satisfy unbound-method. Removes the need for no-invalid-void-type's allowAsThisParameter.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/device/protocol/virtual/audio/piperVirtualDeviceLogic.ts`:
- Line 110: Restore the abstract accessor contract by replacing the readonly
refreshInterval properties with getters returning the existing values: 175 in
src/device/protocol/virtual/audio/piperVirtualDeviceLogic.ts:110,
src/device/protocol/virtual/audio/ttsVirtualDeviceLogic.ts:83, and
src/device/protocol/virtual/display/displayVirtualDeviceLogic.ts:20; return 100
in
src/device/protocol/virtual/randomGenerator/randomGeneratorVirtualDeviceLogic.ts:27.
Update each virtual device logic class without changing the interval values.
In `@src/serialization/discriminator/objectDiscriminator.ts`:
- Around line 14-21: Update the application setup around the existing
createClassTransformerTypeDiscriminator call to use the exported configured
DeviceDiscriminator instance rather than constructing or referencing the former
default discriminator class. Invoke
createClassTransformerTypeDiscriminator('type') through that instance while
preserving the existing transformer configuration.
🪄 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 Plus
Run ID: 03fdac27-9221-4ef3-949e-bc8e523a7b80
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (60)
eslint.config.tspackage.jsonsrc/app.tssrc/automation/scriptRuntime.tssrc/automation/scriptVm.tssrc/automation/scriptVmFactory.tssrc/controller/automation/createScriptController.tssrc/controller/automation/deleteScriptController.tssrc/controller/automation/getScriptController.tssrc/controller/controllerInterface.tssrc/controller/getDeviceController.tssrc/device/attribute/listDeviceAttribute.tssrc/device/bleDevice.tssrc/device/detectedDeviceOfferQueue.tssrc/device/deviceManager.tssrc/device/genericDeviceUpdater.tssrc/device/protocol/airotic/airoticDevice.tssrc/device/protocol/deviceProtocol.tssrc/device/protocol/estim2b/estim2bDevice.tssrc/device/protocol/estim2b/estim2bProtocol.tssrc/device/protocol/messageResponseHandler.tssrc/device/protocol/slvCtrlPlus/slvCtrlProtocol.tssrc/device/protocol/slvCtrlPlus/slvCtrlProtocolLegacy.tssrc/device/protocol/virtual/audio/piperVirtualDeviceLogic.tssrc/device/protocol/virtual/audio/ttsVirtualDeviceLogic.tssrc/device/protocol/virtual/display/displayVirtualDeviceLogic.tssrc/device/protocol/virtual/genericVirtualDeviceFactory.tssrc/device/protocol/virtual/randomGenerator/randomGeneratorVirtualDeviceLogic.tssrc/device/protocol/virtual/virtualDeviceFactory.tssrc/device/protocol/virtual/virtualDeviceLogicFactory.tssrc/device/protocol/zc95/zc95Device.tssrc/device/protocol/zc95/zc95MessageFactory.tssrc/device/protocol/zc95/zc95Protocol.tssrc/device/protocol/zc95/zc95SerialDeviceProvider.tssrc/device/provider/deviceProvider.tssrc/device/provider/deviceProviderFactory.tssrc/device/provider/deviceProviderManager.tssrc/device/transport/bleDeviceTransport.tssrc/device/transport/deviceBidirectionalTransport.tssrc/device/transport/deviceReadableTransport.tssrc/device/transport/deviceWritableTransport.tssrc/device/transport/serialPortObserver.tssrc/device/updater/bufferedDeviceUpdater.tssrc/device/updater/deviceUpdaterInterface.tssrc/entity/deviceList.tssrc/health/serializedTypes.tssrc/logging/Logger.tssrc/repository/automationScriptRepositoryInterface.tssrc/repository/deviceRepositoryInterface.tssrc/serial/frameParser.tssrc/serialization/discriminator/deviceDiscriminator.tssrc/serialization/discriminator/genericDeviceAttributeDiscriminator.tssrc/serialization/discriminator/objectDiscriminator.tssrc/settings/deviceSource.tssrc/settings/knownDevice.tssrc/socket/types.tssrc/types.d.tssrc/util/async.tssrc/util/devNullStream.tstsconfig.json
Fixes #73 and #61
Summary by CodeRabbit