sveld 0.18.0 → 0.18.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/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
  - add isAccessor field to API
11
11
  - update Markdown writer to generate a separate table for accessors -->
12
12
 
13
+ ## [0.18.1](https://github.com/carbon-design-system/sveld/releases/tag/v0.18.1) - 2023-06-04
14
+
15
+ - allow `data-*` attributes for props forwarded to HTML elements for `svelte-check@3.x` compatibility
16
+
13
17
  ## [0.18.0](https://github.com/carbon-design-system/sveld/releases/tag/v0.18.0) - 2022-10-22
14
18
 
15
19
  - support `@slot` tag descriptions for named slots
@@ -146,7 +146,12 @@ function genPropDef(def) {
146
146
  return "svelte.JSX.HTMLAttributes<HTMLElementTagNameMap[\"".concat(element, "\"]>");
147
147
  })
148
148
  .join(",");
149
- prop_def = "\n export interface ".concat(props_name, " extends ").concat(def["extends"] !== undefined ? "".concat(def["extends"].interface, ", ") : "").concat(extend_tag_map, " {\n ").concat(props, "\n }\n ");
149
+ /**
150
+ * Components that extend HTML elements should allow for `data-*` attributes.
151
+ * @see https://github.com/sveltejs/language-tools/issues/1825
152
+ */
153
+ var dataAttributes = "[key: `data-${string}`]: any;";
154
+ prop_def = "\n export interface ".concat(props_name, " extends ").concat(def["extends"] !== undefined ? "".concat(def["extends"].interface, ", ") : "").concat(extend_tag_map, " {\n ").concat(props, "\n \n ").concat(dataAttributes, "\n }\n ");
150
155
  }
151
156
  else {
152
157
  prop_def = "\n export interface ".concat(props_name, " ").concat(def["extends"] !== undefined ? "extends ".concat(def["extends"].interface) : "", " {\n ").concat(props, "\n }\n ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveld",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Generate TypeScript definitions for your Svelte components.",
6
6
  "main": "./lib/index.js",