Typescript eslint - Missing file extension “ts” import/extensions

前端 未结 2 2001
孤城傲影
孤城傲影 2021-02-03 16:38

I have a simple Node/Express app made with Typescript. And eslint give me the error

Missing file extension "ts" for "./lib/env" import/extensi         


        
2条回答
  •  半阙折子戏
    2021-02-03 17:29

    Add the following code to rules:

    "rules": {
       "import/extensions": [
          "error",
          "ignorePackages",
          {
            "js": "never",
            "jsx": "never",
            "ts": "never",
            "tsx": "never"
          }
       ]
    }
    

    airbnb ESLint config leads the problem.

提交回复
热议问题