Skip to content

Commit

Permalink
Refactor stylelint configuration to use dynamic import for Prettier i…
Browse files Browse the repository at this point in the history
…ntegration
  • Loading branch information
Adamik10 committed Dec 30, 2024
1 parent 43b0115 commit c07d851
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions stylelint.config.cjs
Original file line number Diff line number Diff line change
@@ -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: []
}
}
}
};
};
})();

0 comments on commit c07d851

Please sign in to comment.