Quality: Entry-point scripts disable all TypeScript checking#1770
Open
tuanaiseo wants to merge 1 commit into
Open
Conversation
The Node entrypoints use `// @ts-nocheck`, which suppresses all static checks in executable startup code. This can hide runtime-affecting mistakes in critical bootstrap paths. Affected files: index.js Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
DetachHead
reviewed
Apr 7, 2026
Comment on lines
-2
to
-3
| /* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
| // @ts-nocheck |
Owner
There was a problem hiding this comment.
this doesn't seem to have any effect. removing this comment should cause type errors on the untyped assignment to global below but it doesn't. you probably need to include the .js file in tsconfig.json
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: core (https://github.com/home-assistant/core)
+
+ <--- Last few GCs --->
+
+ [5221:0x18d6e030] 3391896 ms: Scavenge 3412.3 (4130.8) -> 3404.8 (4130.8) MB, 6.02 / 0.00 ms (average mu = 0.098, current mu = 0.000) allocation failure;
+ [5221:0x18d6e030] 3391917 ms: Scavenge 3412.5 (4130.8) -> 3404.9 (4130.8) MB, 6.09 / 0.00 ms (average mu = 0.098, current mu = 0.000) allocation failure;
+ [5221:0x18d6e030] 3391943 ms: Scavenge 3412.7 (4130.8) -> 3404.9 (4146.8) MB, 7.12 / 0.00 ms (average mu = 0.098, current mu = 0.000) allocation failure;
+
+
+ <--- JS stacktrace --->
+
+ FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
+ ----- Native stack trace -----
+
+ 1: 0xb78db3 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
+ 2: 0xee8300 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
+ 3: 0xee85e7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
+ 4: 0x10fb205 [node]
+ 5: 0x1113088 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
+ 6: 0x10e91f1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
+ 7: 0x10ea385 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
+ 8: 0x10c78d6 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
+ 9: 0x15247d6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
+ 10: 0x7f2102e9a476
+ Aborted (core dumped)
- .../projects/core/homeassistant/__main__.py
- .../projects/core/homeassistant/__main__.py:32:13 - warning: Implicit string concatenation not allowed (reportImplicitStringConcatenation)
- .../projects/core/homeassistant/__main__.py:62:17 - warning: Implicit string concatenation not allowed (reportImplicitStringConcatenation)
- .../projects/core/homeassistant/__main__.py:88:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:89:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:96:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:101:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:104:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:109:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:114:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:122:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:125:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:131:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:137:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:140:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:143:5 - warning: Result of call expression is of type "Action" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:159:13 - warning: Result of call expression is of type "int | Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:165:9 - warning: Result of call expression is of type "int | Any" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
- .../projects/core/homeassistant/__main__.py:174:12 - warning: Type of "ignore_os_check" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:177:8 - warning: Type of "script" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:180:28 - warning: Type of "script" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:180:28 - warning: Argument type is Any
- Argument corresponds to parameter "args" in function "run" (reportAny)
- .../projects/core/homeassistant/__main__.py:182:60 - warning: Type of "config" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:182:60 - warning: Argument type is Any
- Argument corresponds to parameter "paths" in function "join" (reportAny)
- .../projects/core/homeassistant/__main__.py:200:21 - warning: Type of "verbose" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:200:21 - warning: Argument type is Any
- Argument corresponds to parameter "verbose" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:201:29 - warning: Type of "log_rotate_days" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:201:29 - warning: Argument type is Any
- Argument corresponds to parameter "log_rotate_days" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:202:22 - warning: Type of "log_file" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:202:22 - warning: Argument type is Any
- Argument corresponds to parameter "log_file" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:203:26 - warning: Type of "log_no_color" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:203:26 - warning: Argument type is Any
- Argument corresponds to parameter "log_no_color" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:204:22 - warning: Type of "skip_pip" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:204:22 - warning: Argument type is Any
- Argument corresponds to parameter "skip_pip" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:205:31 - warning: Type of "skip_pip_packages" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:205:31 - warning: Argument type is Any
- Argument corresponds to parameter "skip_pip_packages" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:206:27 - warning: Type of "recovery_mode" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:206:27 - warning: Argument type is Any
- Argument corresponds to parameter "recovery_mode" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:207:19 - warning: Type of "debug" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:207:19 - warning: Argument type is Any
- Argument corresponds to parameter "debug" in function "__init__" (reportAny)
- .../projects/core/homeassistant/__main__.py:208:21 - warning: Type of "open_ui" is Any (reportAny)
- .../projects/core/homeassistant/__main__.py:208:21 - warning: Argument type is Any
- Argument corresponds to parameter "open_ui" in function "__init__" (reportAny)
- .../projects/core/homeassistant/auth/__init__.py
- .../projects/core/homeassistant/auth/__init__.py: error: Cycle detected in import chain
- .../projects/core/homeassistant/auth/__init__.py
- .../projects/core/homeassistant/core.py
- .../projects/core/homeassistant/exceptions.py
- .../projects/core/homeassistant/helpers/translation.py
- .../projects/core/homeassistant/loader.py
- .../projects/core/homeassistant/config_entries.py
- .../projects/core/homeassistant/helpers/device_registry.py
- .../projects/core/homeassistant/helpers/entity_registry.py
- .../projects/core/homeassistant/helpers/event.py
- .../projects/core/homeassistant/helpers/template/__init__.py
- .../projects/core/homeassistant/helpers/template/helpers.py
- .../projects/core/homeassistant/helpers/area_registry.py
- .../projects/core/homeassistant/components/sensor/__init__.py
- .../projects/core/homeassistant/helpers/entity.py
- /tmp/mypy_primer/projects/core/homeassistant/core_config.py (reportImportCycles)
- .../projects/core/homeassistant/auth/__init__.py: error: Cycle detected in import chain
- .../projects/core/homeassistant/auth/__init__.py
- .../projects/core/homeassistant/core.py
- .../projects/core/homeassistant/exceptions.py
- .../projects/core/homeassistant/helpers/translation.py
- .../projects/core/homeassistant/loader.py
- .../projects/core/homeassistant/config_entries.py
... (truncated 555906 lines) ...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Node entrypoints use
// @ts-nocheck, which suppresses all static checks in executable startup code. This can hide runtime-affecting mistakes in critical bootstrap paths.Severity:
mediumFile:
packages/pyright/index.jsSolution
Remove
@ts-nocheckand either migrate these files to typed.tswrappers or keep them as.jswith targeted ESLint/TS suppressions only where needed.Changes
packages/pyright/index.js(modified)Testing