From f55b1306196053f2e628d161c251277dc193c656 Mon Sep 17 00:00:00 2001 From: William Calderipe Date: Mon, 15 Jan 2024 09:53:45 +0100 Subject: [PATCH] Prevent relative imports in application projects only Change ESLint to enable the "no-relative-imports" rule exclusively for application projects, as the path "**/apps/**/*.ts" was ineffective in the root configuration file. This is a quick solution for immediate rule enforcement. --- .eslintrc.json | 12 ------------ apps/authz/.eslintrc.json | 9 ++++++++- apps/orchestration/.eslintrc.json | 9 ++++++++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index adbeb5fc0..4aeab7863 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,18 +21,6 @@ ] } }, - { - "files": ["**/apps/**/*.ts", "**/apps/**/*.tsx"], - "extends": ["plugin:@nx/typescript"], - "rules": { - "no-relative-import-paths/no-relative-import-paths": [ - "error", - { - "allowSameFolder": true - } - ] - } - }, { "files": ["*.ts", "*.tsx"], "extends": ["plugin:@nx/typescript"], diff --git a/apps/authz/.eslintrc.json b/apps/authz/.eslintrc.json index 9d9c0db55..2471ef597 100644 --- a/apps/authz/.eslintrc.json +++ b/apps/authz/.eslintrc.json @@ -8,7 +8,14 @@ }, { "files": ["*.ts", "*.tsx"], - "rules": {} + "rules": { + "no-relative-import-paths/no-relative-import-paths": [ + "error", + { + "allowSameFolder": true + } + ] + } }, { "files": ["*.js", "*.jsx"], diff --git a/apps/orchestration/.eslintrc.json b/apps/orchestration/.eslintrc.json index 9d9c0db55..2471ef597 100644 --- a/apps/orchestration/.eslintrc.json +++ b/apps/orchestration/.eslintrc.json @@ -8,7 +8,14 @@ }, { "files": ["*.ts", "*.tsx"], - "rules": {} + "rules": { + "no-relative-import-paths/no-relative-import-paths": [ + "error", + { + "allowSameFolder": true + } + ] + } }, { "files": ["*.js", "*.jsx"],