Search code examples
typescriptintellij-ideawebstormjetbrains-ide

disable change .ts to .js on autocomplete


[webstorm] How to disable the behavior of changing .ts to .js on autocomplete ?

Pure TS project (without generating any .js files, which already transform by esm loader)


Solution

  • How to disable the behavior of changing .ts to .js on autocomplete in WebStorm:

    1. Go to settings
      • macOS: WebStorm > Preferences (Cmd + ,)
      • Windows/Linux: File > Settings (Ctrl + Alt + S)
    2. Adjust TypeScript Autocomplete
      • Navigate to Editor > General > Auto Import and modify settings to prevent unwanted changes from .ts to .js.
    3. Check File Associations
      • Go to Editor > File Types and ensure .ts is correctly associated under TypeScript and not JavaScript.
    4. Manage File Watchers
      • Disable any TypeScript to JavaScript conversion in Tools > File Watchers if necessary.
    5. Confirm Changes and Restart
      • Click Apply or OK, then restart WebStorm to ensure settings take effect.