From 3f436af0de74150e149cab2f3d9843534d6ad977 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Wed, 5 Jun 2024 15:15:37 +1200 Subject: [PATCH] ENH Update stylelint rules --- .stylelintrc.js | 34 +++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.stylelintrc.js b/.stylelintrc.js index 128a93b..a241533 100644 --- a/.stylelintrc.js +++ b/.stylelintrc.js @@ -1,5 +1,4 @@ module.exports = { - 'defaultSeverity': 'warning', 'extends': [ 'stylelint-config-recommended-scss', 'stylelint-config-sass-guidelines', @@ -31,7 +30,7 @@ module.exports = { } ], 'selector-max-id': 2, - 'selector-max-compound-selectors': 5, + 'selector-max-compound-selectors': 6, 'selector-pseudo-element-colon-notation': 'single', 'no-descending-specificity': [ true, @@ -73,7 +72,30 @@ module.exports = { ] } ], - + 'at-rule-no-unknown': [ + true, + { + // Allow sass at-rules - see https://sass-lang.com/documentation/at-rules/ + 'ignoreAtRules': [ + 'at-root', + 'debug', + 'each', + 'else', + 'error', + 'extend', + 'for', + 'forward', + 'function', + 'if', + 'import', + 'include', + 'mixin', + 'use', + 'warn', + 'while', + ] + } + ], 'comment-no-empty': true, 'declaration-block-no-duplicate-properties': true, 'no-irregular-whitespace': true, @@ -86,14 +108,16 @@ module.exports = { } ], 'font-family-name-quotes': 'always-unless-keyword', - // Turn off rules + // Turn off rules 'selector-class-pattern': null, + 'selector-id-pattern': null, 'function-no-unknown': null, 'property-no-vendor-prefix': null, 'value-no-vendor-prefix': null, 'font-family-no-missing-generic-family-keyword': null, 'scss/dollar-variable-colon-space-after': null, 'scss/no-global-function-names': null, - 'value-keyword-case': null + 'value-keyword-case': null, + 'media-query-no-invalid': null, } }; diff --git a/package.json b/package.json index 69b152c..661b658 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@silverstripe/eslint-config", - "version": "1.2.1", + "version": "1.3.0", "description": "SilverStripe config files for eslint", "engines": { "node": ">=18.x"