diff --git a/.sass-lint.yml b/.sass-lint.yml deleted file mode 100644 index 057a324..0000000 --- a/.sass-lint.yml +++ /dev/null @@ -1,97 +0,0 @@ -# sass-lint config to match the AirBNB style guide -# See silverstripe-admin -files: - include: client/src/**/*.scss' -options: - formatter: stylish - merge-default-rules: false -rules: - # Warnings - # Things that require actual refactoring are marked as warnings - class-name-format: - - 1 - - convention: hyphenatedbem - placeholder-name-format: - - 1 - - convention: hyphenatedlowercase - nesting-depth: - - 1 - - max-depth: 3 - no-ids: 1 - no-important: 1 - no-misspelled-properties: - - 1 - - extra-properties: - - "-moz-border-radius-topleft" - - "-moz-border-radius-topright" - - "-moz-border-radius-bottomleft" - - "-moz-border-radius-bottomright" - variable-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - no-extends: 1 - - # Warnings: these things are preferential rather than mandatory - no-css-comments: 1 - - # Errors - # Things that can be easily fixed are marked as errors - indentation: - - 2 - - size: 2 - final-newline: - - 2 - - include: true - no-trailing-whitespace: 2 - border-zero: - - 2 - - convention: '0' - brace-style: - - 2 - - allow-single-line: true - clean-import-paths: - - 2 - - filename-extension: false - leading-underscore: false - no-debug: 2 - no-empty-rulesets: 2 - no-invalid-hex: 2 - no-mergeable-selectors: 2 - # no-qualifying-elements: - # - 1 - # - allow-element-with-attribute: false - # allow-element-with-class: false - # allow-element-with-id: false - no-trailing-zero: 2 - no-url-protocols: 2 - quotes: - - 2 - - style: double - space-after-bang: - - 2 - - include: false - space-after-colon: - - 2 - - include: true - space-after-comma: - - 2 - - include: true - space-before-bang: - - 2 - - include: true - space-before-brace: - - 2 - - include: true - space-before-colon: 2 - space-between-parens: - - 2 - - include: false - trailing-semicolon: 2 - url-quotes: 2 - zero-unit: 2 - single-line-per-selector: 2 - one-declaration-per-line: 2 - empty-line-between-blocks: - - 2 - - ignore-single-line-rulesets: true \ No newline at end of file diff --git a/.stylelintrc.yml b/.stylelintrc.yml new file mode 100644 index 0000000..a89a8bb --- /dev/null +++ b/.stylelintrc.yml @@ -0,0 +1,72 @@ +defaultSeverity: warning +extends: + - stylelint-config-recommended-scss + - stylelint-config-sass-guidelines + - stylelint-config-standard +plugins: + - stylelint-scss +rules: + # Line Spacing + rule-empty-line-before: + - always-multi-line + - ignore: + - after-comment + - first-nested + - inside-block + # Selector rules + selector-no-qualifying-type: + - true + - ignore: + - attribute + - class + selector-max-id: 2 + selector-max-compound-selectors: 5 + selector-pseudo-element-colon-notation: + - single + no-descending-specificity: + - true + - ignore: + - selectors-within-list + max-nesting-depth: + - 3 + - ignore: + - blockless-at-rules + - pseudo-classes + # Color rules + color-function-notation: + - legacy + alpha-value-notation: + - number + number-max-precision: 5 + color-named: + - never + - ignore: + - inside-function + # Common rules + function-url-quotes: always + import-notation: string + annotation-no-unknown: + - true + - ignoreAnnotations: + - 'default' + comment-no-empty: + - true + declaration-block-no-duplicate-properties: + - true + no-irregular-whitespace: + - true + block-no-empty: + - true + - ignore: + - comments + font-family-name-quotes: + - always-unless-keyword + # Turn off rules + selector-class-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 diff --git a/package.json b/package.json index a66565d..61fc216 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "NODE_ENV=development webpack --progress", "watch": "yarn && NODE_ENV=development webpack --watch --progress", "css": "WEBPACK_CHILD=css npm run build", - "lint": "eslint client/src; sass-lint -v" + "lint": "eslint client/src; stylelint client/src/**/*.scss" }, "repository": { "type": "git", @@ -34,7 +34,7 @@ }, "devDependencies": { "@silverstripe/eslint-config": "^1.1.0", - "@silverstripe/webpack-config": "^2.0.0", + "@silverstripe/webpack-config": "^2.0.3", "webpack": "^5.74.0", "webpack-cli": "^5.0.0" },