Skip to content

Exclude packages from intellisense #54135

Closed

Description

@thany

I'd like to excludes packages (whether from @types or not) from intellisense.

Use-case: in a Next.js project, you'll have typings for Node.js. And then even when you're not in server context, but instead are writing typescript meant to run in the browser, typing log will yield:

image

That's annoying, and you'd almost never want that one anyway. Not even when writing serverside code.

I've tried fiddling with tsconfig to no avail, looking around in editor.suggestions settings, but there's only options for reordering. I would like a way to exclude stuff there.

In this particular case, I would like to exclude the console package, or maybe just all Node.js related packages.

Current workaround is to use the setting "editor.snippetSuggestions": "top".
This achieves the goal of being able to go l o g Enter and end up writing a console.log( );

But it's only a workaround, because the offending package is still there, and this problem might very well occur for other suggestions. I guess the bottomline is, I don't want suggestions for Node.js packages when writing browser code.

Activity

  1. removed their assignment
    on May 4, 2023
  2. RyanCavanaugh commented on May 4, 2023

    @RyanCavanaugh
    Member

    This is supported, see #49578

  3. typescript-bot commented on May 7, 2023

    @typescript-bot
    Contributor

    This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow or the TypeScript Discord community.

  4. thany commented on May 8, 2023

    @thany
    Author

    In that case it doesn't seem to be working:

    "typescript.preferences.autoImportFileExcludePatterns": [
        "console"
    ]

    Even when expanding to all apparent possible ways to find it:

    "typescript.preferences.autoImportFileExcludePatterns": [
        "console",
        "**/console",
        "/**/console",
        "*/**/console",
        "/*/**/console"
    ]

    So let's not be too sure about this issue being a question, before it actually works 😊

  5. RyanCavanaugh commented on May 8, 2023

    @RyanCavanaugh
    Member

    Please file bug report using the template if you believe you have a bug. Thanks!

  6. thany commented on May 10, 2023

    @thany
    Author

    I'm not going to create another issue if a perfectly good one already exists.

    If this can't be a feature request, then consider it a bug report. If you need more information, do ask.

  7. RyanCavanaugh commented on May 10, 2023

    @RyanCavanaugh
    Member

    To expedite the triage process, we need everyone to follow the issue template and instructions.

    When you clicked "Create New Issue", the issue form was pre-populated with a template and some instructions. We need you to read those instructions completely, follow them, and then fill in all the fields in that template.

    We are not able to assist with issues that don't follow the template instructions as they represent a significantly larger amount of work compared to issues which are correctly specified. Thank you for understanding.

  8. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions