Auto Import

productivity
imports
typescript
CUcursorteam

Description

Automatically imports modules when referenced in your code. This rule detects undefined variables and tries to find matching imports from your project or installed packages.

json
{
  "rules": [
    {
      "name": "Auto Import",
      "pattern": ".*\\.ts$|.*\\.tsx$|.*\\.js$|.*\\.jsx$",
      "commands": [
        {
          "title": "Auto Import",
          "command": "editor.action.autoImport",
          "when": "editorTextFocus && !editorReadonly"
        }
      ]
    }
  ]
}