Skip to content

Commit

Permalink
chore: forbid cross-app imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Jan 27, 2025
1 parent b5a26d4 commit 0742bca
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
12 changes: 11 additions & 1 deletion packages/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
module.exports = {
extends: ['next', 'turbo', 'prettier'],
plugins: ['no-only-tests', 'unused-imports'],
plugins: ['no-only-tests', 'unused-imports', 'import'],
rules: {
'arrow-body-style': ['error', 'as-needed'],
'no-only-tests/no-only-tests': 'error',
'@next/next/no-img-element': 'off',
'@next/next/no-html-link-for-pages': 'off',
'unused-imports/no-unused-imports': 'warn',
'import/no-restricted-paths': [
'error',
{
basePath: '../../apps/main/src',
zones: ['dex', 'dao', 'lend', 'loan'].map((from, _, targets) => ({
from,
target: targets.filter((a) => a !== from),
})),
},
],
},
parser: '@typescript-eslint/parser',
settings: {
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^2.1.2",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-no-only-tests": "^3.3.0",
"eslint-plugin-react": "7.36.1",
"eslint-plugin-unused-imports": "^3.2.0",
Expand Down
62 changes: 60 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8599,6 +8599,13 @@ __metadata:
languageName: node
linkType: hard

"@rtsao/scc@npm:^1.1.0":
version: 1.1.0
resolution: "@rtsao/scc@npm:1.1.0"
checksum: 10c0/b5bcfb0d87f7d1c1c7c0f7693f53b07866ed9fec4c34a97a8c948fb9a7c0082e416ce4d3b60beb4f5e167cbe04cdeefbf6771320f3ede059b9ce91188c409a5b
languageName: node
linkType: hard

"@rushstack/eslint-patch@npm:^1.3.3":
version: 1.10.3
resolution: "@rushstack/eslint-patch@npm:1.10.3"
Expand Down Expand Up @@ -12837,7 +12844,7 @@ __metadata:
languageName: node
linkType: hard

"array.prototype.findlastindex@npm:^1.2.3":
"array.prototype.findlastindex@npm:^1.2.3, array.prototype.findlastindex@npm:^1.2.5":
version: 1.2.5
resolution: "array.prototype.findlastindex@npm:1.2.5"
dependencies:
Expand Down Expand Up @@ -16766,6 +16773,7 @@ __metadata:
eslint-config-prettier: "npm:^9.1.0"
eslint-config-turbo: "npm:^2.1.2"
eslint-import-resolver-typescript: "npm:^3.6.3"
eslint-plugin-import: "npm:^2.31.0"
eslint-plugin-no-only-tests: "npm:^3.3.0"
eslint-plugin-react: "npm:7.36.1"
eslint-plugin-unused-imports: "npm:^3.2.0"
Expand Down Expand Up @@ -16887,6 +16895,18 @@ __metadata:
languageName: node
linkType: hard

"eslint-module-utils@npm:^2.12.0":
version: 2.12.0
resolution: "eslint-module-utils@npm:2.12.0"
dependencies:
debug: "npm:^3.2.7"
peerDependenciesMeta:
eslint:
optional: true
checksum: 10c0/4d8b46dcd525d71276f9be9ffac1d2be61c9d54cc53c992e6333cf957840dee09381842b1acbbb15fc6b255ebab99cd481c5007ab438e5455a14abe1a0468558
languageName: node
linkType: hard

"eslint-module-utils@npm:^2.7.4, eslint-module-utils@npm:^2.8.0":
version: 2.8.1
resolution: "eslint-module-utils@npm:2.8.1"
Expand Down Expand Up @@ -16938,6 +16958,35 @@ __metadata:
languageName: node
linkType: hard

"eslint-plugin-import@npm:^2.31.0":
version: 2.31.0
resolution: "eslint-plugin-import@npm:2.31.0"
dependencies:
"@rtsao/scc": "npm:^1.1.0"
array-includes: "npm:^3.1.8"
array.prototype.findlastindex: "npm:^1.2.5"
array.prototype.flat: "npm:^1.3.2"
array.prototype.flatmap: "npm:^1.3.2"
debug: "npm:^3.2.7"
doctrine: "npm:^2.1.0"
eslint-import-resolver-node: "npm:^0.3.9"
eslint-module-utils: "npm:^2.12.0"
hasown: "npm:^2.0.2"
is-core-module: "npm:^2.15.1"
is-glob: "npm:^4.0.3"
minimatch: "npm:^3.1.2"
object.fromentries: "npm:^2.0.8"
object.groupby: "npm:^1.0.3"
object.values: "npm:^1.2.0"
semver: "npm:^6.3.1"
string.prototype.trimend: "npm:^1.0.8"
tsconfig-paths: "npm:^3.15.0"
peerDependencies:
eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9
checksum: 10c0/e21d116ddd1900e091ad120b3eb68c5dd5437fe2c930f1211781cd38b246f090a6b74d5f3800b8255a0ed29782591521ad44eb21c5534960a8f1fb4040fd913a
languageName: node
linkType: hard

"eslint-plugin-jsx-a11y@npm:^6.7.1":
version: 6.8.0
resolution: "eslint-plugin-jsx-a11y@npm:6.8.0"
Expand Down Expand Up @@ -19725,6 +19774,15 @@ __metadata:
languageName: node
linkType: hard

"is-core-module@npm:^2.15.1":
version: 2.16.1
resolution: "is-core-module@npm:2.16.1"
dependencies:
hasown: "npm:^2.0.2"
checksum: 10c0/898443c14780a577e807618aaae2b6f745c8538eca5c7bc11388a3f2dc6de82b9902bcc7eb74f07be672b11bbe82dd6a6edded44a00cb3d8f933d0459905eedd
languageName: node
linkType: hard

"is-core-module@npm:^2.9.0":
version: 2.11.0
resolution: "is-core-module@npm:2.11.0"
Expand Down Expand Up @@ -22339,7 +22397,7 @@ __metadata:
languageName: node
linkType: hard

"object.groupby@npm:^1.0.1":
"object.groupby@npm:^1.0.1, object.groupby@npm:^1.0.3":
version: 1.0.3
resolution: "object.groupby@npm:1.0.3"
dependencies:
Expand Down

0 comments on commit 0742bca

Please sign in to comment.