Skip to content

some node_modules files are scanned during typecheck #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Barzi-Ahmed opened this issue Feb 20, 2025 · 0 comments
Open

some node_modules files are scanned during typecheck #505

Barzi-Ahmed opened this issue Feb 20, 2025 · 0 comments

Comments

@Barzi-Ahmed
Copy link

Current Behavior

When adding the following safety options to tsconfig, and runnin typecheck command, it scans some One node_modules files while node_modules is explicitly being excluded. This is the complete tsconfig:

{
	"$schema": "https://json.schemastore.org/tsconfig",
	"compilerOptions": {
		"removeComments": true, 
		"allowUnreachableCode": false,
		"allowUnusedLabels": false,
		"allowImportingTsExtensions": false,
		"exactOptionalPropertyTypes": true,
		"noFallthroughCasesInSwitch": true,
		"noImplicitOverride": true,
		"noImplicitReturns": true,
		"noPropertyAccessFromIndexSignature": true,
		"noUncheckedIndexedAccess": true,
		"noUnusedLocals": true,
		"noUncheckedSideEffectImports": true,
		"noUnusedParameters": true,
		"strict": true,
		"forceConsistentCasingInFileNames": true,
		"verbatimModuleSyntax": true,
		"allowJs": false,
		"checkJs": false,
		"skipLibCheck": true,
		"resolveJsonModule": true,
		"isolatedModules": true,
		"incremental": true,
		"traceResolution": false,
		"target": "esnext",
		"moduleDetection": "force",
		"maxNodeModuleJsDepth": 0,
		"baseUrl": ".",
		"paths": {
			"~/*": [
				"./src/*"
			]
		},
		"rootDir": ".",
		"module": "Preserve",
		"moduleResolution": "Bundler",
		"preserveSymlinks": true,
		"jsx": "react-jsx",
		"types": [
			"node",
			"react",
			"vite/client"
		],
		"lib": [
			"dom",
			"esnext"
		]
	},
	"exclude": [
		"node_modules",
		".expo",
		"**/test",
		"**/dist",
		"**/types",
		"**/__tests__"
	]
}

Expected Behavior

Do not pick or scan any node_modules files when running typecheck command.

One Version

1.1.450

Platform (Web, iOS, Android)

Applicable to all.

Reproduction

Pretty easy to reproduce:
1. Create a new one project with "bun x one"
2. choose minimal tamagui template.
3. Choose bun as package manager.
4. Add the following options to tsconfig.json:


                "removeComments": true,
		"allowUnreachableCode": false,
		"allowUnusedLabels": false,
		"allowImportingTsExtensions": false,
		"exactOptionalPropertyTypes": true,
		"noFallthroughCasesInSwitch": true,
		"noImplicitOverride": true,
		"noImplicitReturns": true,
		"noPropertyAccessFromIndexSignature": true,
		"noUncheckedIndexedAccess": true,
		"noUnusedLocals": true,
		"noUncheckedSideEffectImports": true,
		"noUnusedParameters": true,
		"forceConsistentCasingInFileNames": true,
		"verbatimModuleSyntax": true,
		"allowJs": false,
		"checkJs": false,
		"resolveJsonModule": true,
		"isolatedModules": true,
		"incremental": true,
		"traceResolution": false,
		"target": "esnext",
		"moduleDetection": "force",
		"maxNodeModuleJsDepth": 0,


5. now run "bun run typecheck"
6. following error messages will appear:



../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:15:9 - error TS2538: Type 'undefined' cannot be used as an index type.

15     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:16:9 - error TS2538: Type 'undefined' cannot be used as an index type.

16     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:17:9 - error TS2538: Type 'undefined' cannot be used as an index type.

17     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:18:9 - error TS2538: Type 'undefined' cannot be used as an index type.

18     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:20:9 - error TS2538: Type 'undefined' cannot be used as an index type.

20     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:21:9 - error TS2538: Type 'undefined' cannot be used as an index type.

21     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:23:9 - error TS2538: Type 'undefined' cannot be used as an index type.

23     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:24:9 - error TS2538: Type 'undefined' cannot be used as an index type.

24     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:26:9 - error TS2538: Type 'undefined' cannot be used as an index type.

26     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:27:9 - error TS2538: Type 'undefined' cannot be used as an index type.

27     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:29:9 - error TS2538: Type 'undefined' cannot be used as an index type.

29     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:30:9 - error TS2538: Type 'undefined' cannot be used as an index type.

30     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:31:9 - error TS2538: Type 'undefined' cannot be used as an index type.

31     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:32:9 - error TS2538: Type 'undefined' cannot be used as an index type.

32     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:33:9 - error TS2538: Type 'undefined' cannot be used as an index type.

33     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/uuid/lib/bytesToUuid.ts:34:9 - error TS2538: Type 'undefined' cannot be used as an index type.

34     bth[buf[i++]],
           ~~~~~~~~

../../node_modules/expo-modules-core/src/web/CoreModule.ts:79:54 - error TS6133: 'eventName' is declared but its value is never read.

79   startObserving<EventName extends keyof TEventsMap>(eventName: EventName): void {}
                                                        ~~~~~~~~~

../../node_modules/expo-modules-core/src/web/CoreModule.ts:81:53 - error TS6133: 'eventName' is declared but its value is never read.

81   stopObserving<EventName extends keyof TEventsMap>(eventName: EventName): void {}
                                                       ~~~~~~~~~

../../node_modules/expo-modules-core/src/web/CoreModule.ts:84:14 - error TS2720: Class 'NativeModule<TEventsMap>' incorrectly implements class 'NativeModule<Record<never, never>>'. Did you mean to extend 'NativeModule<Record<never, never>>' and inherit its members as a subclass?
  Types of property 'ViewPrototype' are incompatible.
    Type 'object | undefined' is not assignable to type 'object'.
      Type 'undefined' is not assignable to type 'object'.

84 export class NativeModule<TEventsMap extends Record<never, never>>
                ~~~~~~~~~~~~

../../node_modules/expo-modules-core/src/web/index.web.ts:12:5 - error TS2322: Type 'typeof import("/Users/barziahmed/Desktop/monorepo/node_modules/expo-modules-core/src/web/CoreModule").NativeModule' is not assignable to type 'typeof import("/Users/barziahmed/Desktop/monorepo/node_modules/expo-modules-core/src/ts-declarations/NativeModule").NativeModule'.
  Construct signature return types 'NativeModule<any>' and 'NativeModule<any>' are incompatible.
    The types of 'ViewPrototype' are incompatible between these types.
      Type 'object | undefined' is not assignable to type 'object'.
        Type 'undefined' is not assignable to type 'object'.

12     NativeModule,
       ~~~~~~~~~~~~

  ../../node_modules/expo-modules-core/src/ts-declarations/global.ts:32:3
    32   NativeModule: typeof NativeModule;
         ~~~~~~~~~~~~
    The expected type comes from property 'NativeModule' which is declared here on type 'ExpoGlobal'

../../node_modules/expo-modules-core/src/web/index.web.ts:15:41 - error TS4111: Property 'expoModulesProxy' comes from an index signature, so it must be accessed with ['expoModulesProxy'].

15     modules: globalThis.ExpoDomWebView?.expoModulesProxy ?? {},

System Info

System:
    OS: macOS 15.3.1
    CPU: (10) arm64 Apple M4
    Memory: 3.15 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.13.1 - /opt/homebrew/opt/node@22/bin/node
    npm: 10.9.2 - /opt/homebrew/opt/node@22/bin/npm
    pnpm: 10.0.0 - /opt/homebrew/bin/pnpm
    bun: 1.2.2 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 133.0.6943.127
    Safari: 18.3
  npmPackages:
    one: 1.1.448 => 1.1.448
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

No branches or pull requests

1 participant