@swissgeo/config-stylelint 1.0.0-beta.3 → 1.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.
Files changed (3) hide show
  1. package/README.md +96 -0
  2. package/index.js +1 -0
  3. package/package.json +11 -6
package/README.md ADDED
@@ -0,0 +1,96 @@
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
+ ### Ignore Files
73
+
74
+ By default, the configuration ignores all files in `**/dist/*.*`.
75
+
76
+ ### Custom Rules
77
+
78
+ - **Duplicate Selectors**: Disabled to follow Sass mixin expected behavior
79
+ - **Unknown Properties**: Allowed in `:export` selectors (CSS Modules)
80
+ - **Variable Support**: Ignores SCSS variables (starting with `$`)
81
+ - **Pseudo-class Support**: Allows `:global`, `:export`, and `:deep` pseudo-classes
82
+
83
+ ## Peer Dependencies
84
+
85
+ This package requires:
86
+
87
+ - `stylelint`
88
+ - `postcss-html`
89
+
90
+ ## License
91
+
92
+ BSD-3-Clause
93
+
94
+ ## Repository
95
+
96
+ [https://github.com/geoadmin/web-mapviewer](https://github.com/geoadmin/web-mapviewer)
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export default {
2
+ ignoreFiles: ['**/dist/*.*'],
2
3
  extends: ['stylelint-config-recommended-vue', 'stylelint-config-recommended-scss'],
3
4
  plugins: ['stylelint-scss', 'stylelint-order'],
4
5
  overrides: [
package/package.json CHANGED
@@ -1,22 +1,27 @@
1
1
  {
2
2
  "name": "@swissgeo/config-stylelint",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0",
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
- "stylelint-order": "^7.0.0",
12
- "stylelint-scss": "^6.12.1"
17
+ "stylelint-order": "^7.0.1",
18
+ "stylelint-scss": "^6.14.0"
13
19
  },
14
20
  "devDependencies": {
15
21
  "typescript": "^5.9.3",
16
- "@swissgeo/config-typescript": "1.0.0-beta.3"
22
+ "@swissgeo/config-typescript": "1.0.0"
17
23
  },
18
24
  "peerDependencies": {
19
- "postcss-html": "^1.8.0",
20
- "stylelint": "^16.25.0"
25
+ "stylelint": "^16.26.1"
21
26
  }
22
27
  }