Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Add stylelint-scss rules #124

Merged
merged 2 commits into from Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/checker.js
Expand Up @@ -17,10 +17,17 @@ function check(path) {
const configRules = config.config.rules;
const conflictingRules = [];

function isEmpty(value) {
return (
value === null ||
(Array.isArray(value) && value.length === 0)
);
}

Object.keys(prettierRules).forEach((rule) => {
if (
hasOwnProperty.call(configRules, rule) &&
configRules[rule] !== null &&
!isEmpty(configRules[rule]) &&
configRules[rule][0] !== prettierRules[rule]
) {
conflictingRules.push(rule);
Expand Down
15 changes: 15 additions & 0 deletions src/index.js
Expand Up @@ -124,5 +124,20 @@ module.exports = {

// prettier has its own quotes rule
'string-quotes': null,

'scss/at-else-closing-brace-newline-after': null,
'scss/at-else-closing-brace-space-after': null,
'scss/at-else-empty-line-before': null,
'scss/at-else-if-parentheses-space-before': null,
'scss/at-function-parentheses-space-before': null,
'scss/at-if-closing-brace-newline-after': null,
'scss/at-if-closing-brace-space-after': null,
'scss/at-mixin-parentheses-space-before': null,
'scss/dollar-variable-colon-newline-after': null,
'scss/dollar-variable-colon-space-after': null,
'scss/dollar-variable-colon-space-before': null,
'scss/operator-no-newline-after': null,
'scss/operator-no-newline-before': null,
'scss/operator-no-unspaced': null,
},
};