From c07d8514f25603bf273191f7fa5e2de0c184e518 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Mon, 30 Dec 2024 14:55:35 +0100 Subject: [PATCH] Refactor stylelint configuration to use dynamic import for Prettier integration --- stylelint.config.cjs | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/stylelint.config.cjs b/stylelint.config.cjs index 25085bbd3..6819e9d83 100644 --- a/stylelint.config.cjs +++ b/stylelint.config.cjs @@ -1,15 +1,22 @@ -module.exports = { - extends: [ - "stylelint-config-recommended-scss", - "stylelint-prettier/recommended", - "prettier" - ], - plugins: ["@namics/stylelint-bem"], - rules: { - "plugin/stylelint-bem-namics": { - namespaces: ["dpl-"], - patternPrefixes: [], - helperPrefixes: [] +module.exports = (async () => { + // eslint-disable-next-line import/no-extraneous-dependencies + const stylelintPrettierRecommended = await import( + "stylelint-prettier/recommended" + ); + + return { + extends: [ + "stylelint-config-recommended-scss", + stylelintPrettierRecommended.default, // Use the default export + "prettier" + ], + plugins: ["@namics/stylelint-bem"], + rules: { + "plugin/stylelint-bem-namics": { + namespaces: ["dpl-"], + patternPrefixes: [], + helperPrefixes: [] + } } - } -}; + }; +})();