Skip to content

@typescript/ata should support npm: specifiers #3314

Open
@steveluscher

Description

@steveluscher

Keywords: Automatic Type Acquisition, npm

I would like to produce a TypeScript playground using a particular version of a package. The suggestion is to support npm: package specifiers in import, like Deno does.

import { IInstruction, address } from 'npm:@solana/web3.js@2';

// @ts-expect-error
const ix: IInstruction = {
    keys: [],
    programAddress: address('abc'),
}
Output
import { address } from 'npm:@solana/web3.js@2';
// @ts-expect-error
const ix = {
    keys: [],
    programAddress: address('abc'),
};
Compiler Options
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "target": "ES2017",
    "jsx": "react",
    "module": "ESNext",
    "moduleResolution": "node"
  }
}

Playground Link: Provided

Adjacent to #3202.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions