@markuplint/ml-core 5.0.0-dev.5 → 5.0.0-rc.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/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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.0.0-rc.0](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.3...v5.0.0-rc.0) (2026-03-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **pretenders:** fix false positives in children detection and harden tests ([96f7af3](https://github.com/markuplint/markuplint/commit/96f7af3adf4d6a3b8c65a9e9464cf1bf34c48613))
11
+
12
+ ### Features
13
+
14
+ - **pretenders,ml-core:** implement slots detection in JSX scanner and ml-core consumption ([ad9c8e2](https://github.com/markuplint/markuplint/commit/ad9c8e20d233cddc752fce9ad83838857f81787f)), closes [#3341](https://github.com/markuplint/markuplint/issues/3341)
15
+
6
16
  # [5.0.0-alpha.3](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.2...v5.0.0-alpha.3) (2026-02-26)
7
17
 
8
18
  ### Bug Fixes
package/lib/ml-core.d.ts CHANGED
@@ -64,7 +64,7 @@ export declare class MLCore {
64
64
  /**
65
65
  * The parsed document, or a {@link ParserError} if parsing failed.
66
66
  */
67
- get document(): Document<RuleConfigValue, PlainData> | ParserError;
67
+ get document(): ParserError | Document<RuleConfigValue, PlainData>;
68
68
  /**
69
69
  * Replaces the source code and re-parses the document.
70
70
  *
@@ -7,7 +7,7 @@ import { MLAttr } from './attr.js';
7
7
  import { MLDomTokenList } from './dom-token-list.js';
8
8
  import { MLElementCloseTag } from './element-close-tag.js';
9
9
  import { toNamedNodeMap } from './named-node-map.js';
10
- import { toHTMLCollection } from './node-list.js';
10
+ import { toHTMLCollection, toNodeList } from './node-list.js';
11
11
  import { MLParentNode } from './parent-node.js';
12
12
  import { UnexpectedCallError } from './unexpected-call-error.js';
13
13
  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
@@ -2911,6 +2911,7 @@ export class MLElement extends MLParentNode {
2911
2911
  }
2912
2912
  aria = pretenderElement.aria;
2913
2913
  }
2914
+ const slots = typeof pretenderElement === 'string' ? undefined : pretenderElement.slots;
2914
2915
  const as = new MLElement({
2915
2916
  ...this._astToken,
2916
2917
  uuid: this.uuid + '_pretender',
@@ -2920,7 +2921,14 @@ export class MLElement extends MLParentNode {
2920
2921
  elementType: 'html',
2921
2922
  attributes,
2922
2923
  }, this.ownerMLDocument);
2923
- as.resetChildren(this.childNodes);
2924
+ // When slots is null, the component does not accept children (void-like).
2925
+ // Explicitly set empty children to prevent inheriting from the AST token.
2926
+ if (slots === null) {
2927
+ as.resetChildren(toNodeList([]));
2928
+ }
2929
+ else {
2930
+ as.resetChildren(this.childNodes);
2931
+ }
2924
2932
  as.pretenderContext = {
2925
2933
  type: 'origin',
2926
2934
  origin: this,
package/lib/test/index.js CHANGED
@@ -19,9 +19,7 @@ export function createTestDocument(sourceCode, options) {
19
19
  : options.parser.parse(sourceCode, options.config?.parserOptions)
20
20
  : parser.parse(sourceCode, options?.config?.parserOptions);
21
21
  const ruleset = convertRuleset(options?.config);
22
- const document = new MLDocument(ast, ruleset, [options?.specs ?? {}, {}], {
23
- ariaVersion: ARIA_RECOMMENDED_VERSION,
24
- });
22
+ const document = new MLDocument(ast, ruleset, [options?.specs ?? {}, {}], { ariaVersion: ARIA_RECOMMENDED_VERSION }, options?.pretenders ? { pretenders: options.pretenders } : undefined);
25
23
  return document;
26
24
  }
27
25
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-core",
3
- "version": "5.0.0-dev.5+e96392f56",
3
+ "version": "5.0.0-rc.0",
4
4
  "description": "The core module of markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -30,20 +30,20 @@
30
30
  "./lib/configs.js": "./lib/configs.browser.js"
31
31
  },
32
32
  "dependencies": {
33
- "@markuplint/config-presets": "5.0.0-dev.5+e96392f56",
34
- "@markuplint/html-parser": "5.0.0-dev.5+e96392f56",
35
- "@markuplint/html-spec": "5.0.0-dev.5+e96392f56",
36
- "@markuplint/i18n": "5.0.0-dev.5+e96392f56",
37
- "@markuplint/ml-ast": "5.0.0-dev.5+e96392f56",
38
- "@markuplint/ml-config": "5.0.0-dev.5+e96392f56",
39
- "@markuplint/ml-spec": "5.0.0-dev.5+e96392f56",
40
- "@markuplint/parser-utils": "5.0.0-dev.5+e96392f56",
41
- "@markuplint/selector": "5.0.0-dev.5+e96392f56",
42
- "@markuplint/shared": "5.0.0-dev.5+e96392f56",
33
+ "@markuplint/config-presets": "5.0.0-rc.0",
34
+ "@markuplint/html-parser": "5.0.0-rc.0",
35
+ "@markuplint/html-spec": "5.0.0-rc.0",
36
+ "@markuplint/i18n": "5.0.0-rc.0",
37
+ "@markuplint/ml-ast": "5.0.0-rc.0",
38
+ "@markuplint/ml-config": "5.0.0-rc.0",
39
+ "@markuplint/ml-spec": "5.0.0-rc.0",
40
+ "@markuplint/parser-utils": "5.0.0-rc.0",
41
+ "@markuplint/selector": "5.0.0-rc.0",
42
+ "@markuplint/shared": "5.0.0-rc.0",
43
43
  "@types/debug": "4.1.12",
44
44
  "debug": "4.4.3",
45
45
  "is-plain-object": "5.0.0",
46
46
  "type-fest": "5.4.4"
47
47
  },
48
- "gitHead": "e96392f56e4bc8165ba59622b41c822703a96372"
48
+ "gitHead": "ebf4d7cfca0c259aead3b292c6b8a202db4cd802"
49
49
  }