setting eslint to make absolute imports work

I would like absolute imports with @ to work in my project but when I set it to work imports like: import { z } from "zod"; stopped working. 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"
]
}
]
}
}
{
"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"
]
}
]
}
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server