0

I would like absolute imports with @ e.g. import { Example } from "@/features/file/example"; to work in my project but when I set it to work imports like: import { z } from "zod"; stopped working. Also eslint should: sort imports, ensure empty line after imports and functions definitions but these options seem to work fine for me. I already tried using typescript-eslint and eslint-import-resolver but if I managed to make imports with @ work then others stopped There us eslintrc code:

{
    "extends": [
        "next/core-web-vitals",
        "plugin:xstate/recommended",
        "plugin:prettier/recommended"
    ],
    // "plugins": ["import"],
    // "settings": {
    //     "import/resolver": {
    //         "alias": {
    //             "map": [["@", "./next"]],
    //             "extensions": [".ts", ".js", ".jsx", ".json"]
    //         }
    //     }
    // },
    "rules": {
        "import/order": [
            "error",
            {
                "groups": [
                    ["builtin", "external"],
                    "internal",
                    ["parent", "sibling", "index"]
                ],
                "newlines-between": "always"
            }
        ],
        // "import/no-relative-parent-imports": "error",
        "padding-line-between-statements": [
            "error",
            {
                "blankLine": "always",
                "prev": "*",
                "next": [
                    "export",
                    "cjs-export",
                    "function",
                    "class",
                    "multiline-expression"
                ]
            }
        ]
    }
}
Rolegur
  • 55
  • 7

0 Answers0