@markuplint/rules 4.5.0 → 4.6.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/lib/index.d.ts +19 -18
- package/lib/index.js +2 -0
- package/lib/no-orphaned-end-tag/index.d.ts +2 -0
- package/lib/no-orphaned-end-tag/index.js +16 -0
- package/lib/no-orphaned-end-tag/meta.d.ts +4 -0
- package/lib/no-orphaned-end-tag/meta.js +3 -0
- package/package.json +8 -8
- package/schema.json +3 -0
package/lib/index.d.ts
CHANGED
|
@@ -16,38 +16,38 @@ declare const rules: {
|
|
|
16
16
|
readonly 'id-duplication': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
17
17
|
readonly 'ineffective-attr': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
18
18
|
readonly 'invalid-attr': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
19
|
-
allowAttrs?:
|
|
20
|
-
enum: [string, ...string[]];
|
|
21
|
-
} | {
|
|
22
|
-
pattern: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
25
|
-
}> | (string | {
|
|
19
|
+
allowAttrs?: (string | {
|
|
26
20
|
name: string;
|
|
27
|
-
value:
|
|
21
|
+
value: ({
|
|
28
22
|
enum: [string, ...string[]];
|
|
29
23
|
} | {
|
|
30
24
|
pattern: string;
|
|
31
25
|
} | {
|
|
32
26
|
type: import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
33
|
-
});
|
|
34
|
-
})[] |
|
|
35
|
-
disallowAttrs?: Record<string, {
|
|
27
|
+
}) | import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
28
|
+
})[] | Record<string, {
|
|
36
29
|
enum: [string, ...string[]];
|
|
37
30
|
} | {
|
|
38
31
|
pattern: string;
|
|
39
32
|
} | {
|
|
40
33
|
type: import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
41
|
-
}> |
|
|
34
|
+
}> | undefined;
|
|
35
|
+
disallowAttrs?: (string | {
|
|
42
36
|
name: string;
|
|
43
|
-
value:
|
|
37
|
+
value: ({
|
|
44
38
|
enum: [string, ...string[]];
|
|
45
39
|
} | {
|
|
46
40
|
pattern: string;
|
|
47
41
|
} | {
|
|
48
42
|
type: import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
49
|
-
});
|
|
50
|
-
})[] |
|
|
43
|
+
}) | import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
44
|
+
})[] | Record<string, {
|
|
45
|
+
enum: [string, ...string[]];
|
|
46
|
+
} | {
|
|
47
|
+
pattern: string;
|
|
48
|
+
} | {
|
|
49
|
+
type: import("packages/@markuplint/ml-spec/lib/index.js").AttributeType;
|
|
50
|
+
}> | undefined;
|
|
51
51
|
ignoreAttrNamePrefix?: string | string[] | undefined;
|
|
52
52
|
allowToAddPropertiesForPretender?: boolean | undefined;
|
|
53
53
|
attrs?: Record<string, ({
|
|
@@ -75,6 +75,7 @@ declare const rules: {
|
|
|
75
75
|
ignoreIfAriaBusy?: boolean | undefined;
|
|
76
76
|
}>>;
|
|
77
77
|
readonly 'no-hard-code-id': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
78
|
+
readonly 'no-orphaned-end-tag': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, null>>;
|
|
78
79
|
readonly 'no-refer-to-non-existent-id': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, {
|
|
79
80
|
ariaVersion: "1.1" | "1.2" | "1.3";
|
|
80
81
|
fragmentRefersNameAttr: boolean;
|
|
@@ -82,13 +83,13 @@ declare const rules: {
|
|
|
82
83
|
readonly 'no-use-event-handler-attr': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
83
84
|
ignore?: string | string[] | undefined;
|
|
84
85
|
}>>;
|
|
85
|
-
readonly 'permitted-contents': Readonly<import("@markuplint/ml-core").RuleSeed<import("
|
|
86
|
+
readonly 'permitted-contents': Readonly<import("@markuplint/ml-core").RuleSeed<import("./permitted-contents/types.js").TagRule[], import("./permitted-contents/types.js").Options>>;
|
|
86
87
|
readonly 'placeholder-label-option': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
|
|
87
88
|
readonly 'require-accessible-name': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
88
89
|
ariaVersion: "1.1" | "1.2" | "1.3";
|
|
89
90
|
}>>;
|
|
90
91
|
readonly 'require-datetime': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
91
|
-
langs?: import("
|
|
92
|
+
langs?: import("./require-datetime/types.js").Lang[] | undefined;
|
|
92
93
|
}>>;
|
|
93
94
|
readonly 'required-attr': Readonly<import("@markuplint/ml-core").RuleSeed<string | (string | {
|
|
94
95
|
name: string;
|
|
@@ -105,6 +106,6 @@ declare const rules: {
|
|
|
105
106
|
prevComment?: boolean | undefined;
|
|
106
107
|
prevCodeBlock?: boolean | undefined;
|
|
107
108
|
}>>;
|
|
108
|
-
readonly 'wai-aria': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, import("
|
|
109
|
+
readonly 'wai-aria': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, import("./wai-aria/types.js").Options>>;
|
|
109
110
|
};
|
|
110
111
|
export default rules;
|
package/lib/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import NoDefaultValue from './no-default-value/index.js';
|
|
|
22
22
|
import NoDuplicateDt from './no-duplicate-dt/index.js';
|
|
23
23
|
import NoEmptyPalpableContent from './no-empty-palpable-content/index.js';
|
|
24
24
|
import NoHardCodeId from './no-hard-code-id/index.js';
|
|
25
|
+
import NoOrphanedEndTag from './no-orphaned-end-tag/index.js';
|
|
25
26
|
import NoReferToNonExistentId from './no-refer-to-non-existent-id/index.js';
|
|
26
27
|
import NoUseEventHandlerAttr from './no-use-event-handler-attr/index.js';
|
|
27
28
|
import PermittedContents from './permitted-contents/index.js';
|
|
@@ -58,6 +59,7 @@ const rules = {
|
|
|
58
59
|
'no-duplicate-dt': NoDuplicateDt,
|
|
59
60
|
'no-empty-palpable-content': NoEmptyPalpableContent,
|
|
60
61
|
'no-hard-code-id': NoHardCodeId,
|
|
62
|
+
'no-orphaned-end-tag': NoOrphanedEndTag,
|
|
61
63
|
'no-refer-to-non-existent-id': NoReferToNonExistentId,
|
|
62
64
|
'no-use-event-handler-attr': NoUseEventHandlerAttr,
|
|
63
65
|
'permitted-contents': PermittedContents,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRule } from '@markuplint/ml-core';
|
|
2
|
+
import meta from './meta.js';
|
|
3
|
+
export default createRule({
|
|
4
|
+
meta,
|
|
5
|
+
async verify({ document, report, t }) {
|
|
6
|
+
await document.walkOn('Text', text => {
|
|
7
|
+
const raw = text.raw.trim();
|
|
8
|
+
if (/^<\//.test(raw)) {
|
|
9
|
+
report({
|
|
10
|
+
scope: text,
|
|
11
|
+
message: t('{0} detected', t('Orphaned end tag')),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/rules",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.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.
|
|
29
|
-
"@markuplint/ml-core": "4.
|
|
30
|
-
"@markuplint/ml-spec": "4.
|
|
31
|
-
"@markuplint/selector": "4.
|
|
28
|
+
"@markuplint/html-spec": "4.6.0",
|
|
29
|
+
"@markuplint/ml-core": "4.6.0",
|
|
30
|
+
"@markuplint/ml-spec": "4.4.0",
|
|
31
|
+
"@markuplint/selector": "4.5.0",
|
|
32
32
|
"@markuplint/shared": "4.2.0",
|
|
33
|
-
"@markuplint/types": "4.
|
|
33
|
+
"@markuplint/types": "4.3.0",
|
|
34
34
|
"@types/debug": "4.1.12",
|
|
35
35
|
"@ungap/structured-clone": "1.2.0",
|
|
36
36
|
"ansi-colors": "4.1.3",
|
|
37
37
|
"chrono-node": "2.7.5",
|
|
38
38
|
"debug": "4.3.4",
|
|
39
|
-
"type-fest": "4.
|
|
39
|
+
"type-fest": "4.15.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "d5c8786b0dbbd82cdd89018dd57941d62bbe8d06"
|
|
42
42
|
}
|
package/schema.json
CHANGED
|
@@ -78,6 +78,9 @@
|
|
|
78
78
|
"no-hard-code-id": {
|
|
79
79
|
"$ref": "https://raw.githubusercontent.com/markuplint/markuplint/main/packages/%40markuplint/rules/src/no-hard-code-id/schema.json"
|
|
80
80
|
},
|
|
81
|
+
"no-orphaned-end-tag": {
|
|
82
|
+
"$ref": "https://raw.githubusercontent.com/markuplint/markuplint/main/packages/%40markuplint/rules/src/no-orphaned-end-tag/schema.json"
|
|
83
|
+
},
|
|
81
84
|
"no-refer-to-non-existent-id": {
|
|
82
85
|
"$ref": "https://raw.githubusercontent.com/markuplint/markuplint/main/packages/%40markuplint/rules/src/no-refer-to-non-existent-id/schema.json"
|
|
83
86
|
},
|