Search code examples
javascripttypescriptintellij-idea

Intellij - how to get rid of extension when auto-import


When I type something like

const func = myFuncti..;

It will suggest myFunction(), and I accept that.

Afterward the import will be like

import {myFunction} from '../myFunction.ts`;

I want to get rid of the ts, so it becomes

import {myFunction} from '../myFunction`;

How to do it?


Solution

  • Turns out it's a problem of tsconfig.json

    After changing allowImportingTsExtensions to false, problem solved.