@markuplint/rules 3.14.0 → 3.15.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/attr-check.d.ts +19 -8
- package/lib/attr-duplication/index.d.ts +3 -1
- package/lib/attr-value-quotes/index.d.ts +2 -2
- package/lib/case-sensitive-attr-name/index.d.ts +1 -1
- package/lib/case-sensitive-tag-name/index.d.ts +1 -1
- package/lib/character-reference/index.d.ts +1 -1
- package/lib/class-naming/index.d.ts +1 -1
- package/lib/create-message.d.ts +12 -2
- package/lib/deprecated-attr/index.d.ts +3 -1
- package/lib/deprecated-element/index.d.ts +3 -1
- package/lib/disallowed-element/index.d.ts +1 -1
- package/lib/doctype/index.d.ts +2 -2
- package/lib/end-tag/index.d.ts +1 -1
- package/lib/helpers.d.ts +34 -16
- package/lib/id-duplication/index.d.ts +3 -1
- package/lib/index.d.ts +2 -2
- package/lib/ineffective-attr/index.d.ts +3 -1
- package/lib/invalid-attr/index.d.ts +38 -31
- package/lib/label-has-control/index.d.ts +3 -1
- package/lib/landmark-roles/index.d.ts +3 -3
- package/lib/no-boolean-attr-value/index.d.ts +3 -1
- package/lib/no-default-value/index.d.ts +3 -1
- package/lib/no-empty-palpable-content/index.d.ts +3 -3
- package/lib/no-hard-code-id/index.d.ts +3 -1
- package/lib/no-refer-to-non-existent-id/index.d.ts +1 -1
- package/lib/no-use-event-handler-attr/index.d.ts +2 -2
- package/lib/permitted-contents/choice.d.ts +7 -1
- package/lib/permitted-contents/complex-branch.d.ts +7 -1
- package/lib/permitted-contents/count-pattern.d.ts +17 -2
- package/lib/permitted-contents/debug.browser.d.ts +15 -15
- package/lib/permitted-contents/debug.d.ts +1 -1
- package/lib/permitted-contents/index.d.ts +1 -1
- package/lib/permitted-contents/matches-selector.d.ts +6 -1
- package/lib/permitted-contents/order.d.ts +7 -1
- package/lib/permitted-contents/recursive-branch.d.ts +7 -1
- package/lib/permitted-contents/represent-transparent-nodes.d.ts +7 -3
- package/lib/permitted-contents/start.d.ts +6 -1
- package/lib/permitted-contents/types.d.ts +29 -29
- package/lib/permitted-contents/utils.d.ts +78 -41
- package/lib/placeholder-label-option/index.d.ts +1 -1
- package/lib/require-accessible-name/index.d.ts +2 -2
- package/lib/require-datetime/index.d.ts +2 -2
- package/lib/require-datetime/types.d.ts +2 -2
- package/lib/required-attr/index.d.ts +3 -3
- package/lib/required-element/index.d.ts +2 -2
- package/lib/required-h1/index.d.ts +3 -3
- package/lib/use-list/index.d.ts +2 -2
- package/lib/use-list/index.js +26 -26
- package/lib/wai-aria/checkings/default-value.d.ts +7 -3
- package/lib/wai-aria/checkings/deprecated-props.d.ts +8 -4
- package/lib/wai-aria/checkings/disallowed-prop.d.ts +8 -4
- package/lib/wai-aria/checkings/implicit-props.d.ts +8 -4
- package/lib/wai-aria/checkings/no-global-prop.d.ts +7 -3
- package/lib/wai-aria/checkings/required-owned-elements.d.ts +7 -3
- package/lib/wai-aria/checkings/required-prop.d.ts +12 -6
- package/lib/wai-aria/checkings/value.d.ts +15 -6
- package/lib/wai-aria/index.d.ts +1 -1
- package/lib/wai-aria/types.d.ts +10 -10
- package/package.json +10 -10
package/lib/attr-check.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import type { Translator } from '@markuplint/i18n';
|
|
|
2
2
|
import type { Attribute as AttrSpec, AttributeType } from '@markuplint/ml-spec';
|
|
3
3
|
import type { ReadonlyDeep } from 'type-fest';
|
|
4
4
|
type Invalid = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
|
|
6
|
+
message: string;
|
|
7
|
+
loc?: Loc;
|
|
8
8
|
};
|
|
9
9
|
type Loc = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
raw: string;
|
|
11
|
+
line: number;
|
|
12
|
+
col: number;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Use in rules `invalid-attr` and `wai-aria`
|
|
@@ -19,6 +19,17 @@ type Loc = {
|
|
|
19
19
|
* @param isCustomRule
|
|
20
20
|
* @param spec
|
|
21
21
|
*/
|
|
22
|
-
export declare function attrCheck(
|
|
23
|
-
|
|
22
|
+
export declare function attrCheck(
|
|
23
|
+
t: Translator,
|
|
24
|
+
name: string,
|
|
25
|
+
value: string,
|
|
26
|
+
isCustomRule: boolean,
|
|
27
|
+
spec?: AttrSpec,
|
|
28
|
+
): Invalid | false;
|
|
29
|
+
export declare function valueCheck(
|
|
30
|
+
t: Translator,
|
|
31
|
+
name: string,
|
|
32
|
+
value: string,
|
|
33
|
+
type: ReadonlyDeep<AttributeType>,
|
|
34
|
+
): [string, Loc] | false;
|
|
24
35
|
export {};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type Type = 'double' | 'single';
|
|
2
2
|
export type Quote = '"' | "'";
|
|
3
3
|
export type QuoteMap = {
|
|
4
|
-
|
|
4
|
+
[P in Type]: Quote;
|
|
5
5
|
};
|
|
6
|
-
declare const _default: Readonly<import(
|
|
6
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<Type, undefined>>;
|
|
7
7
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RuleConfigValue } from '@markuplint/ml-config';
|
|
2
|
-
declare const _default: Readonly<import(
|
|
2
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<RuleConfigValue, undefined>>;
|
|
3
3
|
export default _default;
|
package/lib/create-message.d.ts
CHANGED
|
@@ -2,5 +2,15 @@ import type { Translator } from '@markuplint/i18n';
|
|
|
2
2
|
import type { AttributeType } from '@markuplint/ml-spec';
|
|
3
3
|
import type { UnmatchedResult } from '@markuplint/types';
|
|
4
4
|
import type { ReadonlyDeep } from 'type-fest';
|
|
5
|
-
export declare function createMessageValueExpected(
|
|
6
|
-
|
|
5
|
+
export declare function createMessageValueExpected(
|
|
6
|
+
t: Translator,
|
|
7
|
+
baseTarget: string,
|
|
8
|
+
type: ReadonlyDeep<AttributeType>,
|
|
9
|
+
matches: UnmatchedResult,
|
|
10
|
+
): string;
|
|
11
|
+
export declare function __createMessageValueExpected(
|
|
12
|
+
t: Translator,
|
|
13
|
+
baseTarget: string,
|
|
14
|
+
expected: string | null,
|
|
15
|
+
matches: Pick<UnmatchedResult, 'partName' | 'reason' | 'raw' | 'candidate' | 'ref' | 'extra' | 'fallbackTo'>,
|
|
16
|
+
): string;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: Readonly<import(
|
|
1
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<string[], undefined>>;
|
|
2
2
|
export default _default;
|
package/lib/doctype/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Option = {
|
|
2
|
-
|
|
2
|
+
denyObsoleteType: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare const _default: Readonly<import(
|
|
4
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<'always', Option>>;
|
|
5
5
|
export default _default;
|
package/lib/end-tag/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: Readonly<import(
|
|
1
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, undefined>>;
|
|
2
2
|
export default _default;
|
package/lib/helpers.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ import type { PlainData } from '@markuplint/ml-config';
|
|
|
4
4
|
import type { Element, RuleConfigValue, Document } from '@markuplint/ml-core';
|
|
5
5
|
import type { Attribute } from '@markuplint/ml-spec';
|
|
6
6
|
import type { WritableDeep } from 'type-fest';
|
|
7
|
-
export declare function attrMatches<T extends RuleConfigValue, O extends PlainData>(
|
|
7
|
+
export declare function attrMatches<T extends RuleConfigValue, O extends PlainData>(
|
|
8
|
+
node: Element<T, O>,
|
|
9
|
+
condition: Attribute['condition'],
|
|
10
|
+
): boolean;
|
|
8
11
|
export declare function match(needle: string, pattern: string): boolean;
|
|
9
12
|
/**
|
|
10
13
|
* PotentialCustomElementName
|
|
@@ -22,23 +25,38 @@ export declare function match(needle: string, pattern: string): boolean;
|
|
|
22
25
|
* Originally, it is not possible to define a name including ASCII upper alphas in the custom element, but it is not treated as illegal by the HTML parser.
|
|
23
26
|
*/
|
|
24
27
|
export declare const rePCENChar: string;
|
|
25
|
-
export declare function isValidAttr(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
export declare function isValidAttr(
|
|
29
|
+
t: Translator,
|
|
30
|
+
name: string,
|
|
31
|
+
value: string,
|
|
32
|
+
isDynamicValue: boolean,
|
|
33
|
+
node: Element<any, any>,
|
|
34
|
+
attrSpecs: readonly Attribute[],
|
|
35
|
+
log?: Log,
|
|
36
|
+
):
|
|
37
|
+
| false
|
|
38
|
+
| {
|
|
39
|
+
invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
|
|
40
|
+
message: string;
|
|
41
|
+
loc?:
|
|
42
|
+
| {
|
|
43
|
+
raw: string;
|
|
44
|
+
line: number;
|
|
45
|
+
col: number;
|
|
46
|
+
}
|
|
47
|
+
| undefined;
|
|
48
|
+
};
|
|
34
49
|
export declare function toNormalizedValue(value: string, spec: Attribute): string;
|
|
35
50
|
export declare function accnameMayBeMutable(el: Element<any, any>, document: Document<any, any>): boolean;
|
|
36
|
-
export declare function getOwnedLabel<V extends RuleConfigValue, O extends PlainData>(
|
|
51
|
+
export declare function getOwnedLabel<V extends RuleConfigValue, O extends PlainData>(
|
|
52
|
+
el: Element<V, O>,
|
|
53
|
+
document: Document<V, O>,
|
|
54
|
+
): Element<V, O> | null;
|
|
37
55
|
export declare class Collection<T> {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
#private;
|
|
57
|
+
constructor(...items: readonly (T | null | undefined)[]);
|
|
58
|
+
[Symbol.iterator](): Iterator<T>;
|
|
59
|
+
add(...items: readonly (T | null | undefined)[]): void;
|
|
60
|
+
toArray(): readonly T[];
|
|
43
61
|
}
|
|
44
62
|
export declare function deepCopy<T>(value: T): WritableDeep<T>;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ declare const rules: {
|
|
|
72
72
|
}>>;
|
|
73
73
|
readonly 'no-hard-code-id': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, undefined>>;
|
|
74
74
|
readonly 'no-refer-to-non-existent-id': Readonly<import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, {
|
|
75
|
-
ariaVersion: "1.
|
|
75
|
+
ariaVersion: "1.3" | "1.2" | "1.1";
|
|
76
76
|
fragmentRefersNameAttr: boolean;
|
|
77
77
|
}>>;
|
|
78
78
|
readonly 'no-use-event-handler-attr': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
@@ -81,7 +81,7 @@ declare const rules: {
|
|
|
81
81
|
readonly 'permitted-contents': Readonly<import("@markuplint/ml-core").RuleSeed<import("./permitted-contents/types").TagRule[], import("./permitted-contents/types").Options>>;
|
|
82
82
|
readonly 'placeholder-label-option': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, undefined>>;
|
|
83
83
|
readonly 'require-accessible-name': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
84
|
-
ariaVersion: "1.
|
|
84
|
+
ariaVersion: "1.3" | "1.2" | "1.1";
|
|
85
85
|
}>>;
|
|
86
86
|
readonly 'require-datetime': Readonly<import("@markuplint/ml-core").RuleSeed<boolean, {
|
|
87
87
|
langs?: import("./require-datetime/types").Lang[] | undefined;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,37 +1,44 @@
|
|
|
1
1
|
import type { AttributeType } from '@markuplint/ml-spec';
|
|
2
2
|
type Option = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @since 3.7.0
|
|
5
|
+
*/
|
|
6
|
+
allowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
|
|
7
|
+
/**
|
|
8
|
+
* @since 3.7.0
|
|
9
|
+
*/
|
|
10
|
+
disallowAttrs?: (string | Attr)[] | Record<string, ValueRule>;
|
|
11
|
+
ignoreAttrNamePrefix?: string | string[];
|
|
12
|
+
allowToAddPropertiesForPretender?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Since version 3.7.0. Use `allowAttrs` or `disallowAttrs` instead.
|
|
15
|
+
* This option (`attr`) is now considered ambiguous and may lead to confusion.
|
|
16
|
+
* Please use the more explicit `allowAttrs` or `disallowAttrs` option
|
|
17
|
+
* to specify allowed attributes for the `invalid-attr` rule.
|
|
18
|
+
* @see {@link Option.allowAttrs}
|
|
19
|
+
* @see {@link Option.disallowAttrs}
|
|
20
|
+
*/
|
|
21
|
+
attrs?: Record<
|
|
22
|
+
string,
|
|
23
|
+
| ValueRule
|
|
24
|
+
| {
|
|
25
|
+
disallowed: true;
|
|
26
|
+
}
|
|
27
|
+
>;
|
|
24
28
|
};
|
|
25
29
|
type Attr = {
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
name: string;
|
|
31
|
+
value: AttributeType | ValueRule;
|
|
28
32
|
};
|
|
29
|
-
type ValueRule =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
33
|
+
type ValueRule =
|
|
34
|
+
| {
|
|
35
|
+
enum: [string, ...string[]];
|
|
36
|
+
}
|
|
37
|
+
| {
|
|
38
|
+
pattern: string;
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
type: AttributeType;
|
|
42
|
+
};
|
|
43
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Option>>;
|
|
37
44
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ignoreRoles: Roles[];
|
|
3
|
+
labelEachArea: boolean;
|
|
4
4
|
};
|
|
5
5
|
type TopLevelRoles = 'banner' | 'main' | 'complementary' | 'contentinfo';
|
|
6
6
|
type Roles = TopLevelRoles | 'form' | 'navigation' | 'region';
|
|
7
|
-
declare const _default: Readonly<import(
|
|
7
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
|
|
8
8
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
extendsExposableElements?: boolean;
|
|
3
|
+
ignoreIfAriaBusy?: boolean;
|
|
4
4
|
};
|
|
5
|
-
declare const _default: Readonly<import(
|
|
5
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
|
|
6
6
|
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: Readonly<
|
|
1
|
+
declare const _default: Readonly<
|
|
2
|
+
import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, undefined>
|
|
3
|
+
>;
|
|
2
4
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
2
|
+
ignore?: string | string[];
|
|
3
3
|
};
|
|
4
|
-
declare const _default: Readonly<import(
|
|
4
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { ChildNode, Options, Result, Specs } from './types';
|
|
2
2
|
import type { PermittedContentChoice } from '@markuplint/ml-spec';
|
|
3
3
|
import type { ReadonlyDeep } from 'type-fest';
|
|
4
|
-
export declare function choice(
|
|
4
|
+
export declare function choice(
|
|
5
|
+
pattern: ReadonlyDeep<PermittedContentChoice>,
|
|
6
|
+
elements: readonly ChildNode[],
|
|
7
|
+
specs: Specs,
|
|
8
|
+
options: Options,
|
|
9
|
+
depth: number,
|
|
10
|
+
): Result;
|
|
@@ -11,4 +11,10 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
11
11
|
* @param depth
|
|
12
12
|
* @returns
|
|
13
13
|
*/
|
|
14
|
-
export declare function complexBranch(
|
|
14
|
+
export declare function complexBranch(
|
|
15
|
+
pattern: ReadonlyDeep<PermittedContentPattern>,
|
|
16
|
+
elements: readonly ChildNode[],
|
|
17
|
+
specs: Specs,
|
|
18
|
+
options: Options,
|
|
19
|
+
depth: number,
|
|
20
|
+
): Result;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ChildNode, Options, Result, Specs } from './types';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
PermittedContentOneOrMore,
|
|
4
|
+
PermittedContentOptional,
|
|
5
|
+
PermittedContentRequire,
|
|
6
|
+
PermittedContentZeroOrMore,
|
|
7
|
+
} from '@markuplint/ml-spec';
|
|
3
8
|
import type { ReadonlyDeep } from 'type-fest';
|
|
4
9
|
/**
|
|
5
10
|
* Check count
|
|
@@ -11,4 +16,14 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
11
16
|
* @param depth
|
|
12
17
|
* @returns
|
|
13
18
|
*/
|
|
14
|
-
export declare function countPattern(
|
|
19
|
+
export declare function countPattern(
|
|
20
|
+
pattern:
|
|
21
|
+
| ReadonlyDeep<PermittedContentOneOrMore>
|
|
22
|
+
| ReadonlyDeep<PermittedContentOptional>
|
|
23
|
+
| ReadonlyDeep<PermittedContentRequire>
|
|
24
|
+
| ReadonlyDeep<PermittedContentZeroOrMore>,
|
|
25
|
+
elements: readonly ChildNode[],
|
|
26
|
+
specs: Specs,
|
|
27
|
+
options: Options,
|
|
28
|
+
depth: number,
|
|
29
|
+
): Result;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/// <reference types="debug" />
|
|
2
|
-
export declare const cmLog: import(
|
|
2
|
+
export declare const cmLog: import('debug').Debugger;
|
|
3
3
|
export declare const bgGreen: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
(): void;
|
|
5
|
+
bold(): void;
|
|
6
6
|
};
|
|
7
7
|
export declare const green: {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
(): void;
|
|
9
|
+
bold(): void;
|
|
10
10
|
};
|
|
11
11
|
export declare const bgRed: {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
(): void;
|
|
13
|
+
bold(): void;
|
|
14
14
|
};
|
|
15
15
|
export declare const bgBlue: {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
(): void;
|
|
17
|
+
bold(): void;
|
|
18
18
|
};
|
|
19
19
|
export declare const blue: {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
(): void;
|
|
21
|
+
bold(): void;
|
|
22
22
|
};
|
|
23
23
|
export declare const bgMagenta: {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
(): void;
|
|
25
|
+
bold(): void;
|
|
26
26
|
};
|
|
27
27
|
export declare const cyan: {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
(): void;
|
|
29
|
+
bold(): void;
|
|
30
30
|
};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import type { ChildNode, Result, Specs } from './types';
|
|
2
2
|
export type SelectorResult = Result<'UNMATCHED_SELECTOR_BUT_MAY_EMPTY' | 'MISSING_NODE' | 'UNMATCHED_SELECTORS'>;
|
|
3
|
-
export declare function matchesSelector(
|
|
3
|
+
export declare function matchesSelector(
|
|
4
|
+
query: string,
|
|
5
|
+
node: ChildNode | undefined,
|
|
6
|
+
specs: Specs,
|
|
7
|
+
depth: number,
|
|
8
|
+
): SelectorResult;
|
|
@@ -11,4 +11,10 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
11
11
|
* @param depth
|
|
12
12
|
* @returns
|
|
13
13
|
*/
|
|
14
|
-
export declare function order(
|
|
14
|
+
export declare function order(
|
|
15
|
+
contents: ReadonlyDeep<PermittedContentPattern[]>,
|
|
16
|
+
nodes: readonly ChildNode[],
|
|
17
|
+
specs: Specs,
|
|
18
|
+
options: Options,
|
|
19
|
+
depth: number,
|
|
20
|
+
): Result;
|
|
@@ -2,4 +2,10 @@ import type { SelectorResult } from './matches-selector';
|
|
|
2
2
|
import type { ChildNode, Options, Specs } from './types';
|
|
3
3
|
import type { PermittedContentPattern, Model } from '@markuplint/ml-spec';
|
|
4
4
|
import type { ReadonlyDeep } from 'type-fest';
|
|
5
|
-
export declare function recursiveBranch(
|
|
5
|
+
export declare function recursiveBranch(
|
|
6
|
+
model: ReadonlyDeep<Model | PermittedContentPattern[]>,
|
|
7
|
+
nodes: readonly ChildNode[],
|
|
8
|
+
specs: Specs,
|
|
9
|
+
options: Options,
|
|
10
|
+
depth: number,
|
|
11
|
+
): SelectorResult;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ChildNode, Options, Result, Specs } from './types';
|
|
2
2
|
export declare const transparentMode: Map<ChildNode, true>;
|
|
3
|
-
export declare function representTransparentNodes(
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export declare function representTransparentNodes(
|
|
4
|
+
nodes: ChildNode[],
|
|
5
|
+
specs: Specs,
|
|
6
|
+
options: Options,
|
|
7
|
+
): {
|
|
8
|
+
nodes: ChildNode[];
|
|
9
|
+
errors: Result[];
|
|
6
10
|
};
|
|
@@ -10,4 +10,9 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
10
10
|
* @param options
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
|
-
export declare function start(
|
|
13
|
+
export declare function start(
|
|
14
|
+
contents: ReadonlyDeep<ContentModel['contents']>,
|
|
15
|
+
el: Element,
|
|
16
|
+
specs: Specs,
|
|
17
|
+
options: Options,
|
|
18
|
+
): ContentModelResult[];
|
|
@@ -4,49 +4,49 @@ import type { ReadonlyDeep } from 'type-fest';
|
|
|
4
4
|
export type Element = _Element<TagRule[], Options>;
|
|
5
5
|
export type ChildNode = _ChildNode<TagRule[], Options>;
|
|
6
6
|
export type Specs = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
readonly cites: MLMLSpec['cites'];
|
|
8
|
+
readonly def: MLMLSpec['def'];
|
|
9
|
+
readonly specs: readonly {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly contentModel: {
|
|
12
|
+
readonly contents: MLMLSpec['specs'][0]['contentModel']['contents'];
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
15
|
};
|
|
16
16
|
export type ContentModelResult = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
type: MatchedReason | UnmatchedReason;
|
|
18
|
+
scope: ChildNode;
|
|
19
|
+
query: Result['query'];
|
|
20
|
+
hint: Result['hint'];
|
|
21
21
|
};
|
|
22
22
|
export type Result<T extends string = MatchedReason> = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
type: MatchedReason | UnmatchedReason | T;
|
|
24
|
+
matched: ChildNode[];
|
|
25
|
+
unmatched: ChildNode[];
|
|
26
|
+
zeroMatch: boolean;
|
|
27
|
+
query: string;
|
|
28
|
+
hint: Hints;
|
|
29
29
|
};
|
|
30
30
|
export type Hints = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
max?: number;
|
|
32
|
+
not?: ChildNode;
|
|
33
|
+
transparent?: Element;
|
|
34
|
+
missing?: {
|
|
35
|
+
barelyMatchedElements?: number;
|
|
36
|
+
need?: string;
|
|
37
|
+
};
|
|
38
38
|
};
|
|
39
39
|
export type MatchedReason = 'MATCHED' | 'MATCHED_ZERO';
|
|
40
40
|
export type UnmatchedReason = 'NOTHING' | 'UNEXPECTED_EXTRA_NODE' | 'TRANSPARENT_MODEL_DISALLOWS' | MissingNodeReason;
|
|
41
41
|
export type MissingNodeReason = 'MISSING_NODE_REQUIRED' | 'MISSING_NODE_ONE_OR_MORE';
|
|
42
42
|
export type RepeatSign = '' | '?' | '+' | '*' | `{${number},${number}}`;
|
|
43
43
|
export type TransparentModel = {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
el: Element;
|
|
45
|
+
additionalCondition: string;
|
|
46
46
|
};
|
|
47
47
|
export type TagRule = {
|
|
48
|
-
|
|
48
|
+
readonly tag: string;
|
|
49
49
|
} & ReadonlyDeep<ContentModel>;
|
|
50
50
|
export type Options = {
|
|
51
|
-
|
|
51
|
+
readonly ignoreHasMutableChildren: boolean;
|
|
52
52
|
};
|
|
@@ -1,51 +1,88 @@
|
|
|
1
1
|
import type { ChildNode, Element, Hints, MissingNodeReason, RepeatSign, Specs } from './types';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
PermittedContentPattern,
|
|
4
|
+
PermittedContentChoice,
|
|
5
|
+
PermittedContentOneOrMore,
|
|
6
|
+
PermittedContentOptional,
|
|
7
|
+
PermittedContentRequire,
|
|
8
|
+
PermittedContentTransparent,
|
|
9
|
+
PermittedContentZeroOrMore,
|
|
10
|
+
Model,
|
|
11
|
+
} from '@markuplint/ml-spec';
|
|
3
12
|
import type { ReadonlyDeep } from 'type-fest';
|
|
4
13
|
export declare function getChildNodesWithoutWhitespaces(el: Element): ChildNode[];
|
|
5
14
|
export declare function isModel(model: ReadonlyDeep<Model | PermittedContentPattern[]>): model is ReadonlyDeep<Model>;
|
|
6
|
-
export declare function matches(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
export declare function matches(
|
|
16
|
+
selector: string,
|
|
17
|
+
node: ChildNode,
|
|
18
|
+
specs: Specs,
|
|
19
|
+
):
|
|
20
|
+
| {
|
|
21
|
+
matched: boolean;
|
|
22
|
+
not?: undefined;
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
matched: boolean;
|
|
26
|
+
not: ChildNode | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare function isRequire(
|
|
29
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
30
|
+
): content is ReadonlyDeep<PermittedContentRequire>;
|
|
31
|
+
export declare function isOptional(
|
|
32
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
33
|
+
): content is ReadonlyDeep<PermittedContentOptional>;
|
|
34
|
+
export declare function isOneOrMore(
|
|
35
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
36
|
+
): content is ReadonlyDeep<PermittedContentOneOrMore>;
|
|
37
|
+
export declare function isZeroOrMore(
|
|
38
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
39
|
+
): content is ReadonlyDeep<PermittedContentZeroOrMore>;
|
|
40
|
+
export declare function isChoice(
|
|
41
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
42
|
+
): content is ReadonlyDeep<PermittedContentChoice>;
|
|
43
|
+
export declare function isTransparent(
|
|
44
|
+
content: ReadonlyDeep<PermittedContentPattern>,
|
|
45
|
+
): content is ReadonlyDeep<PermittedContentTransparent>;
|
|
46
|
+
export declare function normalizeModel(
|
|
47
|
+
pattern:
|
|
48
|
+
| ReadonlyDeep<PermittedContentRequire>
|
|
49
|
+
| ReadonlyDeep<PermittedContentOptional>
|
|
50
|
+
| ReadonlyDeep<PermittedContentOneOrMore>
|
|
51
|
+
| ReadonlyDeep<PermittedContentZeroOrMore>,
|
|
52
|
+
): {
|
|
53
|
+
model: ReadonlyDeep<PermittedContentPattern[] | Model>;
|
|
54
|
+
min: number;
|
|
55
|
+
max: number;
|
|
56
|
+
repeat: RepeatSign;
|
|
57
|
+
missingType: MissingNodeReason | undefined;
|
|
12
58
|
};
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare function mergeHints(a: Readonly<Hints>, b: Readonly<Hints>): Partial<{
|
|
27
|
-
missing: Partial<{
|
|
28
|
-
barelyMatchedElements?: number | undefined;
|
|
29
|
-
need?: string | undefined;
|
|
30
|
-
}> | undefined;
|
|
31
|
-
max?: number | undefined;
|
|
32
|
-
not?: ChildNode | undefined;
|
|
33
|
-
transparent?: Element | undefined;
|
|
59
|
+
export declare function mergeHints(
|
|
60
|
+
a: Readonly<Hints>,
|
|
61
|
+
b: Readonly<Hints>,
|
|
62
|
+
): Partial<{
|
|
63
|
+
missing:
|
|
64
|
+
| Partial<{
|
|
65
|
+
barelyMatchedElements?: number | undefined;
|
|
66
|
+
need?: string | undefined;
|
|
67
|
+
}>
|
|
68
|
+
| undefined;
|
|
69
|
+
max?: number | undefined;
|
|
70
|
+
not?: ChildNode | undefined;
|
|
71
|
+
transparent?: Element | undefined;
|
|
34
72
|
}>;
|
|
35
73
|
export declare function cleanObject<T extends Object>(object: T): Partial<T>;
|
|
36
74
|
export declare class Collection {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
export declare class UnsupportedError extends Error {
|
|
75
|
+
#private;
|
|
76
|
+
constructor(origin: readonly ChildNode[]);
|
|
77
|
+
get matched(): ChildNode[];
|
|
78
|
+
get matchedCount(): number;
|
|
79
|
+
get nodes(): ChildNode[];
|
|
80
|
+
get unmatched(): ChildNode[];
|
|
81
|
+
addMatched(nodes: ChildNode[]): boolean;
|
|
82
|
+
back(): void;
|
|
83
|
+
lock(): void;
|
|
84
|
+
max(max: number): void;
|
|
85
|
+
toString(highlightExtraNodes?: boolean): string;
|
|
50
86
|
}
|
|
87
|
+
export declare class UnsupportedError extends Error {}
|
|
51
88
|
export declare function modelLog(model: ReadonlyDeep<Model | PermittedContentPattern[]>, repeat: RepeatSign): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: Readonly<import(
|
|
1
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, undefined>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ARIAVersion } from '@markuplint/ml-spec';
|
|
2
2
|
type Option = {
|
|
3
|
-
|
|
3
|
+
ariaVersion: ARIAVersion;
|
|
4
4
|
};
|
|
5
|
-
declare const _default: Readonly<import(
|
|
5
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Option>>;
|
|
6
6
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Lang } from './types';
|
|
2
2
|
type Options = {
|
|
3
|
-
|
|
3
|
+
langs?: Lang[];
|
|
4
4
|
};
|
|
5
|
-
declare const _default: Readonly<import(
|
|
5
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
|
|
6
6
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type DateTimeKey = 'year' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'ms';
|
|
2
2
|
export type DateTimeData = Partial<Record<DateTimeKey, number>>;
|
|
3
3
|
export type DateTime = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
datetime: DateTimeData;
|
|
5
|
+
zone?: number;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @see https://github.com/wanasit/chrono#locales
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type RequiredAttributes = string | (string | Attr)[];
|
|
2
2
|
type Attr = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
value?: string | string[];
|
|
5
5
|
};
|
|
6
|
-
declare const _default: Readonly<import(
|
|
6
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<RequiredAttributes, undefined>>;
|
|
7
7
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
2
|
+
ignoreHasMutableContents: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare const _default: Readonly<import(
|
|
4
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<string[], Options>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface Options {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
'expected-once': boolean;
|
|
3
|
+
'in-document-fragment': boolean;
|
|
4
4
|
}
|
|
5
|
-
declare const _default: Readonly<import(
|
|
5
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<boolean, Options>>;
|
|
6
6
|
export default _default;
|
package/lib/use-list/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Bullets = readonly string[];
|
|
2
2
|
type Options = {
|
|
3
|
-
|
|
3
|
+
spaceNeededBullets?: string[];
|
|
4
4
|
};
|
|
5
|
-
declare const _default: Readonly<import(
|
|
5
|
+
declare const _default: Readonly<import('@markuplint/ml-core').RuleSeed<Bullets, Options>>;
|
|
6
6
|
export default _default;
|
package/lib/use-list/index.js
CHANGED
|
@@ -7,32 +7,32 @@ exports.default = (0, ml_core_1.createRule)({
|
|
|
7
7
|
/**
|
|
8
8
|
* @see https://en.wikipedia.org/wiki/Bullet_(typography)#In_Unicode
|
|
9
9
|
*/
|
|
10
|
-
'\u2022',
|
|
11
|
-
'\u2023',
|
|
12
|
-
'\u2043',
|
|
13
|
-
'\u204C',
|
|
14
|
-
'\u204D',
|
|
15
|
-
'\u2219',
|
|
16
|
-
'\u25CB',
|
|
17
|
-
'\u25CF',
|
|
18
|
-
'\u25D8',
|
|
19
|
-
'\u25E6',
|
|
20
|
-
'\u2619',
|
|
21
|
-
'\u2765',
|
|
22
|
-
'\u2767',
|
|
23
|
-
'\u29BE',
|
|
24
|
-
'\u29BF',
|
|
10
|
+
'\u2022', // • BULLET (HTML • · •, •)
|
|
11
|
+
'\u2023', // ‣ TRIANGULAR BULLET (HTML ‣)
|
|
12
|
+
'\u2043', // ⁃ HYPHEN BULLET (HTML ⁃ · ⁃)
|
|
13
|
+
'\u204C', // ⁌ BLACK LEFTWARDS BULLET (HTML ⁌)
|
|
14
|
+
'\u204D', // ⁍ BLACK RIGHTWARDS BULLET (HTML ⁍)
|
|
15
|
+
'\u2219', // ∙ BULLET OPERATOR (HTML ∙) for use in mathematical notation primarily as a dot product instead of interupt.
|
|
16
|
+
'\u25CB', // ○ WHITE CIRCLE (HTML ○ · ○)
|
|
17
|
+
'\u25CF', // ● BLACK CIRCLE (HTML ●)
|
|
18
|
+
'\u25D8', // ◘ INVERSE BULLET (HTML ◘)
|
|
19
|
+
'\u25E6', // ◦ WHITE BULLET (HTML ◦)
|
|
20
|
+
'\u2619', // ☙ REVERSED ROTATED FLORAL HEART BULLET (HTML ☙); see Fleuron (typography)
|
|
21
|
+
'\u2765', // ❥ ROTATED HEAVY BLACK HEART BULLET (HTML ❥)
|
|
22
|
+
'\u2767', // ❧ ROTATED FLORAL HEART BULLET (HTML ❧); see Fleuron (typography)
|
|
23
|
+
'\u29BE', // ⦾ CIRCLED WHITE BULLET (HTML ⦾ · ⦾)
|
|
24
|
+
'\u29BF', // ⦿ CIRCLED BULLET (HTML ⦿ · ⦿)
|
|
25
25
|
/**
|
|
26
26
|
* In Japanese
|
|
27
27
|
* @see https://ja.wikipedia.org/wiki/中黒#符号位置
|
|
28
28
|
*/
|
|
29
|
-
'\u00B7',
|
|
30
|
-
'\u0387',
|
|
31
|
-
'\u2022',
|
|
32
|
-
'\u2219',
|
|
33
|
-
'\u22C5',
|
|
34
|
-
'\u30FB',
|
|
35
|
-
'\uFF65',
|
|
29
|
+
'\u00B7', // MIDDLE DOT
|
|
30
|
+
'\u0387', // GREEK ANO TELIA
|
|
31
|
+
'\u2022', // BULLET
|
|
32
|
+
'\u2219', // BULLET OPERATOR
|
|
33
|
+
'\u22C5', // DOT OPERATOR
|
|
34
|
+
'\u30FB', // KATAKANA MIDDLE DOT
|
|
35
|
+
'\uFF65', // HALFWIDTH KATAKANA MIDDLE DOT
|
|
36
36
|
/**
|
|
37
37
|
* In Other Languages
|
|
38
38
|
*/
|
|
@@ -40,8 +40,8 @@ exports.default = (0, ml_core_1.createRule)({
|
|
|
40
40
|
/**
|
|
41
41
|
* From Markdown
|
|
42
42
|
*/
|
|
43
|
-
'-',
|
|
44
|
-
'*',
|
|
43
|
+
'-', // dashes
|
|
44
|
+
'*', // asterisks
|
|
45
45
|
'+', // plus signs
|
|
46
46
|
],
|
|
47
47
|
defaultOptions: {
|
|
@@ -49,8 +49,8 @@ exports.default = (0, ml_core_1.createRule)({
|
|
|
49
49
|
/**
|
|
50
50
|
* From Markdown
|
|
51
51
|
*/
|
|
52
|
-
'-',
|
|
53
|
-
'*',
|
|
52
|
+
'-', // dashes
|
|
53
|
+
'*', // asterisks
|
|
54
54
|
'+', // plus signs
|
|
55
55
|
],
|
|
56
56
|
},
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingDefaultValue: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const checkingDefaultValue: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
propSpecs: readonly ARIAProperty[];
|
|
9
|
+
}
|
|
10
|
+
>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingDeprecatedProps: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const checkingDeprecatedProps: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role: ARIARole | null;
|
|
9
|
+
propSpecs: readonly ARIAProperty[];
|
|
10
|
+
}
|
|
11
|
+
>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingDisallowedProp: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const checkingDisallowedProp: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role: ARIARole | null;
|
|
9
|
+
propSpecs: readonly ARIAProperty[];
|
|
10
|
+
}
|
|
11
|
+
>;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, Attribute } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingImplicitProps: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const checkingImplicitProps: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
propSpecs: readonly ARIAProperty[];
|
|
9
|
+
attrSpecs: readonly Attribute[] | null;
|
|
10
|
+
}
|
|
11
|
+
>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingNoGlobalProp: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const checkingNoGlobalProp: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
propSpecs: readonly ARIAProperty[];
|
|
9
|
+
}
|
|
10
|
+
>;
|
|
@@ -6,6 +6,10 @@ import type { ARIARole } from '@markuplint/ml-spec';
|
|
|
6
6
|
*
|
|
7
7
|
* @see https://w3c.github.io/aria/#mustContain
|
|
8
8
|
*/
|
|
9
|
-
export declare const checkingRequiredOwnedElements: ElementChecker<
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export declare const checkingRequiredOwnedElements: ElementChecker<
|
|
10
|
+
boolean,
|
|
11
|
+
Options,
|
|
12
|
+
{
|
|
13
|
+
role?: ARIARole | null;
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { ElementChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
export declare const checkingRequiredProp: ElementChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role?:
|
|
9
|
+
| (ARIARole & {
|
|
10
|
+
isImplicit?: boolean;
|
|
11
|
+
})
|
|
12
|
+
| null;
|
|
13
|
+
propSpecs: readonly ARIAProperty[];
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import type { Options } from '../types';
|
|
2
2
|
import type { AttrChecker } from '@markuplint/ml-core';
|
|
3
3
|
import type { ARIAProperty, ARIARole } from '@markuplint/ml-spec';
|
|
4
|
-
export declare const checkingValue: AttrChecker<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export declare const checkingValue: AttrChecker<
|
|
5
|
+
boolean,
|
|
6
|
+
Options,
|
|
7
|
+
{
|
|
8
|
+
role?: ARIARole | null;
|
|
9
|
+
propSpecs: readonly ARIAProperty[];
|
|
10
|
+
booleanish?: boolean;
|
|
11
|
+
}
|
|
12
|
+
>;
|
|
9
13
|
/**
|
|
10
14
|
*
|
|
11
15
|
* @see https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value
|
|
12
16
|
*/
|
|
13
|
-
export declare function checkAriaValue(
|
|
17
|
+
export declare function checkAriaValue(
|
|
18
|
+
type: string,
|
|
19
|
+
value: string,
|
|
20
|
+
tokenEnum: readonly string[],
|
|
21
|
+
booleanish?: boolean,
|
|
22
|
+
): boolean;
|
package/lib/wai-aria/index.d.ts
CHANGED
package/lib/wai-aria/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ARIAVersion } from '@markuplint/ml-spec';
|
|
2
2
|
export type Options = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
checkingValue: boolean;
|
|
4
|
+
checkingDeprecatedProps: boolean;
|
|
5
|
+
permittedAriaRoles: boolean;
|
|
6
|
+
checkingRequiredOwnedElements: boolean;
|
|
7
|
+
checkingPresentationalChildren: boolean;
|
|
8
|
+
checkingInteractionInHidden: boolean;
|
|
9
|
+
disallowSetImplicitRole: boolean;
|
|
10
|
+
disallowSetImplicitProps: boolean;
|
|
11
|
+
disallowDefaultValue: boolean;
|
|
12
|
+
version: ARIAVersion;
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/rules",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.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>",
|
|
@@ -20,19 +20,19 @@
|
|
|
20
20
|
"./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@markuplint/html-spec": "3.
|
|
24
|
-
"@markuplint/ml-core": "3.
|
|
25
|
-
"@markuplint/ml-spec": "3.
|
|
26
|
-
"@markuplint/selector": "3.
|
|
23
|
+
"@markuplint/html-spec": "3.14.0",
|
|
24
|
+
"@markuplint/ml-core": "3.15.0",
|
|
25
|
+
"@markuplint/ml-spec": "3.14.0",
|
|
26
|
+
"@markuplint/selector": "3.14.0",
|
|
27
27
|
"@markuplint/shared": "3.8.0",
|
|
28
|
-
"@markuplint/types": "3.
|
|
29
|
-
"@types/debug": "^4.1.
|
|
28
|
+
"@markuplint/types": "3.12.0",
|
|
29
|
+
"@types/debug": "^4.1.12",
|
|
30
30
|
"@ungap/structured-clone": "^1.2.0",
|
|
31
31
|
"ansi-colors": "^4.1.3",
|
|
32
|
-
"chrono-node": "^2.7.
|
|
32
|
+
"chrono-node": "^2.7.3",
|
|
33
33
|
"debug": "^4.3.4",
|
|
34
34
|
"tslib": "^2.6.2",
|
|
35
|
-
"type-fest": "^4.
|
|
35
|
+
"type-fest": "^4.8.2"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b37b749d7ac0f9e6cbd022ee7031bc020c6677d3"
|
|
38
38
|
}
|