Skip to content

@stylexjs/babel-plugin type declarations: error TS2457: Type alias name cannot be 'number' #1383

@jfirebaugh

Description

@jfirebaugh

Describe the issue

package.json:

{
  "dependencies": {
    "@stylexjs/babel-plugin": "0.17.2"
  }
}

tsconfig.json:

{
    "compilerOptions": {
        "module": "node16",
        "moduleResolution": "node16",
        "target": "ES2020",
        "skipLibCheck": false
    }
}

stylex.ts:

import { Options } from '@stylexjs/babel-plugin'

TypeScript error:

node_modules/.pnpm/@[email protected]/node_modules/@stylexjs/babel-plugin/lib/shared/types/index.d.ts:190:21 - error TS2457: Type alias name cannot be 'number'.

190 export declare type number = typeof number;
                        ~~~~~~


Found 1 error in node_modules/.pnpm/@[email protected]/node_modules/@stylexjs/babel-plugin/lib/shared/types/index.d.ts:190

This can be worked around using "skipLibCheck": true, but that can also hide type errors in libraries that result in types unexpectedly being inferred as any.

Expected behavior

@stylexjs/babel-plugin can be imported cleanly without needing "skipLibCheck": true.

Steps to reproduce

See above.

Test case

No response

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions