Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
use import/no-restricted-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo committed Sep 24, 2021
1 parent a0016f7 commit 0b116af
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"plugins": ["jsdoc"],
"extends": [
"plugin:jsdoc/recommended",
"@nuxtjs/eslint-config-typescript"
"@nuxtjs/eslint-config-typescript",
"plugin:import/typescript"
],
"rules": {
"no-console": "off",
Expand All @@ -15,7 +16,26 @@
"jsdoc/require-jsdoc": "off",
"jsdoc/require-param": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-param-type": "off"
"jsdoc/require-param-type": "off",
"import/no-restricted-paths": ["error", {
"zones": [
{
"target": "packages/nuxt3/src/!(core)/**/*",
"from": "packages/nuxt3/src/core",
"message": "core should not directly import from modules."
},
{
"target": "packages/nuxt3/src/!(app)/**/*",
"from": "packages/nuxt3/src/app",
"message": "app should not directly import from modules."
},
{
"target": "packages/nitro",
"from": "packages/!(nitro)/**/*",
"message": "nitro should not directly import other packages."
}
]
}]
},
"settings": {
"jsdoc": {
Expand All @@ -31,24 +51,6 @@
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
},
{
"files": [
"packages/nuxt3/src/**/*"
],
"excludedFiles": [
"packages/nuxt3/src/*",
"packages/nuxt3/src/app/**/*",
"packages/nuxt3/src/core/**/*"
],
"rules": {
"no-restricted-imports": [ "error", {
"patterns": [{
"group": ["**/core", "**/app"],
"message": "Modules should not directly import from app and core."
}]
}]
}
}
]
}

0 comments on commit 0b116af

Please sign in to comment.