From 8661fc428d2aa263e82f27cbf69cc236d020a950 Mon Sep 17 00:00:00 2001 From: Julian Meinking <12785972+DrJume@users.noreply.github.com> Date: Thu, 27 Jun 2024 20:26:37 +0200 Subject: [PATCH] fix(eslint): cannot redefine plugin "unicorn" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * already set by `@​antfu/eslint-config` --- packages/eslint-config/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 583b1a4..fc2936b 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -56,7 +56,17 @@ export function eslintConfig( }) .prepend(github) .append(nuxt ? nuxtRules : []) - .append(unicorn && eslintPluginUnicorn.configs['flat/recommended']) + .append( + (async () => { + if (!unicorn) return + + /** @type import('eslint').Linter.FlatConfig */ + const unicornConfig = eslintPluginUnicorn.configs['flat/recommended'] + delete unicornConfig.plugins + + return unicornConfig + })(), + ) .append({ name: 'falcondev/rules', rules: {