@markuplint/svelte-spec 5.6.0 → 5.6.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
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.6.1](https://github.com/markuplint/markuplint/compare/v5.6.0...v5.6.1) (2026-11-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **svelte-spec:** take any number of on:, use: and bind:this ([590bca9](https://github.com/markuplint/markuplint/commit/590bca9d4bace09bd7f5916d34a7e0bd0c48a6fb))
11
+
12
+
6
13
  # [5.6.0](https://github.com/markuplint/markuplint/compare/v5.5.0...v5.6.0) (2026-11-12)
7
14
 
8
15
  **Note:** Version bump only for package @markuplint/svelte-spec
package/lib/index.js CHANGED
@@ -95,14 +95,32 @@ const spec = {
95
95
  },
96
96
  /**
97
97
  * The core engine evaluates these in order and the first match wins,
98
- * so `^bind:(?:group|this)$` must precede the generic `^bind:(.+)$`;
98
+ * so `^bind:this$` and `^bind:group$` must precede the generic `^bind:(.+)$`;
99
99
  * otherwise `bind:group` / `bind:this` would resolve to nonexistent
100
100
  * `group` / `this` attributes instead of staying directives.
101
101
  */
102
102
  directivePatterns: [
103
- // bind:group, bind:this → true directives
103
+ /**
104
+ * bind:this → a true directive. The compiler keeps the names of the attributes that it has seen, and
105
+ * leaves out one whose name is `this` (`<svelte:element bind:this this=…>` is allowed), so any number of
106
+ * it is not a repeat.
107
+ *
108
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
109
+ */
104
110
  {
105
- pattern: '^bind:(?:group|this)$',
111
+ pattern: '^bind:this$',
112
+ isDirective: true,
113
+ isDynamicValue: true,
114
+ isDuplicatable: true,
115
+ },
116
+ /**
117
+ * bind:group → a true directive. The compiler keeps its name with those of the attributes, and reports
118
+ * the repeat (`attribute_duplicate`), which the parser reports as it is.
119
+ *
120
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
121
+ */
122
+ {
123
+ pattern: '^bind:group$',
106
124
  isDirective: true,
107
125
  isDynamicValue: true,
108
126
  },
@@ -112,29 +130,61 @@ const spec = {
112
130
  potentialName: '$1',
113
131
  isDynamicValue: true,
114
132
  },
115
- // on:event (Svelte 4 legacy)
133
+ /**
134
+ * on:event (Svelte 4 legacy). The compiler checks the repeat of an attribute, `bind:`, `style:` and
135
+ * `class:`, and not of this. Its comment on the check says:
136
+ *
137
+ * > use can be used multiple times, same for the on directive
138
+ *
139
+ * The case of the name is kept (`on:click` and `on:CLICK` are two events), so any number is a repeat of
140
+ * nothing.
141
+ *
142
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
143
+ */
116
144
  {
117
145
  pattern: '^on:.+$',
118
146
  isDirective: true,
119
147
  isDynamicValue: true,
148
+ isDuplicatable: true,
149
+ },
150
+ /**
151
+ * use:action may be written any number of times (see `on:` above).
152
+ *
153
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
154
+ */
155
+ {
156
+ pattern: '^use:',
157
+ isDirective: true,
158
+ isDuplicatable: true,
120
159
  },
121
- // class:name → potentialName=class, isDuplicatable
160
+ /**
161
+ * class:name → potentialName=class, so it is not a repeat of `class`. The repeat of the same `class:name`
162
+ * is an error of the compiler (`attribute_duplicate`), which the parser reports as it is
163
+ * (`@markuplint/svelte-parser`), so this rule has nothing to add.
164
+ *
165
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
166
+ */
122
167
  {
123
168
  pattern: '^class:',
124
169
  potentialName: 'class',
125
170
  isDuplicatable: true,
126
171
  isDynamicValue: true,
127
172
  },
128
- // style:property → potentialName=style, isDuplicatable
173
+ /**
174
+ * style:property → potentialName=style, so it is not a repeat of `style`. The repeat of the same
175
+ * property is an error of the compiler, which the parser reports as it is, as for `class:` above.
176
+ *
177
+ * @see https://github.com/sveltejs/svelte/blob/main/packages/svelte/src/compiler/phases/1-parse/state/element.js#element
178
+ */
129
179
  {
130
180
  pattern: '^style:',
131
181
  potentialName: 'style',
132
182
  isDuplicatable: true,
133
183
  isDynamicValue: true,
134
184
  },
135
- // animate:, transition:, in:, out:, use:, let: → isDirective
185
+ // animate:, transition:, in:, out:, let: → isDirective
136
186
  {
137
- pattern: '^(?:animate|transition|in|out|use|let):',
187
+ pattern: '^(?:animate|transition|in|out|let):',
138
188
  isDirective: true,
139
189
  },
140
190
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/svelte-spec",
3
- "version": "5.6.0",
3
+ "version": "5.6.1",
4
4
  "description": "Extended specification for tags and attributes in Svelte",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "clean": "tsc --build --clean tsconfig.build.json"
29
29
  },
30
30
  "dependencies": {
31
- "@markuplint/ml-spec": "5.6.0"
31
+ "@markuplint/ml-spec": "5.6.1"
32
32
  },
33
- "gitHead": "eade3d7202682e567f3c1b6985478f1d4b5c5481"
33
+ "gitHead": "a9245162df3699c4880469f493aaaf6103343d83"
34
34
  }