@swissgeo/config-stylelint 1.0.0-beta.3 → 1.0.0-rc.1
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/README.md +92 -0
- package/package.json +8 -3
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @swissgeo/config-stylelint
|
|
2
|
+
|
|
3
|
+
Shared Stylelint configuration for SWISSGEO projects.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package provides a standardized Stylelint configuration for SWISSGEO projects, with support for:
|
|
8
|
+
|
|
9
|
+
- SCSS/Sass
|
|
10
|
+
- Vue Single File Components (SFC)
|
|
11
|
+
- CSS Modules
|
|
12
|
+
- Property ordering
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save-dev @swissgeo/config-stylelint stylelint postcss-html
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Basic Configuration
|
|
23
|
+
|
|
24
|
+
Create a `stylelint.config.js` file in your project root:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
import stylelintConfig from '@swissgeo/config-stylelint'
|
|
28
|
+
|
|
29
|
+
export default stylelintConfig
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or reference it in your `package.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"stylelint": {
|
|
37
|
+
"extends": "@swissgeo/config-stylelint"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Extending the Configuration
|
|
43
|
+
|
|
44
|
+
You can extend or override the default configuration:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import stylelintConfig from '@swissgeo/config-stylelint'
|
|
48
|
+
|
|
49
|
+
export default {
|
|
50
|
+
...stylelintConfig,
|
|
51
|
+
rules: {
|
|
52
|
+
// Your custom rules
|
|
53
|
+
'color-hex-length': 'long',
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
### Vue SFC Support
|
|
61
|
+
|
|
62
|
+
Automatically uses `postcss-html` custom syntax for `.vue` files to properly parse and lint styles within Vue Single File Components.
|
|
63
|
+
|
|
64
|
+
### SCSS/Sass Support
|
|
65
|
+
|
|
66
|
+
Extends `stylelint-config-recommended-scss` for comprehensive SCSS linting with `stylelint-scss` plugin.
|
|
67
|
+
|
|
68
|
+
### Property Ordering
|
|
69
|
+
|
|
70
|
+
Includes `stylelint-order` plugin for consistent CSS property ordering.
|
|
71
|
+
|
|
72
|
+
### Custom Rules
|
|
73
|
+
|
|
74
|
+
- **Duplicate Selectors**: Disabled to follow Sass mixin expected behavior
|
|
75
|
+
- **Unknown Properties**: Allowed in `:export` selectors (CSS Modules)
|
|
76
|
+
- **Variable Support**: Ignores SCSS variables (starting with `$`)
|
|
77
|
+
- **Pseudo-class Support**: Allows `:global`, `:export`, and `:deep` pseudo-classes
|
|
78
|
+
|
|
79
|
+
## Peer Dependencies
|
|
80
|
+
|
|
81
|
+
This package requires:
|
|
82
|
+
|
|
83
|
+
- `stylelint`
|
|
84
|
+
- `postcss-html`
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
BSD-3-Clause
|
|
89
|
+
|
|
90
|
+
## Repository
|
|
91
|
+
|
|
92
|
+
[https://github.com/geoadmin/web-mapviewer](https://github.com/geoadmin/web-mapviewer)
|
package/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swissgeo/config-stylelint",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"description": "Shared Stylelint config for SWISSGEO projects.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/geoadmin/web-mapviewer.git",
|
|
8
|
+
"directory": "packages/config/stylelint"
|
|
9
|
+
},
|
|
5
10
|
"license": "BSD-3-Clause",
|
|
6
11
|
"type": "module",
|
|
7
12
|
"main": "index.js",
|
|
8
13
|
"dependencies": {
|
|
14
|
+
"postcss-html": "^1.8.0",
|
|
9
15
|
"stylelint-config-recommended-scss": "^16.0.2",
|
|
10
16
|
"stylelint-config-recommended-vue": "^1.6.1",
|
|
11
17
|
"stylelint-order": "^7.0.0",
|
|
@@ -13,10 +19,9 @@
|
|
|
13
19
|
},
|
|
14
20
|
"devDependencies": {
|
|
15
21
|
"typescript": "^5.9.3",
|
|
16
|
-
"@swissgeo/config-typescript": "1.0.0-
|
|
22
|
+
"@swissgeo/config-typescript": "1.0.0-rc.1"
|
|
17
23
|
},
|
|
18
24
|
"peerDependencies": {
|
|
19
|
-
"postcss-html": "^1.8.0",
|
|
20
25
|
"stylelint": "^16.25.0"
|
|
21
26
|
}
|
|
22
27
|
}
|