@haltcase/style 6.1.0-canary.1 → 6.2.0-canary.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/package.json +17 -2
- package/readme.md +26 -0
- package/stylelint/index.js +43 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haltcase/style",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-canary.1",
|
|
4
4
|
"description": "haltcase's web ecosystem style guide & configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"./eslint/react": "./eslint/react.js",
|
|
31
31
|
"./eslint/typescript": "./eslint/typescript.js",
|
|
32
32
|
"./prettier": "./prettier/index.js",
|
|
33
|
+
"./stylelint": "./stylelint/index.js",
|
|
33
34
|
"./typescript/base": "./typescript/tsconfig.base.json",
|
|
34
35
|
"./typescript/bundler": "./typescript/tsconfig.bundler.json",
|
|
35
36
|
"./typescript/next": "./typescript/tsconfig.next.json",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"files": [
|
|
42
43
|
"eslint",
|
|
43
44
|
"prettier",
|
|
45
|
+
"stylelint",
|
|
44
46
|
"typescript",
|
|
45
47
|
"astro",
|
|
46
48
|
"next"
|
|
@@ -57,6 +59,9 @@
|
|
|
57
59
|
"*.{js,jsx,ts,tsx,css,yml,yaml}": "pnpm prettier --write"
|
|
58
60
|
},
|
|
59
61
|
"prettier": "./prettier",
|
|
62
|
+
"stylelint": {
|
|
63
|
+
"extends": "./stylelint/index.js"
|
|
64
|
+
},
|
|
60
65
|
"dependencies": {
|
|
61
66
|
"@babel/core": "^7.23.2",
|
|
62
67
|
"@babel/eslint-parser": "^7.22.15",
|
|
@@ -77,8 +82,13 @@
|
|
|
77
82
|
"eslint-plugin-testing-library": "^6.1.0",
|
|
78
83
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
79
84
|
"eslint-plugin-unicorn": "^48.0.1",
|
|
85
|
+
"postcss-html": "^1.6.0",
|
|
80
86
|
"prettier-plugin-astro": "^0.12.1",
|
|
81
|
-
"prettier-plugin-packagejson": "^2.4.6"
|
|
87
|
+
"prettier-plugin-packagejson": "^2.4.6",
|
|
88
|
+
"stylelint-config-clean-order": "^5.4.1",
|
|
89
|
+
"stylelint-config-html": "^1.1.0",
|
|
90
|
+
"stylelint-config-standard": "^36.0.0",
|
|
91
|
+
"stylelint-define-config": "^1.2.0"
|
|
82
92
|
},
|
|
83
93
|
"devDependencies": {
|
|
84
94
|
"@actions/core": "^1.10.1",
|
|
@@ -94,12 +104,14 @@
|
|
|
94
104
|
"lint-staged": "^15.0.2",
|
|
95
105
|
"prettier": "^3.0.3",
|
|
96
106
|
"semantic-release": "^22.0.5",
|
|
107
|
+
"stylelint": "^16.3.1",
|
|
97
108
|
"typescript": "^5.2.2"
|
|
98
109
|
},
|
|
99
110
|
"peerDependencies": {
|
|
100
111
|
"@next/eslint-plugin-next": ">=13.3.0 <15",
|
|
101
112
|
"eslint": ">=8.40.0 <9",
|
|
102
113
|
"prettier": ">=3.0.0 <4",
|
|
114
|
+
"stylelint": ">=16.3.1 <17",
|
|
103
115
|
"typescript": ">=5.0.0 <6"
|
|
104
116
|
},
|
|
105
117
|
"peerDependenciesMeta": {
|
|
@@ -115,6 +127,9 @@
|
|
|
115
127
|
"prettier": {
|
|
116
128
|
"optional": true
|
|
117
129
|
},
|
|
130
|
+
"stylelint": {
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
118
133
|
"typescript": {
|
|
119
134
|
"optional": true
|
|
120
135
|
}
|
package/readme.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
- [Prettier](#prettier)
|
|
6
6
|
- [ESLint](#eslint)
|
|
7
7
|
- [TypeScript](#typescript)
|
|
8
|
+
- [Stylelint](#stylelint)
|
|
8
9
|
|
|
9
10
|
> This package originated from [Vercel's style guide](https://github.com/vercel/style-guide).
|
|
10
11
|
|
|
@@ -224,6 +225,31 @@ You could also combine them with an `extends` array in [Typescript 5+](https://d
|
|
|
224
225
|
> [!TIP]
|
|
225
226
|
> Run `tsc --showConfig` to see the result of the combined configs.
|
|
226
227
|
|
|
228
|
+
### Stylelint
|
|
229
|
+
|
|
230
|
+
To format and check CSS with Stylelint, install the `stylelint` package and
|
|
231
|
+
set your configuration to extend from `@haltcase/style/stylelint`.
|
|
232
|
+
|
|
233
|
+
> [!NOTE]
|
|
234
|
+
> Stylelint is a peer dependency you'll need to install
|
|
235
|
+
> at the root of your project.
|
|
236
|
+
>
|
|
237
|
+
> See: https://stylelint.io/user-guide/get-started
|
|
238
|
+
|
|
239
|
+
Add the following in `package.json`:
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"stylelint": {
|
|
244
|
+
"extends": "@haltcase/style/stylelint"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
> [!TIP]
|
|
250
|
+
> See the [Stylelint documentation](https://stylelint.io/user-guide/configure)
|
|
251
|
+
> for other configuration options.
|
|
252
|
+
|
|
227
253
|
## contributing
|
|
228
254
|
|
|
229
255
|
Please read our [contributing](https://github.com/haltcase/style/blob/main/CONTRIBUTING.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const defineConfig = require("stylelint-define-config").defineConfig;
|
|
6
|
+
|
|
7
|
+
module.exports = defineConfig({
|
|
8
|
+
extends: [
|
|
9
|
+
"stylelint-config-standard",
|
|
10
|
+
"stylelint-config-html",
|
|
11
|
+
"stylelint-config-clean-order"
|
|
12
|
+
],
|
|
13
|
+
rules: {
|
|
14
|
+
"at-rule-empty-line-before": [
|
|
15
|
+
"always",
|
|
16
|
+
{
|
|
17
|
+
except: ["blockless-after-same-name-blockless", "first-nested"],
|
|
18
|
+
ignore: ["after-comment"]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"custom-property-empty-line-before": [
|
|
22
|
+
"always",
|
|
23
|
+
{
|
|
24
|
+
except: ["after-custom-property"],
|
|
25
|
+
ignore: ["after-comment", "first-nested", "inside-single-line-block"]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"declaration-empty-line-before": [
|
|
29
|
+
"always",
|
|
30
|
+
{
|
|
31
|
+
except: ["after-declaration", "first-nested"],
|
|
32
|
+
ignore: ["after-comment", "inside-single-line-block"]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"rule-empty-line-before": [
|
|
36
|
+
"always-multi-line",
|
|
37
|
+
{
|
|
38
|
+
except: ["first-nested"],
|
|
39
|
+
ignore: ["after-comment"]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
});
|