@kaliber/build 0.0.122 → 0.0.123
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/stylelint-plugins/rules/layout-related-properties/index.js +4 -3
- package/stylelint-plugins/rules/layout-related-properties/readme.md +2 -0
- package/stylelint-plugins/rules/layout-related-properties/test.js +5 -0
- package/stylelint-plugins/rules/naming-policy/test.js +2 -0
package/package.json
CHANGED
@@ -4,7 +4,7 @@ const {
|
|
4
4
|
withRootRules, withNestedRules,
|
5
5
|
isPseudoElement,
|
6
6
|
} = require('../../machinery/ast')
|
7
|
-
const { flexChildProps, gridChildProps } = require('../../machinery/css')
|
7
|
+
const { flexChildProps, gridChildProps, flexOrGridChildProps } = require('../../machinery/css')
|
8
8
|
|
9
9
|
const intrinsicUnits = ['px', 'em', 'rem', 'vw', 'vh']
|
10
10
|
const intrinsicProps = ['width', 'height', 'max-width', 'min-width', 'max-height', 'min-height']
|
@@ -25,6 +25,7 @@ const layoutRelatedProps = [ // only allowed in child
|
|
25
25
|
'justify-self', 'align-self',
|
26
26
|
...flexChildProps,
|
27
27
|
...gridChildProps,
|
28
|
+
...flexOrGridChildProps,
|
28
29
|
...allowedInRootAndChild,
|
29
30
|
]
|
30
31
|
const layoutRelatedPropsWithValues = extractPropsWithValues(layoutRelatedProps)
|
@@ -36,9 +37,9 @@ const messages = {
|
|
36
37
|
`move to a nested selector in a another root rule, if you are forced by a third party ` +
|
37
38
|
`library, you can rename your selector to \`_rootXyz\` or \`component_rootXyz\`` + (
|
38
39
|
intrinsicProps.includes(prop)
|
39
|
-
|
40
|
+
? `\nif you are trying to define an intrinsic ${prop}, make sure you set the unit to ` +
|
40
41
|
`one of \`${intrinsicUnits.join('`, `')}\` and add \`!important\``
|
41
|
-
|
42
|
+
: ''
|
42
43
|
),
|
43
44
|
'nested - only layout related props in nested': prop =>
|
44
45
|
`illegal non-layout related prop\n` +
|
@@ -127,6 +127,7 @@ Examples of *correct* code for this rule:
|
|
127
127
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
128
128
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
129
129
|
justify-self: 0; align-self: 0;
|
130
|
+
order: 0;
|
130
131
|
}
|
131
132
|
}
|
132
133
|
```
|
@@ -143,6 +144,7 @@ Examples of *incorrect* code for this rule:
|
|
143
144
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
144
145
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
145
146
|
justify-self: 0; align-self: 0;
|
147
|
+
order: 0;
|
146
148
|
max-width: 0; min-width: 0; max-height: 0; min-height: 0;
|
147
149
|
}
|
148
150
|
```
|
@@ -19,6 +19,7 @@ test('layout-related-properties', {
|
|
19
19
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
20
20
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
21
21
|
justify-self: 0; align-self: 0;
|
22
|
+
order: 0;
|
22
23
|
}
|
23
24
|
}
|
24
25
|
`,
|
@@ -101,6 +102,7 @@ test('layout-related-properties', {
|
|
101
102
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
102
103
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
103
104
|
justify-self: 0; align-self: 0;
|
105
|
+
order: 0;
|
104
106
|
max-width: 0; min-width: 0; max-height: 0; min-height: 0;
|
105
107
|
}
|
106
108
|
`,
|
@@ -113,6 +115,7 @@ test('layout-related-properties', {
|
|
113
115
|
'grid', 'grid-area', 'grid-column', 'grid-row',
|
114
116
|
'grid-column-start', 'grid-column-end', 'grid-row-start', 'grid-row-end',
|
115
117
|
'justify-self', 'align-self',
|
118
|
+
'order',
|
116
119
|
'max-width', 'min-width', 'max-height', 'min-height',
|
117
120
|
])
|
118
121
|
},
|
@@ -133,6 +136,7 @@ test('layout-related-properties', {
|
|
133
136
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
134
137
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
135
138
|
justify-self: 0; align-self: 0;
|
139
|
+
order: 0;
|
136
140
|
}
|
137
141
|
}
|
138
142
|
`,
|
@@ -145,6 +149,7 @@ test('layout-related-properties', {
|
|
145
149
|
'grid', 'grid-area', 'grid-column', 'grid-row',
|
146
150
|
'grid-column-start', 'grid-column-end', 'grid-row-start', 'grid-row-end',
|
147
151
|
'justify-self', 'align-self',
|
152
|
+
'order',
|
148
153
|
])
|
149
154
|
},
|
150
155
|
{
|
@@ -138,6 +138,7 @@ test('naming-policy', {
|
|
138
138
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
139
139
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
140
140
|
justify-self: 0; align-self: 0;
|
141
|
+
order: 0;
|
141
142
|
}
|
142
143
|
|
143
144
|
.component_rootTest {
|
@@ -149,6 +150,7 @@ test('naming-policy', {
|
|
149
150
|
grid: 0; grid-area: 0; grid-column: 0; grid-row: 0;
|
150
151
|
grid-column-start: 0; grid-column-end: 0; grid-row-start: 0; grid-row-end: 0;
|
151
152
|
justify-self: 0; align-self: 0;
|
153
|
+
order: 0;
|
152
154
|
}
|
153
155
|
`,
|
154
156
|
},
|