@yoo-digital/stylelint-config-css 1.0.0-canary.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 +21 -0
- package/README.md +28 -0
- package/index.js +91 -0
- package/package.json +96 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YOO AG
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# YOO Stylelint Configuration for CSS Projects
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@yoo-digital/stylelint-config-css)
|
|
4
|
+
|
|
5
|
+
Contains the settings and rules used for CSS projects within YOO.
|
|
6
|
+
It is publicly available via the npm registry.
|
|
7
|
+
|
|
8
|
+
❗ Should be used in combination with our [Prettier config](https://github.com/yoo-digital/config/tree/main/packages/prettier).
|
|
9
|
+
|
|
10
|
+
## Motivation
|
|
11
|
+
|
|
12
|
+
Every developer can and should contribute to this repository. It should be in everyone's interest to improve the developer experience @ YOO. Amendments or changes can be introduced in our monthly guild meetings.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
**Be aware**: The _stylelint_ package is listed as a peer dependency. The versions might collide in your project. Always try to use the latest versions of _stylelint_ in your project. Please check the changelog to see which _stylelint_ version this package is compatible with.
|
|
17
|
+
|
|
18
|
+
After installing the packages, you can create a `.stylelintrc.js` file in the root of your project and add the following lines:
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
module.exports = {
|
|
22
|
+
extends: '@yoo-digital/stylelint-config-css',
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
You can apply your own set of rules on top of that, but do not turn off any of the rules,
|
|
27
|
+
except it is an obstacle and making your life harder. Check the chapter below, for a complete set of rules
|
|
28
|
+
that can be applied.
|
package/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['stylelint-config-standard', 'stylelint-config-property-sort-order-smacss'],
|
|
3
|
+
plugins: ['stylelint-order'],
|
|
4
|
+
rules: {
|
|
5
|
+
'at-rule-no-vendor-prefix': true,
|
|
6
|
+
'media-feature-name-no-vendor-prefix': true,
|
|
7
|
+
'property-no-vendor-prefix': true,
|
|
8
|
+
'selector-no-vendor-prefix': true,
|
|
9
|
+
'value-no-vendor-prefix': true,
|
|
10
|
+
'color-hex-length': 'long',
|
|
11
|
+
'comment-empty-line-before': null,
|
|
12
|
+
'custom-property-empty-line-before': null,
|
|
13
|
+
'declaration-no-important': true,
|
|
14
|
+
'declaration-property-value-disallowed-list': {
|
|
15
|
+
'/^border/': 'none',
|
|
16
|
+
},
|
|
17
|
+
'function-url-quotes': 'always',
|
|
18
|
+
'font-weight-notation': 'numeric',
|
|
19
|
+
'font-family-name-quotes': 'always-where-recommended',
|
|
20
|
+
'max-nesting-depth': 3,
|
|
21
|
+
// Configuration options:
|
|
22
|
+
// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md
|
|
23
|
+
'order/order': [
|
|
24
|
+
['custom-properties', 'declarations', 'rules', 'at-rules'],
|
|
25
|
+
{
|
|
26
|
+
unspecified: 'ignore',
|
|
27
|
+
disableFix: true,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
'selector-class-pattern': [
|
|
31
|
+
'^[a-z][a-z0-9-_]+$',
|
|
32
|
+
{
|
|
33
|
+
message: 'Expected class selector to be kebab-case or follow BEM __ --',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
'selector-id-pattern': [
|
|
37
|
+
'^[a-z][a-z0-9-_]+$',
|
|
38
|
+
{
|
|
39
|
+
message: 'Expected id selector to be kebab-case or follow BEM __ --',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'selector-attribute-quotes': 'always',
|
|
43
|
+
'selector-max-compound-selectors': 4,
|
|
44
|
+
'selector-max-id': 0,
|
|
45
|
+
'selector-max-specificity': '0,4,1',
|
|
46
|
+
'selector-max-type': [
|
|
47
|
+
1,
|
|
48
|
+
{
|
|
49
|
+
ignoreTypes: ['/fieldset/'],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
'selector-max-universal': 0,
|
|
53
|
+
'selector-no-qualifying-type': true,
|
|
54
|
+
'no-descending-specificity': null,
|
|
55
|
+
'selector-pseudo-class-no-unknown': [
|
|
56
|
+
true,
|
|
57
|
+
{
|
|
58
|
+
ignorePseudoClasses: [
|
|
59
|
+
'global',
|
|
60
|
+
|
|
61
|
+
// For webpack support:
|
|
62
|
+
// https://til.hashrocket.com/posts/sxbrscjuqu-share-scss-variables-with-javascript
|
|
63
|
+
'export',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'value-keyword-case': [
|
|
68
|
+
'lower',
|
|
69
|
+
{
|
|
70
|
+
camelCaseSvgKeywords: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
'length-zero-no-unit': [
|
|
74
|
+
true,
|
|
75
|
+
{
|
|
76
|
+
ignore: ['custom-properties'],
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
// Allow .camelCase for modules
|
|
81
|
+
// See: https://github.com/stylelint/stylelint/issues/3259#issuecomment-656717023
|
|
82
|
+
overrides: [
|
|
83
|
+
{
|
|
84
|
+
files: ['**/*.module.css'],
|
|
85
|
+
rules: {
|
|
86
|
+
'selector-class-pattern': '^[a-z][a-zA-Z0-9_-]+$',
|
|
87
|
+
'selector-id-pattern': '^[a-z][a-zA-Z0-9_-]+$',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yoo-digital/stylelint-config-css",
|
|
3
|
+
"description": "Stylelint configuration file containing rules for CSS projects",
|
|
4
|
+
"version": "1.0.0-canary.0",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"CSS",
|
|
11
|
+
"stylelint",
|
|
12
|
+
"stylelint-config"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git@github.com:yoo-digital/config.git",
|
|
17
|
+
"directory": "packages/stylelint-config-css"
|
|
18
|
+
},
|
|
19
|
+
"author": {
|
|
20
|
+
"name": "YOO AG",
|
|
21
|
+
"email": "info@yoo.digital",
|
|
22
|
+
"url": "https://www.yoo.digital/"
|
|
23
|
+
},
|
|
24
|
+
"contributors": [
|
|
25
|
+
{
|
|
26
|
+
"name": "Björn Bühler",
|
|
27
|
+
"email": "bjoern.buehler@yoo.digital"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "Cédric Madörin",
|
|
31
|
+
"email": "cedric.madoerin@yoo.digital"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Daniel Kohler",
|
|
35
|
+
"email": "daniel.kohler@yoo.digital"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "Emanuel Marsicovetere",
|
|
39
|
+
"email": "emanuel.marsicovetere@yoo.digital"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "Hervé Brunner",
|
|
43
|
+
"email": "herve.brunner@yoo.digital"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "Kelvin Louis",
|
|
47
|
+
"email": "kelvin.louis@yoo.digital"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "Robin Hahne",
|
|
51
|
+
"email": "robin.hahne@yoo.digital"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "Sacha Schmid",
|
|
55
|
+
"email": "sacha.schmid@yoo.digital"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "Tobias Maier",
|
|
59
|
+
"email": "tobias.maier@yoo.digital"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "Tobias Wahl",
|
|
63
|
+
"email": "tobias.wahl@yoo.digital"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "Yanick Recher",
|
|
67
|
+
"email": "yanick.recher@yoo.digital"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"main": "index.js",
|
|
71
|
+
"files": [
|
|
72
|
+
"index.js",
|
|
73
|
+
"LICENSE",
|
|
74
|
+
"README.md"
|
|
75
|
+
],
|
|
76
|
+
"scripts": {
|
|
77
|
+
"lint": "stylelint \"__test__/**/*.css\""
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">= 18",
|
|
81
|
+
"npm": ">= 8"
|
|
82
|
+
},
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"stylelint-config-standard": "^40.0.0",
|
|
85
|
+
"stylelint-order": "^7.0.0",
|
|
86
|
+
"stylelint-config-property-sort-order-smacss": "~11.1.0"
|
|
87
|
+
},
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"stylelint": "^17"
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@yoo-digital/prettier": "~1.3.0-canary.0",
|
|
93
|
+
"stylelint": "^17"
|
|
94
|
+
},
|
|
95
|
+
"prettier": "@yoo-digital/prettier"
|
|
96
|
+
}
|