├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── code-scanning.yml │ ├── lint.yml │ └── test.yml ├── .gitignore ├── .npmrc ├── .prettierignore ├── .prettierrc.json ├── .remarkrc.json ├── .stylelintrc.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── __tests__ ├── index.test.mjs ├── invalid.scss └── valid.scss ├── eslint.config.mjs ├── index.js ├── package-lock.json └── package.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Enforce Unix newlines 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: 'github-actions' 4 | directory: '/' 5 | schedule: 6 | interval: monthly 7 | - package-ecosystem: 'npm' 8 | directory: '/' 9 | schedule: 10 | interval: monthly 11 | versioning-strategy: increase 12 | -------------------------------------------------------------------------------- /.github/workflows/code-scanning.yml: -------------------------------------------------------------------------------- 1 | name: 'Code Scanning' 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - '!dependabot/**' 8 | pull_request: 9 | branches: 10 | - master 11 | - '!dependabot/**' 12 | schedule: 13 | - cron: '0 7 * * 1' 14 | workflow_dispatch: 15 | 16 | jobs: 17 | analyze: 18 | name: Analyze 19 | runs-on: ubuntu-latest 20 | permissions: 21 | actions: read 22 | contents: read 23 | security-events: write 24 | 25 | steps: 26 | - name: Checkout repository 27 | uses: actions/checkout@v4 28 | with: 29 | persist-credentials: false 30 | 31 | - name: Initialize CodeQL 32 | uses: github/codeql-action/init@v3 33 | with: 34 | languages: 'javascript' 35 | queries: +security-and-quality 36 | 37 | - name: Autobuild 38 | uses: github/codeql-action/autobuild@v3 39 | 40 | - name: Perform CodeQL Analysis 41 | uses: github/codeql-action/analyze@v3 42 | with: 43 | category: '/language:javascript' 44 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - '!dependabot/**' 8 | pull_request: 9 | workflow_dispatch: 10 | 11 | env: 12 | FORCE_COLOR: 2 13 | NODE: 20 14 | 15 | permissions: 16 | contents: read 17 | 18 | jobs: 19 | lint: 20 | runs-on: ubuntu-latest 21 | 22 | steps: 23 | - name: Clone repository 24 | uses: actions/checkout@v4 25 | with: 26 | persist-credentials: false 27 | 28 | - name: Set up Node.js 29 | uses: actions/setup-node@v4 30 | with: 31 | node-version: '${{ env.NODE }}' 32 | cache: npm 33 | 34 | - name: Install npm dependencies 35 | run: npm ci 36 | 37 | - name: Lint 38 | run: npm run lint 39 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | - '!dependabot/**' 8 | pull_request: 9 | workflow_dispatch: 10 | 11 | env: 12 | FORCE_COLOR: 2 13 | 14 | permissions: 15 | contents: read 16 | 17 | jobs: 18 | run: 19 | name: Node ${{ matrix.node }} on ${{ matrix.os }} 20 | runs-on: ${{ matrix.os }} 21 | 22 | strategy: 23 | fail-fast: false 24 | matrix: 25 | node: [20] 26 | os: [ubuntu-latest, windows-latest, macos-latest] 27 | 28 | steps: 29 | - name: Clone repository 30 | uses: actions/checkout@v4 31 | with: 32 | persist-credentials: false 33 | 34 | - name: Set up Node.js 35 | uses: actions/setup-node@v4 36 | with: 37 | node-version: ${{ matrix.node }} 38 | cache: npm 39 | 40 | - name: Install npm dependencies 41 | run: npm ci 42 | 43 | - name: Run tests 44 | run: npm test 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | lockfile-version=2 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /__tests__/*.scss 2 | /package.json 3 | /package-lock.json 4 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | "@stylelint/prettier-config" 2 | -------------------------------------------------------------------------------- /.remarkrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@stylelint/remark-preset"] 3 | } 4 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["."] 3 | } 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 15.0.1 2 | 3 | - Fixed: change minimum supported Node.js version to `20`. 4 | 5 | # 15.0.0 6 | 7 | - Changed: updated to [`stylelint-config-recommended@16.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/16.0.0). 8 | - Changed: updated to [`stylelint-scss@6.12.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v6.12.0). 9 | - Removed: `stylelint` less than `16.16.0` from peer dependencies. 10 | - Removed: Node.js less than `22` support. 11 | 12 | # 14.1.0 13 | 14 | - Changed: replaced deprecated `scss/at-import-partial-extension` rule with `scss/load-partial-extension` rule. 15 | - Changed: updated to [`stylelint-scss@6.4.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v6.4.0). 16 | 17 | # 14.0.0 18 | 19 | - Changed: updated to [`stylelint-config-recommended@14.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/14.0.0). 20 | - Changed: updated to [`stylelint-scss@6.0.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v6.0.0). 21 | - Removed: `stylelint` less than `16.0.2` from peer dependencies. 22 | - Removed: Node.js less than `18.12.0` support. 23 | 24 | # 13.1.0 25 | 26 | - Changed: replaced deprecated `scss/at-import-no-partial-leading-underscore` rule with `scss/load-no-partial-leading-underscore` rule. 27 | - Changed: updated to [`stylelint-scss@5.3.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v5.3.0). 28 | 29 | # 13.0.0 30 | 31 | - Changed: updated to [`stylelint-config-recommended@13.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/13.0.0). 32 | - Changed: updated to [`stylelint-scss@5.1.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v5.1.0). 33 | - Removed: `stylelint` less than `15.10.0` from peer dependencies. 34 | 35 | # 12.0.0 36 | 37 | - Changed: updated to [`stylelint-scss@5.0.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v5.0.0). 38 | 39 | # 11.0.0 40 | 41 | - Changed: updated to [`stylelint-config-recommended@12.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/12.0.0). 42 | - Removed: `stylelint` less than `15.5.0` from peer dependencies. 43 | 44 | # 10.0.0 45 | 46 | - Changed: updated to [`stylelint-config-recommended@11.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/11.0.0). 47 | - Removed: `stylelint` less than `15.3.0` from peer dependencies. 48 | 49 | # 9.0.1 50 | 51 | - Fixed: disabled `annotation-no-unknown` rule because of false positives. 52 | 53 | # 9.0.0 54 | 55 | - Changed: updated to [`stylelint-config-recommended@10.0.1`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/10.0.1). 56 | - Changed: updated to [`stylelint-scss@4.4.0`](https://github.com/stylelint-scss/stylelint-scss/releases/tag/v4.4.0). 57 | - Changed: updated stylelint peer dependency to `^15.0.0`. 58 | 59 | # 8.0.0 60 | 61 | - Changed: updated to [`stylelint-config-recommended@9.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/9.0.0). 62 | - Changed: updated stylelint peer dependency to `^14.10.0`. 63 | - Added: `postcss` as an optional peer dependency. 64 | - Fixed: `annotation-no-unknown` allow `!default` and `!global`. 65 | 66 | # 7.0.0 67 | 68 | - Changed: updated to [`stylelint-config-recommended@8.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/8.0.0). 69 | 70 | # 6.0.0 71 | 72 | - Changed: updated to [`stylelint-config-recommended@7.0.0`](https://github.com/stylelint/stylelint-config-recommended/releases/tag/7.0.0). 73 | - Changed: updated stylelint peer dependency to `^14.4.0`. 74 | - Fixed: disabled function-no-unknown rule. 75 | - Fixed: `no-invalid-position-at-import-rule` allow `@forward` before `@import`. 76 | 77 | # 5.0.2 78 | 79 | - Fixed: resolution of `postcss-scss` custom syntax when `postcss@7` is in the tree. 80 | 81 | # 5.0.1 82 | 83 | - Fixed: turn off the `comment-no-empty` rule when `scss/comment-no-empty` is enabled. 84 | 85 | # 5.0.0 86 | 87 | This release adds over a dozen new rules. 88 | 89 | If needed, you can [extend the config](README.md#extending-the-config) to turn off any of the new rules. 90 | 91 | - Removed: `stylelint` less than `14.0.0` from peer dependencies. 92 | - Changed: updated to [`stylelint-config-recommended@6.0.0`](https://github.com/stylelint-scss/stylelint-config-recommended-scss/releases/tag/6.0.0). 93 | - Added: `scss/at-extend-no-missing-placeholder` rule. 94 | - Added: `scss/at-if-no-null` rule. 95 | - Added: `scss/at-import-no-partial-leading-underscore` rule. 96 | - Added: `scss/at-import-partial-extension` rule. 97 | - Added: `scss/comment-no-empty` rule. 98 | - Added: `scss/declaration-nested-properties-no-divided-groups` rule. 99 | - Added: `scss/dollar-variable-no-missing-interpolation` rule. 100 | - Added: `scss/function-quote-no-quoted-strings-inside` rule. 101 | - Added: `scss/function-unquote-no-unquoted-strings-inside` rule. 102 | - Added: `scss/no-duplicate-mixins` rule. 103 | - Added: `scss/no-global-function-names` rule. 104 | - Added: `scss/operator-no-newline-after` rule. 105 | - Added: `scss/operator-no-newline-before` rule. 106 | - Added: `scss/operator-no-unspaced` rule. 107 | 108 | # 4.3.0 109 | 110 | - Updated `stylelint-config-recommended` dependency to version 5.0.0. 111 | 112 | # 4.2.0 113 | 114 | - Added: support for stylelint 13. 115 | 116 | # 4.1.0 117 | 118 | - Added: support for stylelint 12. 119 | 120 | # 4.0.0 121 | 122 | - **Breaking change** update to peer depedencies: `stylelint`@10.1.0+ and `stylelint-scss`@3.0.0+ are required now. 123 | - Updated: `stylelint-config-recommended` dependency to version 3.0.0. 124 | - Added: support for stylelint 11. 125 | 126 | # 3.3.0 127 | 128 | - Added: support for stylelint 10. 129 | - Updated `stylelint-config-recommended` dependency to version 2.2.0. 130 | 131 | # 3.2.0 132 | 133 | - Added: support for stylelint-scss v3. 134 | 135 | # 3.1.0 136 | 137 | - Added: support for stylelint 9. 138 | 139 | # 3.0.0 140 | 141 | - Updated `stylelint-config-recommended` dependency to version 2.0.0. 142 | - Updated `stylelint` peer dependency to version 8.3.0. 143 | 144 | # 2.0.0 145 | 146 | - Updated `stylelint-scss` dependency to version 2. 147 | 148 | # 1.0.0 149 | 150 | - Initial release 151 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Krister Kari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stylelint-config-recommended-scss 2 | 3 | [![npm version](https://img.shields.io/npm/v/stylelint-config-recommended-scss?logo=npm&logoColor=fff)](https://www.npmjs.com/package/stylelint-config-recommended-scss) 4 | [![Build Status](https://img.shields.io/github/actions/workflow/status/stylelint-scss/stylelint-config-recommended-scss/test.yml?branch=master&label=tests&logo=github)](https://github.com/stylelint-scss/stylelint-config-recommended-scss/actions/workflows/test.yml?query=workflow%3ATests) 5 | [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) 6 | [![Downloads per month](https://img.shields.io/npm/dm/stylelint-config-recommended-scss)](https://npmcharts.com/compare/stylelint-config-recommended-scss) 7 | 8 | > The recommended shareable SCSS config for Stylelint. 9 | 10 | This config: 11 | 12 | - extends the [`stylelint-config-recommended` shared config](https://github.com/stylelint/stylelint-config-recommended) and configures its rules for SCSS 13 | - bundles the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss) and turns on its rules that check for possible errors 14 | - bundles the [`postcss-scss` custom syntax](https://github.com/postcss/postcss-scss) and configures it 15 | 16 | This config is extended by the [`stylelint-config-standard-scss` shared config](https://github.com/stylelint-scss/stylelint-config-standard-scss). That config is better suited to most users as it also turns on the stylistic rules in the [`stylelint-scss` plugin pack](https://github.com/stylelint-scss/stylelint-scss). 17 | 18 | To see the rules that this config uses, please read the [config itself](/index.js). 19 | 20 | ## Installation 21 | 22 | ```shell 23 | npm install --save-dev stylelint-config-recommended-scss 24 | ``` 25 | 26 | ## Usage 27 | 28 | Set your `stylelint` config to: 29 | 30 | ```json 31 | { 32 | "extends": "stylelint-config-recommended-scss" 33 | } 34 | ``` 35 | 36 | ### Extending the config 37 | 38 | Simply add a `"rules"` key to your config, then add your overrides and additions there. 39 | 40 | For example, to turn off the `scss/at-if-no-null` rule: 41 | 42 | ```json 43 | { 44 | "extends": "stylelint-config-recommended-scss", 45 | "rules": { 46 | "scss/at-if-no-null": null 47 | } 48 | } 49 | ``` 50 | 51 | ## [Changelog](CHANGELOG.md) 52 | 53 | ## [License](LICENSE) 54 | -------------------------------------------------------------------------------- /__tests__/index.test.mjs: -------------------------------------------------------------------------------- 1 | import { beforeEach, describe, it } from 'node:test'; // eslint-disable-line n/no-unsupported-features/node-builtins 2 | import assert from 'node:assert/strict'; 3 | import { readFileSync } from 'node:fs'; 4 | 5 | import stylelint from 'stylelint'; 6 | 7 | import config from '../index.js'; 8 | 9 | const validScss = readFileSync('./__tests__/valid.scss', 'utf-8'); 10 | const invalidScss = readFileSync('./__tests__/invalid.scss', 'utf-8'); 11 | 12 | describe('flags no warnings with valid scss', () => { 13 | let result; 14 | 15 | beforeEach(async () => { 16 | result = await stylelint.lint({ 17 | code: validScss, 18 | config, 19 | }); 20 | }); 21 | 22 | it('did not error', () => { 23 | assert.equal(result.errored, false); 24 | }); 25 | 26 | it('flags no warnings', () => { 27 | assert.equal(result.results[0].warnings.length, 0); 28 | }); 29 | }); 30 | 31 | describe('flags warnings with invalid scss', () => { 32 | let result; 33 | 34 | beforeEach(async () => { 35 | result = await stylelint.lint({ 36 | code: invalidScss, 37 | config, 38 | }); 39 | }); 40 | 41 | it('did error', () => { 42 | assert.equal(result.errored, true); 43 | }); 44 | 45 | it('flags one warning', () => { 46 | assert.equal(result.results[0].warnings.length, 1); 47 | }); 48 | 49 | it('correct warning text', () => { 50 | assert.equal( 51 | result.results[0].warnings[0].text, 52 | 'Expected @if not statement rather than @if statement == null (scss/at-if-no-null)', 53 | ); 54 | }); 55 | 56 | it('correct rule flagged', () => { 57 | assert.equal(result.results[0].warnings[0].rule, 'scss/at-if-no-null'); 58 | }); 59 | 60 | it('correct severity flagged', () => { 61 | assert.equal(result.results[0].warnings[0].severity, 'error'); 62 | }); 63 | 64 | it('correct line number', () => { 65 | assert.equal(result.results[0].warnings[0].line, 1); 66 | }); 67 | 68 | it('correct column number', () => { 69 | assert.equal(result.results[0].warnings[0].column, 5); 70 | }); 71 | }); 72 | -------------------------------------------------------------------------------- /__tests__/invalid.scss: -------------------------------------------------------------------------------- 1 | @if $x == null { color: red; } 2 | -------------------------------------------------------------------------------- /__tests__/valid.scss: -------------------------------------------------------------------------------- 1 | @forward "something"; 2 | @use "base"; 3 | @use "sass:list"; 4 | @use "sass:map"; 5 | @use "sass:math"; 6 | @use "sass:meta"; 7 | @use "sass:string"; 8 | @import "something-else"; 9 | 10 | // Multi-line double-slash comment 11 | // comment 12 | 13 | $postfix: if($infix != '', $infix + '-down', ''); 14 | 15 | @function remove-where($list, $condition) { 16 | $new-list: (); 17 | $separator: list.separator($list); 18 | 19 | @each $element in $list { 20 | @if not meta.call($condition, $element) { 21 | $new-list: list.append($new-list, $element, $separator: $separator); 22 | } 23 | } 24 | 25 | @return $new-list; 26 | } 27 | 28 | @mixin corner-icon($name, $top-or-bottom, $left-or-right) { 29 | .icon-#{$name} { 30 | background-image: url("/icons/#{$name}.svg"); 31 | position: absolute; 32 | #{$top-or-bottom}: 0; 33 | #{$left-or-right}: 0; 34 | } 35 | } 36 | 37 | @mixin triangle($size, $color, $direction) { 38 | border-color: transparent; 39 | border-style: solid; 40 | border-width: math.div($size, 2); 41 | 42 | @if $direction == up { 43 | border-bottom-color: $color; 44 | } @else if $direction == right { 45 | border-left-color: $color; 46 | } @else if $direction == down { 47 | border-top-color: $color; 48 | } @else if $direction == left { 49 | border-right-color: $color; 50 | } @else { 51 | @error "Unknown direction #{$direction}."; 52 | } 53 | } 54 | 55 | @mixin theme($theme: DarkGray) { 56 | background: $theme; 57 | box-shadow: 0 0 1px rgb($theme / 25%); 58 | } 59 | 60 | %message-shared { 61 | border: 1px solid #ccc; 62 | color: #333; 63 | } 64 | 65 | $default-color: #000 !default; 66 | $local-color: #333; 67 | $fonts: "Tahoma", "Helvetica Neue", "Helvetica", sans-serif; 68 | $theme-colors: ( 69 | "success": #28a745, 70 | "warning": #ffc107, 71 | ); 72 | 73 | $global-variable: first global value; 74 | :root { 75 | --brand-red: hsl(5deg 10% 40%); 76 | $global-variable: second global value !global; 77 | } 78 | 79 | .selector-1, 80 | .selector-3[type="text"] { 81 | background: linear-gradient(#fff, rgb(0 0 0 / 80%)); 82 | color: base.$primary-color; 83 | top: calc(100% - 2rem) !important; 84 | 85 | a { 86 | width: math.div(300px, 960px) * 100%; 87 | } 88 | } 89 | 90 | .selector-x { width: 10%; } 91 | .selector-y { width: 20%; } 92 | .selector-z { width: 30%; } 93 | 94 | .selector-a { 95 | @include theme; 96 | } 97 | 98 | .selector-b { 99 | @extend %message-shared; 100 | @include theme($theme: DarkRed); 101 | } 102 | 103 | /* Single-line comment */ 104 | 105 | @media (min-width >= 60em) { 106 | .selector { 107 | // Flush to parent comment 108 | @include corner-icon("mail", top, left); 109 | 110 | transform: translate(1, 1) scale(3); 111 | } 112 | } 113 | 114 | @media (orientation: portrait), projection and (color) { 115 | // Flush to parent double-slash comment 116 | .selector-i + .selector-ii { 117 | @include triangle(5px, black, right); 118 | 119 | background: hsl(20deg 25% 33%); 120 | 121 | .selector-j { 122 | @function contains-helvetica($string) { 123 | @return string.index($string, "Helvetica"); 124 | } 125 | 126 | font-family: remove-where($fonts, meta.get-function("contains-helvetica")); 127 | } 128 | } 129 | } 130 | 131 | // Multi-line double-slash comment 132 | // comment 133 | @media 134 | screen and (min-resolution: 192dpi), 135 | screen and (min-resolution: 2dppx) { 136 | .selector { 137 | background-image: 138 | repeating-linear-gradient( 139 | -45deg, 140 | transparent, 141 | #fff 25px, 142 | rgb(255 255 255 / 100%) 50px 143 | ); 144 | height: 10rem; 145 | } 146 | 147 | /* Flush nested single line comment */ 148 | .selector::after { 149 | background-color: map.get($theme-colors, "warning"); 150 | content: "→"; 151 | background-image: url("x.svg"); 152 | } 153 | } 154 | 155 | @keyframes fade-in { 156 | from { opacity: 0%; } 157 | to { opacity: 100%; } 158 | } 159 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import stylelintConfig from 'eslint-config-stylelint'; 2 | 3 | export default stylelintConfig; 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const postcssScss = require('postcss-scss'); 4 | 5 | module.exports = { 6 | extends: ['stylelint-config-recommended'], 7 | customSyntax: postcssScss, 8 | plugins: ['stylelint-scss'], 9 | rules: { 10 | 'annotation-no-unknown': null, 11 | 'at-rule-descriptor-no-unknown': null, 12 | 'at-rule-descriptor-value-no-unknown': null, 13 | 'at-rule-no-unknown': null, 14 | 'at-rule-prelude-no-invalid': null, 15 | 'color-no-invalid-hex': true, 16 | 'comment-no-empty': null, 17 | 'declaration-property-value-no-unknown': null, 18 | 'function-linear-gradient-no-nonstandard-direction': true, 19 | 'function-no-unknown': null, 20 | 'media-feature-name-value-no-unknown': null, 21 | 'media-query-no-invalid': null, 22 | 'no-invalid-position-at-import-rule': [ 23 | true, 24 | { 25 | ignoreAtRules: ['use', 'forward'], 26 | }, 27 | ], 28 | 'string-no-newline': true, 29 | 'unit-no-unknown': true, 30 | 'scss/at-extend-no-missing-placeholder': true, 31 | 'scss/at-if-no-null': true, 32 | 'scss/at-rule-no-unknown': true, 33 | 'scss/comment-no-empty': true, 34 | 'scss/declaration-nested-properties-no-divided-groups': true, 35 | 'scss/dollar-variable-no-missing-interpolation': true, 36 | 'scss/function-quote-no-quoted-strings-inside': true, 37 | 'scss/function-unquote-no-unquoted-strings-inside': true, 38 | 'scss/load-no-partial-leading-underscore': true, 39 | 'scss/load-partial-extension': 'never', 40 | 'scss/no-duplicate-mixins': true, 41 | 'scss/no-global-function-names': true, 42 | 'scss/operator-no-newline-after': true, 43 | 'scss/operator-no-newline-before': true, 44 | 'scss/operator-no-unspaced': true, 45 | }, 46 | }; 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stylelint-config-recommended-scss", 3 | "version": "15.0.1", 4 | "description": "The recommended shareable SCSS config for Stylelint", 5 | "keywords": [ 6 | "stylelint", 7 | "stylelint-config", 8 | "recommended", 9 | "scss" 10 | ], 11 | "repository": "stylelint-scss/stylelint-config-recommended-scss", 12 | "license": "MIT", 13 | "author": "kristerkari", 14 | "main": "index.js", 15 | "files": [ 16 | "index.js" 17 | ], 18 | "scripts": { 19 | "format": "prettier . --write --ignore-path=.prettierignore", 20 | "lint": "npm-run-all --parallel lint:*", 21 | "lint:formatting": "prettier . --check", 22 | "lint:js": "eslint .", 23 | "lint:md": "remark . --quiet --frail --ignore-path .gitignore", 24 | "release": "np", 25 | "test": "node --test", 26 | "watch": "node --test --watch" 27 | }, 28 | "dependencies": { 29 | "postcss-scss": "^4.0.9", 30 | "stylelint-config-recommended": "^16.0.0", 31 | "stylelint-scss": "^6.12.0" 32 | }, 33 | "devDependencies": { 34 | "@stylelint/prettier-config": "^3.0.0", 35 | "@stylelint/remark-preset": "^5.1.1", 36 | "eslint": "^9.25.1", 37 | "eslint-config-stylelint": "^24.0.0", 38 | "np": "^10.2.0", 39 | "npm-run-all2": "^8.0.1", 40 | "prettier": "^3.5.3", 41 | "remark-cli": "^12.0.1", 42 | "stylelint": "^16.16.0" 43 | }, 44 | "peerDependencies": { 45 | "postcss": "^8.3.3", 46 | "stylelint": "^16.16.0" 47 | }, 48 | "peerDependenciesMeta": { 49 | "postcss": { 50 | "optional": true 51 | } 52 | }, 53 | "engines": { 54 | "node": ">=20" 55 | } 56 | } 57 | --------------------------------------------------------------------------------