@markuplint/rules 4.9.4 → 4.10.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,23 @@
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
+ # [4.10.0](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.4...@markuplint/rules@4.10.0) (2024-09-23)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **rules:** excluded cases where the element is palpable from the `no-empty-palpable-content` rule ([6071c51](https://github.com/markuplint/markuplint/commit/6071c5133b7c5d52d8e052ac9f39fb5b10c38b8e))
12
+ * **rules:** fix the message of the `heading-levels` rule and add to translate in Japanese ([ec57e1e](https://github.com/markuplint/markuplint/commit/ec57e1e5ff4549ee5574928ad20fd461d87974a5))
13
+
14
+
15
+ ### Features
16
+
17
+ * **types:** avoid parsing and simply accept any value when the CSS includes `var()` ([5817693](https://github.com/markuplint/markuplint/commit/5817693cfcd1a253c627db323505e4b515f69395))
18
+
19
+
20
+
21
+
22
+
6
23
  ## [4.9.4](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.3...@markuplint/rules@4.9.4) (2024-09-02)
7
24
 
8
25
  **Note:** Version bump only for package @markuplint/rules
@@ -12,7 +12,7 @@ export default createRule({
12
12
  if (prevLevel + 1 < level) {
13
13
  report({
14
14
  scope: heading,
15
- message: t('Heading levels should not be skipped'),
15
+ message: t('{0} must not be skipped', t('Heading levels')),
16
16
  });
17
17
  }
18
18
  prevLevel = level;
@@ -1,6 +1,16 @@
1
1
  import { createRule } from '@markuplint/ml-core';
2
2
  import { isNothingContentModel, isPalpableElement } from '@markuplint/ml-spec';
3
3
  import meta from './meta.js';
4
+ const allowedElements = new Set([
5
+ // These elements are possibly empty because it to be filled by user interaction.
6
+ 'textarea',
7
+ 'output',
8
+ // Since the element itself is palpable, there is no need to determine whether its content is empty.
9
+ 'audio',
10
+ 'canvas',
11
+ 'video',
12
+ 'img',
13
+ ]);
4
14
  export default createRule({
5
15
  meta: meta,
6
16
  defaultSeverity: 'warning',
@@ -10,12 +20,7 @@ export default createRule({
10
20
  },
11
21
  async verify({ document, report, t }) {
12
22
  await document.walkOn('Element', el => {
13
- /**
14
- * Exception
15
- *
16
- * - The `textarea` element is possibly empty because a user inputs it.
17
- */
18
- if (el.localName === 'textarea') {
23
+ if (allowedElements.has(el.localName)) {
19
24
  return;
20
25
  }
21
26
  if (!isPalpableElement(el, el.ownerMLDocument.specs, {
@@ -16,7 +16,7 @@ export declare function isZeroOrMore(content: ReadonlyDeep<PermittedContentPatte
16
16
  export declare function isChoice(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentChoice>;
17
17
  export declare function isTransparent(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentTransparent>;
18
18
  export declare function normalizeModel(pattern: ReadonlyDeep<PermittedContentRequire> | ReadonlyDeep<PermittedContentOptional> | ReadonlyDeep<PermittedContentOneOrMore> | ReadonlyDeep<PermittedContentZeroOrMore>): {
19
- model: ReadonlyDeep<Model | PermittedContentPattern[]>;
19
+ model: ReadonlyDeep<PermittedContentPattern[] | Model>;
20
20
  min: number;
21
21
  max: number;
22
22
  repeat: RepeatSign;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "4.9.4",
3
+ "version": "4.10.0",
4
4
  "description": "Built-in rules of markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -25,18 +25,18 @@
25
25
  "./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
26
26
  },
27
27
  "dependencies": {
28
- "@markuplint/html-spec": "4.9.0",
29
- "@markuplint/ml-core": "4.8.3",
30
- "@markuplint/ml-spec": "4.6.4",
31
- "@markuplint/selector": "4.6.6",
32
- "@markuplint/shared": "4.4.4",
33
- "@markuplint/types": "4.5.4",
28
+ "@markuplint/html-spec": "4.9.1",
29
+ "@markuplint/ml-core": "4.9.0",
30
+ "@markuplint/ml-spec": "4.7.0",
31
+ "@markuplint/selector": "4.6.7",
32
+ "@markuplint/shared": "4.4.5",
33
+ "@markuplint/types": "4.6.0",
34
34
  "@types/debug": "4.1.12",
35
35
  "@ungap/structured-clone": "1.2.0",
36
36
  "ansi-colors": "4.1.3",
37
- "chrono-node": "2.7.6",
38
- "debug": "4.3.6",
39
- "type-fest": "4.26.0"
37
+ "chrono-node": "2.7.7",
38
+ "debug": "4.3.7",
39
+ "type-fest": "4.26.1"
40
40
  },
41
- "gitHead": "77cd5a25d5cf28c83253b7bfe02cd25b54e236b0"
41
+ "gitHead": "05d2eabfcc41b67847c24049f12dd2b9f5ca6485"
42
42
  }