From e695dd48bcd2ec06abc637010e1ba2d5a801d484 Mon Sep 17 00:00:00 2001 From: Rajdeep Chandra Date: Mon, 11 Nov 2024 14:10:14 +0530 Subject: [PATCH 1/2] chore: added eslint plugin import check on missing dependencies --- tools/.eslintrc.json | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/.eslintrc.json b/tools/.eslintrc.json index 0f8451dd20..4c45b57ffc 100644 --- a/tools/.eslintrc.json +++ b/tools/.eslintrc.json @@ -10,7 +10,8 @@ "@typescript-eslint", "notice", "@spectrum-web-components", - "require-extensions" + "require-extensions", + "eslint-plugin-import" ], "extends": [ "plugin:@typescript-eslint/recommended", @@ -76,6 +77,21 @@ ] }, "overrides": [ + { + // Apply these rules only to .ts files, excluding .test.ts and .stories.ts + "files": ["*.ts"], + "excludedFiles": ["*.test.ts", "*.stories.ts"], + "rules": { + "import/no-extraneous-dependencies": [ + "error", + { + "devDependencies": false, + "optionalDependencies": false, + "peerDependencies": false + } + ] + } + }, { "files": ["*.test.ts", "*.stories.ts", "**/benchmark/*.ts"], "rules": { From f4ff726214d6e727bb1e6ffdec87d8b29dd24a08 Mon Sep 17 00:00:00 2001 From: Rajdeep Chandra Date: Thu, 21 Nov 2024 12:08:25 +0530 Subject: [PATCH 2/2] chore: updated tooling for linting --- tools/.eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/.eslintrc.json b/tools/.eslintrc.json index 4c45b57ffc..2d65622d52 100644 --- a/tools/.eslintrc.json +++ b/tools/.eslintrc.json @@ -80,7 +80,7 @@ { // Apply these rules only to .ts files, excluding .test.ts and .stories.ts "files": ["*.ts"], - "excludedFiles": ["*.test.ts", "*.stories.ts"], + "excludedFiles": ["**/*test*.ts", "**/*.stories.ts", "**/*.d.ts"], "rules": { "import/no-extraneous-dependencies": [ "error",