Skip to content

Commit 5cb9507

Browse files
Fix/GitHub workflow (#4)
* added new rules * fix github workflows * fix to warning about 'declaration-strict-value' not having autoFix function * fix to warning about 'declaration-strict-value' not having autoFix function * sync package and lock * added rules for vendor prefixes * added rules for vendor prefixes * Refined exclude for 'declaration-strict-value' and 'unit-allowed-list' * Refined exclude for 'declaration-strict-value' and 'unit-allowed-list'
1 parent 4306ce3 commit 5cb9507

File tree

5 files changed

+82
-44
lines changed

5 files changed

+82
-44
lines changed

.prettierrc

Lines changed: 0 additions & 9 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [v0.1.2] - 2024-01-24
9+
10+
### Added
11+
12+
- Rules for vendor prefixes.
13+
- Refined excludes for 'declaration-strict-value' and 'unit-allowed-list'
14+
15+
### Fixed
16+
17+
- Warning about 'declaration-strict-value' not having autoFix function.
18+
819
## [v0.1.1] - 2024-01-17
920

1021
### Added
@@ -19,5 +30,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1930

2031
- First release
2132

33+
[v0.1.2]: https://www.npmjs.com/package/@dipcode/stylelint-config/v/0.1.2
2234
[v0.1.1]: https://www.npmjs.com/package/@dipcode/stylelint-config/v/0.1.1
2335
[v0.1.0]: https://www.npmjs.com/package/@dipcode/stylelint-config/v/0.1.0

package-lock.json

Lines changed: 34 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dipcode/stylelint-config",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Shareable stylelint config for CSS and SCSS, following Dipcode code style.",
55
"main": "./src/config.js",
66
"scripts": {
@@ -30,6 +30,7 @@
3030
"homepage": "https://github.com/dipcode-software/stylelint-config-dipcode#readme",
3131
"exports": "./src/config.js",
3232
"devDependencies": {
33+
"@dipcode/prettier-config": "0.1.0",
3334
"husky": "8.0.3",
3435
"lint-staged": "15.2.0"
3536
},
@@ -42,5 +43,6 @@
4243
"stylelint-config-standard-scss": "^13.0.0",
4344
"stylelint-declaration-strict-value": "^1.10.4",
4445
"stylelint-order": "^6.0.4"
45-
}
46+
},
47+
"prettier": "@dipcode/prettier-config"
4648
}

src/config.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,56 @@
11
'use strict';
22

33
// See https://stylelint.io/user-guide/rules/.
4+
/** @type {import('stylelint').Config} */
45
module.exports = {
56
extends: ['stylelint-config-standard-scss', 'stylelint-config-prettier-scss'],
67
plugins: ['stylelint-order', 'stylelint-declaration-strict-value'],
78
rules: {
9+
'property-no-vendor-prefix': true,
10+
'value-no-vendor-prefix': true,
11+
'selector-no-vendor-prefix': true,
12+
'media-feature-name-no-vendor-prefix': true,
13+
'at-rule-no-vendor-prefix': true,
814
'no-descending-specificity': null,
915
'order/properties-alphabetical-order': true,
1016
'scale-unlimited/declaration-strict-value': [
11-
['color', 'background-color', 'font-weight', 'font-size', '/margin/', '/padding/'],
17+
[
18+
'color',
19+
'background-color',
20+
'font-weight',
21+
'font-size',
22+
'/margin/',
23+
'/padding/',
24+
'top',
25+
'bottom',
26+
'left',
27+
'right',
28+
],
1229
{
1330
ignoreValues: {
14-
'color': ['transparent', 'unset', 'inherit'],
15-
'background-color': ['transparent', 'unset', 'inherit'],
16-
'/margin/': ['unset', 0, 'inherit', 'auto'],
17-
'/padding/': ['unset', 0, 'inherit'],
31+
'color': ['transparent', 'unset', 'inherit', 'initial'],
32+
'background-color': ['transparent', 'unset', 'inherit', 'initial'],
33+
'/margin/': ['unset', 0, 'inherit', 'auto', 'initial'],
34+
'/padding/': ['unset', 0, 'inherit', 'initial', '/[0-9]+%/'],
35+
'top': ['unset', 0, 'inherit', 'auto', 'initial', '/[0-9]+%/'],
36+
'bottom': ['unset', 0, 'inherit', 'auto', 'initial', '/[0-9]+%/'],
37+
'left': ['unset', 0, 'inherit', 'auto', 'initial', '/[0-9]+%/'],
38+
'right': ['unset', 0, 'inherit', 'auto', 'initial', '/[0-9]+%/'],
1839
},
40+
disableFix: true,
1941
},
2042
],
2143
'declaration-no-important': true,
2244
'unit-allowed-list': [
23-
['rem', 's', 'ms'],
45+
['rem', 's', 'ms', '%'],
2446
{
2547
ignoreFunctions: ['/.*/'],
2648
severity: 'warning',
2749
ignoreProperties: {
28-
'%': ['min-width', 'max-width', 'width', 'min-height', 'max-height', 'height', 'flex-basis', 'flex'],
29-
'vw': ['min-width', 'max-width', 'width', 'min-height', 'max-height', 'height', 'flex-basis', 'flex'],
30-
'vh': ['min-width', 'max-width', 'width', 'min-height', 'max-height', 'height', 'flex-basis', 'flex'],
50+
vw: ['/width/', '/height/', '/flex/'],
51+
vh: ['/width/', '/height/', '/flex/'],
52+
fr: ['/grid/'],
53+
deg: ['rotate'],
3154
},
3255
},
3356
],

0 commit comments

Comments
 (0)