@galaxy-io/dls 2.3.1 → 2.3.2
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.
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// DLS: no inline `style={{ … }}` except to set CSS custom properties (Constitution IV.1).
|
|
2
|
-
// `style={{ "--gx-x": value, ["--gx-y"]: value, ...style }}` is
|
|
3
|
-
//
|
|
2
|
+
// `style={{ "--gx-x": value, ["--gx-y"]: value, [GRID_BACKGROUND_COLOR_VAR]: value, ...style }}` is
|
|
3
|
+
// fine (a computed key named `*_VAR` is an exported custom-property constant); `style={{ color: … }}`,
|
|
4
|
+
// `style={{ color }}` (shorthand) and `style={{ [key]: … }}` (any other computed key) are not.
|
|
4
5
|
language js
|
|
5
6
|
|
|
6
7
|
JsxAttribute(name=$name, initializer=$value) where {
|
|
7
8
|
$name <: "style",
|
|
8
9
|
$value <: contains or {
|
|
9
|
-
JsPropertyObjectMember(name=$key) as $member where {
|
|
10
|
+
JsPropertyObjectMember(name=$key) as $member where {
|
|
11
|
+
$key <: not r"(?s)(?:(?:\[\s*)?[\"'`]--.*|\[\s*[A-Z][A-Z0-9_]*_VAR\s*\])"
|
|
12
|
+
},
|
|
10
13
|
JsShorthandPropertyObjectMember() as $member
|
|
11
14
|
},
|
|
12
15
|
register_diagnostic(span=$member, message="DLS: inline style may only set CSS custom properties (`--gx-*`). Style with Linaria.", severity="error")
|
|
@@ -6,7 +6,9 @@ language js
|
|
|
6
6
|
JsxAttribute(name=$name, initializer=$value) where {
|
|
7
7
|
$name <: "style",
|
|
8
8
|
$value <: contains or {
|
|
9
|
-
JsPropertyObjectMember(name=$key) as $member where {
|
|
9
|
+
JsPropertyObjectMember(name=$key) as $member where {
|
|
10
|
+
$key <: not r"(?s)(?:(?:\[\s*)?[\"'`]--.*|\[\s*[A-Z][A-Z0-9_]*_VAR\s*\])"
|
|
11
|
+
},
|
|
10
12
|
JsShorthandPropertyObjectMember() as $member
|
|
11
13
|
},
|
|
12
14
|
register_diagnostic(span=$member, message="DLS: inline style may only set CSS custom properties (`--gx-*`). Style with Linaria.", severity="warn")
|