@murky-web/oxlint-plugin-solid 1.4.0 → 1.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@murky-web/oxlint-plugin-solid",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
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",
@@ -22,7 +22,6 @@ export default {
22
22
  "Disallow Solid's removed JSX attribute namespaces. Solid 2.0 dropped `on:`, `oncapture:`, `use:`, `prop:`, `attr:`, `bool:`, `class:` and `style:`.",
23
23
  url: "https://docs.solidjs.com/",
24
24
  },
25
- hasSuggestions: true,
26
25
  schema: [
27
26
  {
28
27
  type: "object",
@@ -48,8 +47,6 @@ export default {
48
47
  unknown:
49
48
  "'{{namespace}}:' is not a namespace Solid understands. Solid 2.0 has no special JSX prefixes.",
50
49
  component: "Namespaced props have no effect on components.",
51
- "component-suggest":
52
- "Replace {{namespace}}:{{name}} with {{name}}.",
53
50
  },
54
51
  },
55
52
  defaultOptions: [],
@@ -58,34 +55,24 @@ export default {
58
55
  context.options?.[0]?.allowedNamespaces;
59
56
  return {
60
57
  "JSXAttribute > JSXNamespacedName": (node) => {
58
+ const namespace = node.namespace?.name;
59
+ // The allow list covers every element: a framework can give a
60
+ // namespace meaning on components (`<Island client:visible>`).
61
+ if (explicitlyAllowedNamespaces?.includes(namespace)) {
62
+ return;
63
+ }
61
64
  const openingElement = node.parent.parent;
62
65
  if (
63
66
  openingElement.name.type === "JSXIdentifier" &&
64
67
  !isDOMElementName(openingElement.name.name)
65
68
  ) {
66
- // no namespaces on Solid component elements
67
- context.report({
68
- node,
69
- messageId: "component",
70
- suggest: [
71
- {
72
- messageId: "component-suggest",
73
- data: {
74
- namespace: node.namespace.name,
75
- name: node.name.name,
76
- },
77
- fix: (fixer) =>
78
- fixer.replaceText(node, node.name.name),
79
- },
80
- ],
81
- });
69
+ // Solid itself gives a namespaced prop on a component no
70
+ // meaning. No suggestion: deleting the prefix changes the
71
+ // prop's name, and the rule cannot know which one is meant.
72
+ context.report({ node, messageId: "component" });
82
73
  return;
83
74
  }
84
- const namespace = node.namespace?.name;
85
- if (
86
- xmlNamespaces.includes(namespace) ||
87
- explicitlyAllowedNamespaces?.includes(namespace)
88
- ) {
75
+ if (xmlNamespaces.includes(namespace)) {
89
76
  return;
90
77
  }
91
78
  const replacement = replacements[namespace];