From 8cc5b7f247bef5d806695d149e3046f19b58d2a4 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 24 May 2024 20:12:43 -0400 Subject: [PATCH] Resolve other plugins as siblings to this plugin (#342) Co-authored-by: Wei Wang --- .changeset/tasty-eels-watch.md | 5 +++++ lib/utils/get-auto-jsonc-rules-config/index.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/tasty-eels-watch.md diff --git a/.changeset/tasty-eels-watch.md b/.changeset/tasty-eels-watch.md new file mode 100644 index 00000000..21751cfd --- /dev/null +++ b/.changeset/tasty-eels-watch.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-jsonc": minor +--- + +Resolve other plugins relative to this one (as siblings) diff --git a/lib/utils/get-auto-jsonc-rules-config/index.ts b/lib/utils/get-auto-jsonc-rules-config/index.ts index caf8a5f3..ce2ab899 100644 --- a/lib/utils/get-auto-jsonc-rules-config/index.ts +++ b/lib/utils/get-auto-jsonc-rules-config/index.ts @@ -47,6 +47,8 @@ function getConfigResolver( "../../../conf/eslint-recommended.js", ), eslintAllPath: require.resolve("../../../conf/eslint-all.js"), + // other plugins should be resolved as siblings to this one + resolvePluginsRelativeTo: resolve(__dirname, "../../../../../"), }); return (configResolvers[cwd] = (filePath: string) => { const absolutePath = resolve(cwd, filePath);