From 5bfbddb21bc81dd47698f0c8796d0c8dc0a498e0 Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Sat, 18 Nov 2023 14:26:42 +0000 Subject: [PATCH] fix: Warn on circular imports. (#3350) * As title. * Brings back color when running `yarn formatting` in root, really needed as we have many warnings, and without it it would be very hard to parse errors. We should chip away at these warning. ChatGPT does *not* think circular dependencies are cool. ![](https://github.com/AztecProtocol/aztec-packages/assets/5764343/34b109f4-d2df-4ebe-b423-65eedcc3d247) --- yarn-project/foundation/.eslintrc.cjs | 1 + yarn-project/package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/yarn-project/foundation/.eslintrc.cjs b/yarn-project/foundation/.eslintrc.cjs index d65d03151c5..31c960d6c12 100644 --- a/yarn-project/foundation/.eslintrc.cjs +++ b/yarn-project/foundation/.eslintrc.cjs @@ -111,6 +111,7 @@ module.exports = { }, ], 'import/no-extraneous-dependencies': 'error', + 'import/no-cycle': 'warn', 'tsdoc/syntax': JSDOC_RULES_LEVEL, 'jsdoc/require-jsdoc': [ JSDOC_RULES_LEVEL, diff --git a/yarn-project/package.json b/yarn-project/package.json index 3e85099f718..470d8799af1 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -6,8 +6,8 @@ "prepare": "node ./yarn-project-base/scripts/update_package_jsons.mjs && yarn workspaces foreach run prepare && workspaces-to-typescript-project-references --tsconfigPath tsconfig.json && prettier -w */tsconfig.json", "prepare:check": "node ./yarn-project-base/scripts/update_package_jsons.mjs --check && workspaces-to-typescript-project-references --check --tsconfigPath tsconfig.json", "docs": "typedoc --out docs/dist && cd docs && yarn serve", - "formatting": "yarn workspaces foreach -p -j unlimited -v run formatting", - "formatting:fix": "yarn workspaces foreach -p -v run formatting:fix", + "formatting": "FORCE_COLOR=true yarn workspaces foreach -p -j unlimited -v run formatting", + "formatting:fix": "FORCE_COLOR=true yarn workspaces foreach -p -v run formatting:fix", "lint": "yarn eslint --cache --ignore-pattern l1-artifacts .", "format": "yarn prettier --cache -w .", "test": "yarn workspaces foreach --exclude @aztec/aztec3-packages --exclude @aztec/end-to-end --exclude @aztec/canary --exclude private-token -p -j unlimited -v run test",