[SOLVED] Typescript eslint – Missing file extension "ts" import/extensions


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

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

Here is my .eslintrc file

  "extends": [
  "parser": "@typescript-eslint/parser",
  "plugins": ["@typescript-eslint", "prettier", "import"],
  "settings": {
    "import/extensions": [".js", ".jsx", ".ts", ".tsx"],
    "import/parsers": {
      "@typescript-eslint/parser": [".ts", ".tsx"]
    "import/resolver": {
      "typescript": {
        "directory": "./tsconfig.json"
      "node": {
        "extensions": [".js", ".jsx", ".ts", ".tsx"]
  "rules": {
    "@typescript-eslint/indent": [2, 2],
    "no-console": "off",
    "import/no-unresolved": [2, { "commonjs": true, "amd": true }],
    "import/named": 2,
    "import/namespace": 2,
    "import/default": 2,
    "import/export": 2

I have installed eslint-plugin-import & eslint-import-resolver-typescript.
And I cannot figure out why, I got that error.


Add the following code to rules:

"rules": {
   "import/extensions": [
        "js": "never",
        "jsx": "never",
        "ts": "never",
        "tsx": "never"

airbnb ESLint config leads the problem.

Answered By – superoryco

Answer Checked By – Marilyn (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *