@hsnaydd/stylelint-config 0.0.0-stage → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +52 -2
- package/index.js +191 -0
- package/package.json +50 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Atölye15
|
|
4
|
+
Copyright (c) 2026 Hasan Aydoğdu
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# stylelint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Shareable stylelint config for CSS and SCSS, with Prettier formatting and property ordering.
|
|
4
|
+
|
|
5
|
+
Opinionated rules for writing consistent CSS and SCSS: code quality checks, Prettier-based formatting and declaration ordering via `stylelint-order`. Works for plain CSS as well as SCSS projects.
|
|
6
|
+
|
|
7
|
+
> **Migrating from `@atolye15/stylelint-config`?** This package is its continuation under a new name. Replace the package in your `package.json` and update `extends` to `@hsnaydd/stylelint-config`. The rules are unchanged and the version numbers continue from where they left off.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
pnpm add -D @hsnaydd/stylelint-config postcss prettier stylelint
|
|
13
|
+
|
|
14
|
+
# Or with npm:
|
|
15
|
+
|
|
16
|
+
npm install @hsnaydd/stylelint-config postcss prettier stylelint --save-dev
|
|
17
|
+
|
|
18
|
+
# Or with yarn:
|
|
19
|
+
|
|
20
|
+
yarn add @hsnaydd/stylelint-config postcss prettier stylelint --dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
_`@hsnaydd/stylelint-config` does not install PostCSS, Prettier or Stylelint for you. You must install these yourself._
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
Set your stylelint config to:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"extends": "@hsnaydd/stylelint-config"
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Extending the config
|
|
36
|
+
|
|
37
|
+
Simply add a `"rules"` key to your config and add your overrides there.
|
|
38
|
+
|
|
39
|
+
For example, to allow `!important` and named colors:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"extends": "@hsnaydd/stylelint-config",
|
|
44
|
+
"rules": {
|
|
45
|
+
"declaration-no-important": null,
|
|
46
|
+
"color-named": null
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## [Changelog](https://github.com/hsnaydd/stylelint-config/releases)
|
|
52
|
+
|
|
53
|
+
## [License](LICENSE)
|
package/index.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'stylelint-config-standard-scss',
|
|
4
|
+
'stylelint-prettier/recommended',
|
|
5
|
+
'stylelint-config-prettier-scss',
|
|
6
|
+
],
|
|
7
|
+
plugins: ['stylelint-order'],
|
|
8
|
+
customSyntax: 'postcss-scss',
|
|
9
|
+
rules: {
|
|
10
|
+
'at-rule-disallowed-list': ['debug', 'extend'],
|
|
11
|
+
'at-rule-no-vendor-prefix': true,
|
|
12
|
+
'block-no-empty': true,
|
|
13
|
+
'color-hex-length': 'short',
|
|
14
|
+
'color-named': 'never',
|
|
15
|
+
'color-no-invalid-hex': true,
|
|
16
|
+
'custom-property-no-missing-var-function': true,
|
|
17
|
+
'declaration-block-no-duplicate-custom-properties': true,
|
|
18
|
+
'declaration-block-no-duplicate-properties': true,
|
|
19
|
+
'declaration-block-no-shorthand-property-overrides': true,
|
|
20
|
+
'declaration-no-important': true,
|
|
21
|
+
'declaration-property-value-disallowed-list': {
|
|
22
|
+
'/^border/': ['none'],
|
|
23
|
+
'/^transition/': ['/all/'],
|
|
24
|
+
'/^background/': ['http:', 'https:'],
|
|
25
|
+
},
|
|
26
|
+
'font-family-name-quotes': 'always-where-recommended',
|
|
27
|
+
'font-family-no-duplicate-names': true,
|
|
28
|
+
'font-family-no-missing-generic-family-keyword': true,
|
|
29
|
+
'font-weight-notation': 'numeric',
|
|
30
|
+
'function-calc-no-unspaced-operator': true,
|
|
31
|
+
'function-linear-gradient-no-nonstandard-direction': true,
|
|
32
|
+
'function-url-quotes': 'always',
|
|
33
|
+
'keyframe-block-no-duplicate-selectors': true,
|
|
34
|
+
'keyframe-declaration-no-important': true,
|
|
35
|
+
'length-zero-no-unit': true,
|
|
36
|
+
'max-nesting-depth': [
|
|
37
|
+
3,
|
|
38
|
+
{
|
|
39
|
+
ignoreAtRules: ['each', 'else', 'if', 'include', 'media', 'supports'],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'media-feature-name-no-unknown': true,
|
|
43
|
+
'media-feature-name-no-vendor-prefix': true,
|
|
44
|
+
'named-grid-areas-no-invalid': true,
|
|
45
|
+
'no-empty-source': true,
|
|
46
|
+
'no-invalid-position-at-import-rule': [
|
|
47
|
+
true,
|
|
48
|
+
{
|
|
49
|
+
ignoreAtRules: ['use', 'forward'],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'no-irregular-whitespace': true,
|
|
53
|
+
'order/order': [
|
|
54
|
+
[
|
|
55
|
+
'custom-properties',
|
|
56
|
+
'dollar-variables',
|
|
57
|
+
{
|
|
58
|
+
type: 'at-rule',
|
|
59
|
+
name: 'extend',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'at-rule',
|
|
63
|
+
name: 'include',
|
|
64
|
+
hasBlock: false,
|
|
65
|
+
},
|
|
66
|
+
'declarations',
|
|
67
|
+
{
|
|
68
|
+
type: 'at-rule',
|
|
69
|
+
name: 'include',
|
|
70
|
+
hasBlock: true,
|
|
71
|
+
},
|
|
72
|
+
'rules',
|
|
73
|
+
],
|
|
74
|
+
],
|
|
75
|
+
'order/properties-order': [
|
|
76
|
+
[
|
|
77
|
+
'position',
|
|
78
|
+
'z-index',
|
|
79
|
+
'top',
|
|
80
|
+
'right',
|
|
81
|
+
'bottom',
|
|
82
|
+
'left',
|
|
83
|
+
'display',
|
|
84
|
+
'overflow',
|
|
85
|
+
'width',
|
|
86
|
+
'min-width',
|
|
87
|
+
'max-width',
|
|
88
|
+
'height',
|
|
89
|
+
'min-height',
|
|
90
|
+
'max-height',
|
|
91
|
+
'box-sizing',
|
|
92
|
+
'grid',
|
|
93
|
+
'grid-area',
|
|
94
|
+
'grid-template',
|
|
95
|
+
'grid-template-areas',
|
|
96
|
+
'grid-template-rows',
|
|
97
|
+
'grid-template-columns',
|
|
98
|
+
'grid-row',
|
|
99
|
+
'grid-row-start',
|
|
100
|
+
'grid-row-end',
|
|
101
|
+
'grid-column',
|
|
102
|
+
'grid-column-start',
|
|
103
|
+
'grid-column-end',
|
|
104
|
+
'grid-auto-rows',
|
|
105
|
+
'grid-auto-columns',
|
|
106
|
+
'grid-auto-flow',
|
|
107
|
+
'gap',
|
|
108
|
+
'grid-gap',
|
|
109
|
+
'grid-row-gap',
|
|
110
|
+
'grid-column-gap',
|
|
111
|
+
'flex',
|
|
112
|
+
'flex-basis',
|
|
113
|
+
'flex-direction',
|
|
114
|
+
'flex-flow',
|
|
115
|
+
'flex-grow',
|
|
116
|
+
'flex-shrink',
|
|
117
|
+
'flex-wrap',
|
|
118
|
+
'align-content',
|
|
119
|
+
'align-items',
|
|
120
|
+
'align-self',
|
|
121
|
+
'justify-content',
|
|
122
|
+
'order',
|
|
123
|
+
'padding',
|
|
124
|
+
'padding-top',
|
|
125
|
+
'padding-right',
|
|
126
|
+
'padding-bottom',
|
|
127
|
+
'padding-left',
|
|
128
|
+
'border',
|
|
129
|
+
'border-top',
|
|
130
|
+
'border-right',
|
|
131
|
+
'border-bottom',
|
|
132
|
+
'border-left',
|
|
133
|
+
'margin',
|
|
134
|
+
'margin-top',
|
|
135
|
+
'margin-right',
|
|
136
|
+
'margin-bottom',
|
|
137
|
+
'margin-left',
|
|
138
|
+
],
|
|
139
|
+
{
|
|
140
|
+
unspecified: 'bottomAlphabetical',
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
'property-no-unknown': true,
|
|
144
|
+
'property-no-vendor-prefix': true,
|
|
145
|
+
'rule-empty-line-before': [
|
|
146
|
+
'always-multi-line',
|
|
147
|
+
{
|
|
148
|
+
except: ['first-nested'],
|
|
149
|
+
ignore: ['after-comment'],
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
'scss/at-extend-no-missing-placeholder': true,
|
|
153
|
+
'scss/at-function-pattern': '^[_-]?[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
154
|
+
'scss/load-partial-extension': 'never',
|
|
155
|
+
'scss/at-mixin-pattern': '^[_-]?[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
156
|
+
'scss/at-rule-no-unknown': true,
|
|
157
|
+
'scss/comment-no-empty': null,
|
|
158
|
+
'scss/declaration-nested-properties-no-divided-groups': true,
|
|
159
|
+
'scss/dollar-variable-no-missing-interpolation': true,
|
|
160
|
+
'scss/dollar-variable-pattern': '^[_-]?[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
161
|
+
'scss/function-quote-no-quoted-strings-inside': true,
|
|
162
|
+
'scss/function-unquote-no-unquoted-strings-inside': true,
|
|
163
|
+
'scss/load-no-partial-leading-underscore': true,
|
|
164
|
+
'scss/percent-placeholder-pattern': '^[_-]?[a-z]+([a-z0-9-]+[a-z0-9]+)?$',
|
|
165
|
+
'scss/no-duplicate-mixins': true,
|
|
166
|
+
'scss/no-global-function-names': true,
|
|
167
|
+
'scss/selector-class-pattern': [
|
|
168
|
+
'^[a-z]([-]?[a-z0-9]+)*(__[a-z0-9]([-]?[a-z0-9]+)*)?(--[a-z0-9]([-]?[a-z0-9]+)*)?$',
|
|
169
|
+
{
|
|
170
|
+
resolveNestedSelectors: true,
|
|
171
|
+
message: function expected(selectorValue) {
|
|
172
|
+
return `Expected class selector "${selectorValue}" to match BEM CSS pattern https://en.bem.info/methodology/css.`;
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
'scss/selector-no-redundant-nesting-selector': true,
|
|
177
|
+
'selector-attribute-quotes': 'always',
|
|
178
|
+
'selector-class-pattern': null,
|
|
179
|
+
'selector-max-class': 3,
|
|
180
|
+
'selector-max-compound-selectors': 3,
|
|
181
|
+
'selector-max-id': 0,
|
|
182
|
+
'selector-max-universal': 1,
|
|
183
|
+
'selector-no-vendor-prefix': true,
|
|
184
|
+
'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['global'] }],
|
|
185
|
+
'selector-pseudo-element-colon-notation': 'double',
|
|
186
|
+
'selector-pseudo-element-no-unknown': true,
|
|
187
|
+
'shorthand-property-no-redundant-values': true,
|
|
188
|
+
'string-no-newline': true,
|
|
189
|
+
'value-no-vendor-prefix': true,
|
|
190
|
+
},
|
|
191
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hsnaydd/stylelint-config",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "9.0.0",
|
|
4
|
+
"description": "Shareable stylelint config for CSS and SCSS, with Prettier formatting and property ordering.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js"
|
|
8
|
+
],
|
|
9
|
+
"keywords": [
|
|
10
|
+
"stylelint",
|
|
11
|
+
"stylelint-config",
|
|
12
|
+
"css",
|
|
13
|
+
"scss",
|
|
14
|
+
"prettier"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "node --test",
|
|
18
|
+
"format": "prettier index.js test --write",
|
|
19
|
+
"format:check": "prettier index.js test --check"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/hsnaydd/stylelint-config.git"
|
|
24
|
+
},
|
|
25
|
+
"author": "Hasan Aydoğdu",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/hsnaydd/stylelint-config/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/hsnaydd/stylelint-config#readme",
|
|
31
|
+
"packageManager": "pnpm@10.18.3",
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"postcss": "^8.5.33",
|
|
37
|
+
"prettier": "^3.5.3",
|
|
38
|
+
"stylelint": "^18.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"postcss-scss": "^4.0.9",
|
|
42
|
+
"stylelint-config-prettier-scss": "^1.0.0",
|
|
43
|
+
"stylelint-config-standard-scss": "^18.0.0",
|
|
44
|
+
"stylelint-order": "^8.1.3",
|
|
45
|
+
"stylelint-prettier": "^5.1.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"postcss": "^8.5.33",
|
|
49
|
+
"prettier": "^3.10.1",
|
|
50
|
+
"stylelint": "^18.1.0"
|
|
51
|
+
}
|
|
52
|
+
}
|