attio 0.0.1-experimental.20250619 → 0.0.1-experimental.20250625

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/lint.cjs CHANGED
@@ -79,7 +79,8 @@ module.exports = {
79
79
  meta: {
80
80
  type: "problem",
81
81
  docs: {
82
- description: "Ensure <Form/> components have exactly one <SubmitButton/> as a direct child, and <SubmitButton/> components only appear as direct children of <Form/> components",
82
+ description:
83
+ "Ensure <Form/> components have exactly one <SubmitButton/> as a direct child, and <SubmitButton/> components only appear as direct children of <Form/> components",
83
84
  category: "Possible Errors",
84
85
  recommended: true,
85
86
  },
@@ -93,7 +94,7 @@ module.exports = {
93
94
  let submitButtonCount = 0
94
95
 
95
96
  // Check direct children only
96
- node.children.forEach(child => {
97
+ node.children.forEach((child) => {
97
98
  if (child.type === "JSXElement") {
98
99
  if (child.openingElement.name.name === "SubmitButton") {
99
100
  submitButtonCount++
@@ -104,22 +105,29 @@ module.exports = {
104
105
  if (submitButtonCount === 0) {
105
106
  context.report({
106
107
  node,
107
- message: "<Form/> component must have exactly one <SubmitButton/> as a direct child",
108
+ message:
109
+ "<Form/> component must have exactly one <SubmitButton/> as a direct child",
108
110
  })
109
111
  } else if (submitButtonCount > 1) {
110
112
  context.report({
111
113
  node,
112
- message: "<Form/> component must not have multiple <SubmitButton/> children",
114
+ message:
115
+ "<Form/> component must not have multiple <SubmitButton/> children",
113
116
  })
114
117
  }
115
118
  }
116
119
  // Check if this is a SubmitButton that's not a direct child of Form
117
120
  else if (node.openingElement.name.name === "SubmitButton") {
118
121
  const parent = node.parent
119
- if (!parent || parent.type !== "JSXElement" || parent.openingElement.name.name !== "Form") {
122
+ if (
123
+ !parent ||
124
+ parent.type !== "JSXElement" ||
125
+ parent.openingElement.name.name !== "Form"
126
+ ) {
120
127
  context.report({
121
128
  node,
122
- message: "<SubmitButton/> must be a direct child of a <Form/> component",
129
+ message:
130
+ "<SubmitButton/> must be a direct child of a <Form/> component",
123
131
  })
124
132
  }
125
133
  }
@@ -131,7 +139,8 @@ module.exports = {
131
139
  meta: {
132
140
  type: "problem",
133
141
  docs: {
134
- description: "Ensure <Widget.TextWidget/> direct children are only <Widget.Title/>, <Widget.Badge/>, <Widget.Text.Primary/>, <Widget.Text.Secondary/>, or a custom component.",
142
+ description:
143
+ "Ensure <Widget.TextWidget/> direct children are only <Widget.Title/>, <Widget.Badge/>, <Widget.Text.Primary/>, <Widget.Text.Secondary/>, or a custom component.",
135
144
  category: "Possible Errors",
136
145
  recommended: true,
137
146
  },
@@ -139,27 +148,29 @@ module.exports = {
139
148
  },
140
149
  create(context) {
141
150
  function isValidWidgetTextChild(child) {
142
- if (child.type !== "JSXElement") return true; // Ignore non-elements (e.g. text, expressions)
143
- const name = child.openingElement.name;
151
+ if (child.type !== "JSXElement") return true // Ignore non-elements (e.g. text, expressions)
152
+ const name = child.openingElement.name
144
153
 
145
154
  // Allow <Widget.Title/>
146
- if (name.type === "JSXMemberExpression" &&
155
+ if (
156
+ name.type === "JSXMemberExpression" &&
147
157
  name.object.type === "JSXIdentifier" &&
148
158
  name.object.name === "Widget" &&
149
159
  name.property.type === "JSXIdentifier" &&
150
160
  name.property.name === "Title"
151
161
  ) {
152
- return true;
162
+ return true
153
163
  }
154
164
 
155
165
  // Allow <Widget.Badge/>
156
- if (name.type === "JSXMemberExpression" &&
166
+ if (
167
+ name.type === "JSXMemberExpression" &&
157
168
  name.object.type === "JSXIdentifier" &&
158
169
  name.object.name === "Widget" &&
159
170
  name.property.type === "JSXIdentifier" &&
160
171
  name.property.name === "Badge"
161
172
  ) {
162
- return true;
173
+ return true
163
174
  }
164
175
 
165
176
  // Allow <Widget.Text.Primary/> and <Widget.Text.Secondary/>
@@ -173,15 +184,15 @@ module.exports = {
173
184
  name.property.type === "JSXIdentifier" &&
174
185
  (name.property.name === "Primary" || name.property.name === "Secondary")
175
186
  ) {
176
- return true;
187
+ return true
177
188
  }
178
189
 
179
190
  // Allow custom components (start with uppercase, not built-in HTML)
180
191
  if (name.type === "JSXIdentifier" && /^[A-Z]/.test(name.name)) {
181
- return true;
192
+ return true
182
193
  }
183
194
 
184
- return false;
195
+ return false
185
196
  }
186
197
  return {
187
198
  JSXElement(node) {
@@ -195,7 +206,7 @@ module.exports = {
195
206
  name.property.name === "TextWidget") ||
196
207
  (name.type === "JSXIdentifier" && name.name === "Widget.TextWidget")
197
208
  ) {
198
- node.children.forEach(child => {
209
+ node.children.forEach((child) => {
199
210
  if (!isValidWidgetTextChild(child)) {
200
211
  context.report({
201
212
  node: child,
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "attio",
3
- "version": "0.0.1-experimental.20250619",
4
- "bin": "lib/attio.js",
3
+ "version": "0.0.1-experimental.20250625",
5
4
  "type": "module",
6
5
  "files": [
7
6
  "lib",
@@ -61,5 +60,6 @@
61
60
  "ts-morph": "^24.0.0",
62
61
  "typescript": "5.6.3",
63
62
  "zod": "^3.25.64"
64
- }
63
+ },
64
+ "bin": "lib/attio.js"
65
65
  }