@murky-web/oxlint-plugin-solid 1.4.1 → 1.5.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@murky-web/oxlint-plugin-solid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Local Oxlint JS plugin port for Solid rules plus Murky-specific Solid conventions.",
|
|
6
6
|
"homepage": "https://github.com/MurkyTheMurloc/web_dev_tools/tree/main/packages/oxlint-plugin-solid",
|
|
@@ -33,7 +33,17 @@ export default {
|
|
|
33
33
|
items: {
|
|
34
34
|
type: "string",
|
|
35
35
|
},
|
|
36
|
-
|
|
36
|
+
minItems: 1,
|
|
37
|
+
uniqueItems: true,
|
|
38
|
+
},
|
|
39
|
+
allowedNamespacedProps: {
|
|
40
|
+
description:
|
|
41
|
+
"an array of exact namespaced prop names to allow, such as `client:visible`",
|
|
42
|
+
type: "array",
|
|
43
|
+
items: {
|
|
44
|
+
type: "string",
|
|
45
|
+
pattern: "^[^:]+:[^:]+$",
|
|
46
|
+
},
|
|
37
47
|
minItems: 1,
|
|
38
48
|
uniqueItems: true,
|
|
39
49
|
},
|
|
@@ -53,12 +63,21 @@ export default {
|
|
|
53
63
|
create(context) {
|
|
54
64
|
const explicitlyAllowedNamespaces =
|
|
55
65
|
context.options?.[0]?.allowedNamespaces;
|
|
66
|
+
const explicitlyAllowedProps =
|
|
67
|
+
context.options?.[0]?.allowedNamespacedProps;
|
|
56
68
|
return {
|
|
57
69
|
"JSXAttribute > JSXNamespacedName": (node) => {
|
|
58
70
|
const namespace = node.namespace?.name;
|
|
59
|
-
//
|
|
71
|
+
// Both allow lists cover every element: a framework can give a
|
|
60
72
|
// namespace meaning on components (`<Island client:visible>`).
|
|
61
|
-
|
|
73
|
+
// `allowedNamespacedProps` names single props, so a typo or an
|
|
74
|
+
// unsupported prop of the same namespace is still reported.
|
|
75
|
+
if (
|
|
76
|
+
explicitlyAllowedNamespaces?.includes(namespace) ||
|
|
77
|
+
explicitlyAllowedProps?.includes(
|
|
78
|
+
`${namespace}:${node.name?.name}`,
|
|
79
|
+
)
|
|
80
|
+
) {
|
|
62
81
|
return;
|
|
63
82
|
}
|
|
64
83
|
const openingElement = node.parent.parent;
|