@markuplint/rules 2.4.6 → 2.4.8

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/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  ### Conformance checking
10
10
 
11
11
  - [`attr-duplication`](./src/attr-duplication)
12
- - [`character-reference`](./src/character-reference)
13
12
  - [`deprecated-attr`](./src/deprecated-attr)
14
13
  - [`deprecated-element`](./src/deprecated-element)
15
14
  - [`disallowed-element`](./src/disallowed-element)
@@ -46,6 +45,7 @@
46
45
  - [`attr-value-quotes`](./src/attr-value-quotes)
47
46
  - [`case-sensitive-attr-name`](./src/case-sensitive-attr-name)
48
47
  - [`case-sensitive-tag-name`](./src/case-sensitive-tag-name)
48
+ - [`character-reference`](./src/character-reference)
49
49
  - [`end-tag`](./src/end-tag)
50
50
  - [`indentation`](./src/indentation)
51
51
  - [`no-boolean-attr-value`](./src/no-boolean-attr-value)
@@ -0,0 +1,6 @@
1
+ type Options = {
2
+ extendsExposableElements?: boolean;
3
+ ignoreIfAriaBusy?: boolean;
4
+ };
5
+ declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Options>;
6
+ export default _default;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ml_core_1 = require("@markuplint/ml-core");
4
+ const ml_spec_1 = require("@markuplint/ml-spec");
5
+ exports.default = (0, ml_core_1.createRule)({
6
+ defaultSeverity: 'warning',
7
+ defaultOptions: {
8
+ extendsExposableElements: true,
9
+ ignoreIfAriaBusy: true,
10
+ },
11
+ async verify({ document, report, t }) {
12
+ await document.walkOn('Element', el => {
13
+ if (!(0, ml_spec_1.isPalpableElement)(el, el.ownerMLDocument.specs, {
14
+ extendsSvg: false,
15
+ extendsExposableElements: el.rule.option.extendsExposableElements,
16
+ })) {
17
+ return;
18
+ }
19
+ if ((0, ml_spec_1.isVoidElement)(el)) {
20
+ return;
21
+ }
22
+ if (el.rule.option.ignoreIfAriaBusy && el.getAttribute('aria-busy') === 'true') {
23
+ return;
24
+ }
25
+ const isEmpty = Array.from(el.childNodes).every(node => node.is(node.TEXT_NODE) && node.isWhitespace());
26
+ if (isEmpty) {
27
+ report({
28
+ scope: el,
29
+ message: t('{0} should not {1}', t('the {0}', 'element'), 'empty'),
30
+ });
31
+ }
32
+ });
33
+ },
34
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "2.4.6",
3
+ "version": "2.4.8",
4
4
  "description": "Rules for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -17,10 +17,10 @@
17
17
  "clean": "tsc --build --clean"
18
18
  },
19
19
  "dependencies": {
20
- "@markuplint/html-spec": "2.9.0",
21
- "@markuplint/ml-core": "2.3.5",
22
- "@markuplint/ml-spec": "2.1.1",
23
- "@markuplint/types": "2.2.0",
20
+ "@markuplint/html-spec": "2.9.1",
21
+ "@markuplint/ml-core": "2.3.6",
22
+ "@markuplint/ml-spec": "2.1.2",
23
+ "@markuplint/types": "2.2.1",
24
24
  "debug": "^4.3.4",
25
25
  "html-entities": "^2.3.3",
26
26
  "tslib": "^2.3.1"
@@ -28,5 +28,5 @@
28
28
  "devDependencies": {
29
29
  "@types/debug": "^4.1.7"
30
30
  },
31
- "gitHead": "c3e38fbec92fffa4a44564d1c7a37963f40502ce"
31
+ "gitHead": "1f386374019d83312e9be45819662f594b8bd481"
32
32
  }