Skip to content

Quality: Entry-point scripts disable all TypeScript checking#1770

Open
tuanaiseo wants to merge 1 commit into
DetachHead:mainfrom
tuanaiseo:contribai/improve/quality/entry-point-scripts-disable-all-typescri
Open

Quality: Entry-point scripts disable all TypeScript checking#1770
tuanaiseo wants to merge 1 commit into
DetachHead:mainfrom
tuanaiseo:contribai/improve/quality/entry-point-scripts-disable-all-typescri

Conversation

@tuanaiseo
Copy link
Copy Markdown

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: medium
File: packages/pyright/index.js

Solution

Remove @ts-nocheck and either migrate these files to typed .ts wrappers or keep them as .js with targeted ESLint/TS suppressions only where needed.

Changes

  • packages/pyright/index.js (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

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>
Comment thread packages/pyright/index.js
Comment on lines -2 to -3
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

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) ...

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