Skip to content

Commit 3e51f61

Browse files
committed
feat: Move and rename configs + fix issues
1 parent a63152e commit 3e51f61

File tree

8 files changed

+265
-245
lines changed

8 files changed

+265
-245
lines changed

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,25 @@
77
"author": "Max Milton <max@happyhackers.xyz>",
88
"license": "MIT",
99
"type": "module",
10-
"main": "stylelint.config.js",
11-
"types": "stylelint.config.d.ts",
10+
"main": "src/index.js",
11+
"types": "src/index.d.ts",
1212
"exports": {
1313
".": {
14-
"types": "./stylelint.config.d.ts",
15-
"default": "./stylelint.config.js"
14+
"types": "./src/index.d.ts",
15+
"default": "./src/index.js"
1616
},
17-
"./tailwind": {
18-
"types": "./stylelint.config.d.ts",
19-
"default": "./stylelint-tailwind.config.js"
17+
"./tailwindcss": {
18+
"types": "./src/index.d.ts",
19+
"default": "./src/tailwindcss.js"
2020
},
2121
"./xcss": {
22-
"types": "./stylelint.config.d.ts",
23-
"default": "./stylelint-xcss.config.js"
22+
"types": "./src/index.d.ts",
23+
"default": "./src/xcss.js"
2424
}
2525
},
26+
"files": [
27+
"src"
28+
],
2629
"scripts": {
2730
"lint": "bun lint:fmt && bun lint:js && bun lint:ts",
2831
"lint:fmt": "biome check",
File renamed without changes.

src/index.js

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
const propertyOrder = [
2+
'all',
3+
'#apply',
4+
5+
// Position
6+
'position',
7+
'z-index',
8+
'inset',
9+
'inset-block',
10+
'inset-block-start',
11+
'inset-block-end',
12+
'inset-inline',
13+
'inset-inline-start',
14+
'inset-inline-end',
15+
'top',
16+
'right',
17+
'bottom',
18+
'left',
19+
20+
// Box model & layout
21+
'display',
22+
'box-sizing',
23+
'vertical-align',
24+
'flex',
25+
'flex-basis',
26+
'flex-direction',
27+
'flex-flow',
28+
'flex-grow',
29+
'flex-shrink',
30+
'flex-wrap',
31+
'grid',
32+
'grid-area',
33+
'grid-template',
34+
'grid-template-areas',
35+
'grid-template-rows',
36+
'grid-template-columns',
37+
'grid-row',
38+
'grid-row-start',
39+
'grid-row-end',
40+
'grid-column',
41+
'grid-column-start',
42+
'grid-column-end',
43+
'grid-auto-rows',
44+
'grid-auto-columns',
45+
'grid-auto-flow',
46+
'grid-gap',
47+
'grid-row-gap',
48+
'grid-column-gap',
49+
'gap',
50+
'row-gap',
51+
'column-gap',
52+
'place-content',
53+
'place-items',
54+
'place-self',
55+
'align-content',
56+
'align-items',
57+
'align-self',
58+
'justify-content',
59+
'justify-items',
60+
'justify-self',
61+
'order',
62+
'float',
63+
'clear',
64+
'object-fit',
65+
'overflow',
66+
'overflow-x',
67+
'overflow-y',
68+
'overflow-scrolling',
69+
'clip',
70+
'clip-path',
71+
'inline-size',
72+
'width',
73+
'min-width',
74+
'max-width',
75+
'height',
76+
'min-height',
77+
'max-height',
78+
'margin',
79+
'margin-top',
80+
'margin-right',
81+
'margin-bottom',
82+
'margin-left',
83+
'padding',
84+
'padding-top',
85+
'padding-right',
86+
'padding-bottom',
87+
'padding-left',
88+
'border',
89+
'border-spacing',
90+
'border-collapse',
91+
'border-width',
92+
'border-style',
93+
'border-color',
94+
'border-radius',
95+
'border-image',
96+
'border-image-source',
97+
'border-image-slice',
98+
'border-image-width',
99+
'border-image-outset',
100+
'border-image-repeat',
101+
'border-top',
102+
'border-top-width',
103+
'border-top-style',
104+
'border-top-color',
105+
'border-top-radius',
106+
'border-top-image',
107+
'border-right',
108+
'border-right-width',
109+
'border-right-style',
110+
'border-right-color',
111+
'border-right-radius',
112+
'border-right-image',
113+
'border-bottom',
114+
'border-bottom-width',
115+
'border-bottom-style',
116+
'border-bottom-color',
117+
'border-bottom-radius',
118+
'border-bottom-image',
119+
'border-left',
120+
'border-left-width',
121+
'border-left-style',
122+
'border-left-color',
123+
'border-left-radius',
124+
'border-left-image',
125+
'border-top-left-radius',
126+
'border-top-right-radius',
127+
'border-bottom-right-radius',
128+
'border-bottom-left-radius',
129+
'border-corner-image',
130+
'border-top-left-image',
131+
'border-top-right-image',
132+
'border-bottom-right-image',
133+
'border-bottom-left-image',
134+
135+
// Typography
136+
'color',
137+
'font',
138+
'font-family',
139+
'font-size',
140+
'font-style',
141+
'font-weight',
142+
'font-variant',
143+
'font-size-adjust',
144+
'font-stretch',
145+
'font-display',
146+
'src',
147+
'unicode-range',
148+
'line-height',
149+
'letter-spacing',
150+
'quotes',
151+
'counter-increment',
152+
'counter-reset',
153+
'writing-mode',
154+
'text-align',
155+
'text-align-last',
156+
'text-decoration',
157+
'text-emphasis',
158+
'text-emphasis-color',
159+
'text-emphasis-style',
160+
'text-emphasis-position',
161+
'text-indent',
162+
'text-justify',
163+
'text-outline',
164+
'text-transform',
165+
'text-wrap',
166+
'text-overflow',
167+
'text-overflow-ellipsis',
168+
'text-overflow-mode',
169+
'text-shadow',
170+
'white-space',
171+
'word-break',
172+
'word-spacing',
173+
'word-wrap',
174+
'overflow-wrap',
175+
'tab-size',
176+
'hyphens',
177+
];
178+
179+
/** @type {import('stylelint').Config} */
180+
export default {
181+
plugins: ['stylelint-order'],
182+
rules: {
183+
'comment-empty-line-before': [
184+
'always',
185+
{
186+
except: ['first-nested'],
187+
ignore: ['after-comment', 'stylelint-commands'],
188+
ignoreComments: ['/^biome-ignore/', 'prettier-ignore'],
189+
},
190+
],
191+
'order/order': [
192+
[
193+
'dollar-variables',
194+
'custom-properties',
195+
'at-rules',
196+
'declarations',
197+
{ type: 'at-rule', name: 'supports' },
198+
{ type: 'at-rule', name: 'media' },
199+
'rules',
200+
],
201+
{ severity: 'warning' },
202+
],
203+
'order/properties-order': [
204+
propertyOrder,
205+
{
206+
unspecified: 'bottomAlphabetical',
207+
severity: 'warning',
208+
},
209+
],
210+
},
211+
};

stylelint-tailwind.config.js renamed to src/tailwindcss.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
11
/** @type {import('stylelint').Config} */
2-
export const config = {
2+
export default {
33
rules: {
4+
'at-rule-no-deprecated': [true, { ignoreAtRules: ['apply'] }],
45
'at-rule-no-unknown': [
56
true,
67
{
78
ignoreAtRules: [
89
/** tailwindcss v4 */
10+
// https://tailwindcss.com/docs/functions-and-directives
911
'theme',
1012
'source',
1113
'utility',
1214
'variant',
1315
'custom-variant',
1416
'plugin',
17+
'reference',
1518
/** tailwindcss v3 */
19+
// https://v3.tailwindcss.com/docs/functions-and-directives
1620
'tailwind',
1721
'apply',
1822
'layer',
1923
'config',
2024
/** tailwindcss v1, v2 */
2125
// 'variants',
2226
// 'responsive',
23-
// 'screen',
27+
'screen',
2428
],
2529
},
2630
],
27-
'function-no-unknown': [true, { ignoreFunctions: ['theme'] }],
31+
'declaration-property-value-no-unknown': [
32+
true,
33+
{ ignoreProperties: { '/.+/': ['/theme(.+)/'] } },
34+
],
35+
'function-no-unknown': [
36+
true,
37+
{ ignoreFunctions: ['--alpha', '--spacing', 'theme'] },
38+
],
2839
'import-notation': null,
2940
},
3041
};
31-
32-
export default config;

src/xcss.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/** @type {import('stylelint').Config} */
2+
export default {
3+
rules: {},
4+
overrides: [
5+
{
6+
files: ['**/*.xcss'],
7+
customSyntax: 'postcss-ekscss',
8+
rules: {
9+
'declaration-property-value-no-unknown': [
10+
true,
11+
{ ignoreProperties: { '#apply': '/.+/' } },
12+
],
13+
'import-notation': null,
14+
'property-no-unknown': [true, { ignoreProperties: ['#apply'] }],
15+
},
16+
},
17+
],
18+
};

stylelint-xcss.config.js

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

0 commit comments

Comments
 (0)