Socket
Socket
Sign inDemoInstall

typescript-plugin-tsconfig-paths

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    typescript-plugin-tsconfig-paths

A typescript language service plugin that allows typescript paths to be used with all extensions.


Version published
Maintainers
1
Created

Readme

Source

typescript-plugin-tsconfig-paths

A typescript language service plugin that allows typescript paths to be used with all extensions.

Before:

scr-2

After:

scr-2

Table of contents

About this plugin

A typescript language service plugin that allows all extensions to use typescript paths. created because Typescript only implemented Tsconfig paths for typescript files only.

Note this plugin works within tsserver, it does not work within tsc and requires a separate alias setting in a bundler such as Webpack!

Installation

To install with npm:
npm install -D typescript-plugin-tsconfig-paths

To install with yarn;

yarn add -D typescript-plugin-tsconfig-paths

Once installed, add this plugin to your tsconfig.json:

{
    "compilerOptions": {
        "plugins": [{ "name": "typescript-plugin-tsconfig-paths" }]
    }
}

Options

OptionDefault valueDescription
extensions[".ts", ".tsx"]If a module does not have an extension, it will automatically attempt to add one, starting with the previous element.

Visual Studio Code

To activate this plugin in Visual Studio Code, put the following in .vscode/settings.json to change the behavior so that Vscode uses the Typescript of the workspace.
{
    "typescript.tsdk": "node_modules/typescript/lib"
}

Keywords

FAQs

Last updated on 27 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc