@markuplint/rules 3.2.0 → 3.3.1
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 +1 -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 +1 -1
- package/lib/deprecated-element/index.d.ts +1 -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 +35 -17
- package/lib/id-duplication/index.d.ts +1 -1
- package/lib/ineffective-attr/index.d.ts +1 -1
- package/lib/invalid-attr/index.d.ts +17 -13
- package/lib/label-has-control/index.d.ts +1 -1
- package/lib/landmark-roles/index.d.ts +3 -3
- package/lib/no-boolean-attr-value/index.d.ts +1 -1
- package/lib/no-default-value/index.d.ts +1 -1
- package/lib/no-empty-palpable-content/index.d.ts +3 -3
- package/lib/no-hard-code-id/index.d.ts +1 -1
- package/lib/no-refer-to-non-existent-id/index.d.ts +7 -4
- 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 +7 -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 +72 -35
- 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/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 +9 -5
- package/lib/wai-aria/index.d.ts +1 -1
- package/lib/wai-aria/types.d.ts +10 -10
- package/package.json +8 -6
- package/lib/__foo/index.d.ts +0 -2
- package/lib/__foo/index.js +0 -32
package/lib/attr-check.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Translator } from '@markuplint/i18n';
|
|
2
2
|
import type { Attribute as AttrSpec, AttributeType } from '@markuplint/ml-spec';
|
|
3
3
|
type Invalid = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
|
|
5
|
+
message: string;
|
|
6
|
+
loc?: Loc;
|
|
7
7
|
};
|
|
8
8
|
type Loc = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
raw: string;
|
|
10
|
+
line: number;
|
|
11
|
+
col: number;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Use in rules `invalid-attr` and `wai-aria`
|
|
@@ -18,6 +18,17 @@ type Loc = {
|
|
|
18
18
|
* @param isCustomRule
|
|
19
19
|
* @param spec
|
|
20
20
|
*/
|
|
21
|
-
export declare function attrCheck(
|
|
22
|
-
|
|
21
|
+
export declare function attrCheck(
|
|
22
|
+
t: Translator,
|
|
23
|
+
name: string,
|
|
24
|
+
value: string,
|
|
25
|
+
isCustomRule: boolean,
|
|
26
|
+
spec?: AttrSpec,
|
|
27
|
+
): Invalid | false;
|
|
28
|
+
export declare function valueCheck(
|
|
29
|
+
t: Translator,
|
|
30
|
+
name: string,
|
|
31
|
+
value: string,
|
|
32
|
+
type: AttributeType,
|
|
33
|
+
): string | [string, Loc] | false;
|
|
23
34
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
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: import(
|
|
6
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<Type, null>;
|
|
7
7
|
export default _default;
|
package/lib/create-message.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { Translator } from '@markuplint/i18n';
|
|
2
2
|
import type { AttributeType } from '@markuplint/ml-spec';
|
|
3
3
|
import type { UnmatchedResult } from '@markuplint/types';
|
|
4
|
-
export declare function createMessageValueExpected(
|
|
5
|
-
|
|
4
|
+
export declare function createMessageValueExpected(
|
|
5
|
+
t: Translator,
|
|
6
|
+
baseTarget: string,
|
|
7
|
+
type: AttributeType,
|
|
8
|
+
matches: UnmatchedResult,
|
|
9
|
+
): string;
|
|
10
|
+
export declare function __createMessageValueExpected(
|
|
11
|
+
t: Translator,
|
|
12
|
+
baseTarget: string,
|
|
13
|
+
expected: string | null,
|
|
14
|
+
matches: Pick<UnmatchedResult, 'partName' | 'reason' | 'raw' | 'candidate' | 'ref' | 'extra'>,
|
|
15
|
+
): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<string[], null>;
|
|
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: import(
|
|
4
|
+
declare const _default: 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: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, null>;
|
|
2
2
|
export default _default;
|
package/lib/helpers.d.ts
CHANGED
|
@@ -2,7 +2,10 @@ import type { Log } from './debug';
|
|
|
2
2
|
import type { Translator } from '@markuplint/i18n';
|
|
3
3
|
import type { Element, RuleConfigValue, Document } from '@markuplint/ml-core';
|
|
4
4
|
import type { Attribute } from '@markuplint/ml-spec';
|
|
5
|
-
export declare function attrMatches<T extends RuleConfigValue, R>(
|
|
5
|
+
export declare function attrMatches<T extends RuleConfigValue, R>(
|
|
6
|
+
node: Element<T, R>,
|
|
7
|
+
condition: Attribute['condition'],
|
|
8
|
+
): boolean;
|
|
6
9
|
export declare function match(needle: string, pattern: string): boolean;
|
|
7
10
|
/**
|
|
8
11
|
* PotentialCustomElementName
|
|
@@ -20,28 +23,43 @@ export declare function match(needle: string, pattern: string): boolean;
|
|
|
20
23
|
* 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.
|
|
21
24
|
*/
|
|
22
25
|
export declare const rePCENChar: string;
|
|
23
|
-
export declare function isValidAttr(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
export declare function isValidAttr(
|
|
27
|
+
t: Translator,
|
|
28
|
+
name: string,
|
|
29
|
+
value: string,
|
|
30
|
+
isDynamicValue: boolean,
|
|
31
|
+
node: Element<any, any>,
|
|
32
|
+
attrSpecs: Attribute[],
|
|
33
|
+
log?: Log,
|
|
34
|
+
):
|
|
35
|
+
| false
|
|
36
|
+
| {
|
|
37
|
+
invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
|
|
38
|
+
message: string;
|
|
39
|
+
loc?:
|
|
40
|
+
| {
|
|
41
|
+
raw: string;
|
|
42
|
+
line: number;
|
|
43
|
+
col: number;
|
|
44
|
+
}
|
|
45
|
+
| undefined;
|
|
46
|
+
};
|
|
32
47
|
export declare function toNormalizedValue(value: string, spec: Attribute): string;
|
|
33
48
|
export declare function accnameMayBeMutable(el: Element<any, any>, document: Document<any, any>): boolean;
|
|
34
|
-
export declare function getOwnedLabel<V extends RuleConfigValue, O>(
|
|
49
|
+
export declare function getOwnedLabel<V extends RuleConfigValue, O>(
|
|
50
|
+
el: Element<V, O>,
|
|
51
|
+
document: Document<V, O>,
|
|
52
|
+
): Element<V, O> | null;
|
|
35
53
|
export declare function decodeCharRef(characterReference: string): string;
|
|
36
54
|
export declare class Collection<T> {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
#private;
|
|
56
|
+
constructor(...items: (T | null | undefined)[]);
|
|
57
|
+
[Symbol.iterator](): Iterator<T>;
|
|
58
|
+
add(...items: (T | null | undefined)[]): void;
|
|
59
|
+
toArray(): readonly T[];
|
|
42
60
|
}
|
|
43
61
|
type Writeable<T> = {
|
|
44
|
-
|
|
62
|
+
-readonly [P in keyof T]: T[P];
|
|
45
63
|
};
|
|
46
64
|
export declare function deepCopy<T>(value: T): Writeable<T>;
|
|
47
65
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type { AttributeType } from '@markuplint/ml-spec';
|
|
2
2
|
type Option = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
attrs?: Record<string, Rule>;
|
|
4
|
+
ignoreAttrNamePrefix?: string | string[];
|
|
5
|
+
allowToAddPropertiesForPretender?: boolean;
|
|
6
6
|
};
|
|
7
|
-
type Rule =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
type Rule =
|
|
8
|
+
| {
|
|
9
|
+
enum: [string, ...string[]];
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
pattern: string;
|
|
13
|
+
}
|
|
14
|
+
| {
|
|
15
|
+
type: AttributeType;
|
|
16
|
+
}
|
|
17
|
+
| {
|
|
18
|
+
disallowed: true;
|
|
19
|
+
};
|
|
20
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Option>;
|
|
17
21
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
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: import(
|
|
7
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
|
|
8
8
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
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: import(
|
|
5
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
|
|
6
6
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ARIAVersion } from '@markuplint/ml-spec';
|
|
2
|
-
declare const _default: import(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<
|
|
3
|
+
import('@markuplint/ml-core').RuleConfigValue,
|
|
4
|
+
{
|
|
5
|
+
ariaVersion: ARIAVersion;
|
|
6
|
+
fragmentRefersNameAttr: boolean;
|
|
7
|
+
}
|
|
8
|
+
>;
|
|
6
9
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
2
|
+
ignore?: string | string[];
|
|
3
3
|
};
|
|
4
|
-
declare const _default: import(
|
|
4
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
|
|
5
5
|
export default _default;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { ChildNode, Options, Result, Specs } from './types';
|
|
2
2
|
import type { PermittedContentChoice } from '@markuplint/ml-spec';
|
|
3
|
-
export declare function choice(
|
|
3
|
+
export declare function choice(
|
|
4
|
+
pattern: PermittedContentChoice,
|
|
5
|
+
elements: ChildNode[],
|
|
6
|
+
specs: Specs,
|
|
7
|
+
options: Options,
|
|
8
|
+
depth: number,
|
|
9
|
+
): Result;
|
|
@@ -10,4 +10,10 @@ import type { PermittedContentPattern } from '@markuplint/ml-spec';
|
|
|
10
10
|
* @param depth
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
|
-
export declare function complexBranch(
|
|
13
|
+
export declare function complexBranch(
|
|
14
|
+
pattern: PermittedContentPattern,
|
|
15
|
+
elements: ChildNode[],
|
|
16
|
+
specs: Specs,
|
|
17
|
+
options: Options,
|
|
18
|
+
depth: number,
|
|
19
|
+
): 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
|
/**
|
|
4
9
|
* Check count
|
|
5
10
|
*
|
|
@@ -10,4 +15,14 @@ import type { PermittedContentOneOrMore, PermittedContentOptional, PermittedCont
|
|
|
10
15
|
* @param depth
|
|
11
16
|
* @returns
|
|
12
17
|
*/
|
|
13
|
-
export declare function countPattern(
|
|
18
|
+
export declare function countPattern(
|
|
19
|
+
pattern:
|
|
20
|
+
| PermittedContentOneOrMore
|
|
21
|
+
| PermittedContentOptional
|
|
22
|
+
| PermittedContentRequire
|
|
23
|
+
| PermittedContentZeroOrMore,
|
|
24
|
+
elements: readonly ChildNode[],
|
|
25
|
+
specs: Specs,
|
|
26
|
+
options: Options,
|
|
27
|
+
depth: number,
|
|
28
|
+
): 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,9 @@
|
|
|
1
1
|
import type { ChildNode, Options, 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
|
+
options: Options,
|
|
8
|
+
depth: number,
|
|
9
|
+
): SelectorResult;
|
|
@@ -10,4 +10,10 @@ import type { PermittedContentPattern } from '@markuplint/ml-spec';
|
|
|
10
10
|
* @param depth
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
|
-
export declare function order(
|
|
13
|
+
export declare function order(
|
|
14
|
+
contents: ReadonlyArray<PermittedContentPattern>,
|
|
15
|
+
nodes: ReadonlyArray<ChildNode>,
|
|
16
|
+
specs: Specs,
|
|
17
|
+
options: Options,
|
|
18
|
+
depth: number,
|
|
19
|
+
): Result;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
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
|
-
export declare function recursiveBranch(
|
|
4
|
+
export declare function recursiveBranch(
|
|
5
|
+
model: Model | PermittedContentPattern[],
|
|
6
|
+
nodes: readonly ChildNode[],
|
|
7
|
+
specs: Specs,
|
|
8
|
+
options: Options,
|
|
9
|
+
depth: number,
|
|
10
|
+
): 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
|
};
|
|
@@ -9,4 +9,9 @@ import type { ContentModel } from '@markuplint/ml-spec';
|
|
|
9
9
|
* @param options
|
|
10
10
|
* @returns
|
|
11
11
|
*/
|
|
12
|
-
export declare function start(
|
|
12
|
+
export declare function start(
|
|
13
|
+
contents: ContentModel['contents'],
|
|
14
|
+
el: Element,
|
|
15
|
+
specs: Specs,
|
|
16
|
+
options: Options,
|
|
17
|
+
): ContentModelResult[];
|
|
@@ -3,49 +3,49 @@ import type { ContentModel, MLMLSpec } from '@markuplint/ml-spec';
|
|
|
3
3
|
export type Element = _Element<TagRule[], Options>;
|
|
4
4
|
export type ChildNode = _ChildNode<TagRule[], Options>;
|
|
5
5
|
export type Specs = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
cites: MLMLSpec['cites'];
|
|
7
|
+
def: MLMLSpec['def'];
|
|
8
|
+
specs: {
|
|
9
|
+
name: string;
|
|
10
|
+
contentModel: {
|
|
11
|
+
contents: MLMLSpec['specs'][0]['contentModel']['contents'];
|
|
12
|
+
};
|
|
13
|
+
}[];
|
|
14
14
|
};
|
|
15
15
|
export type ContentModelResult = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
type: MatchedReason | UnmatchedReason;
|
|
17
|
+
scope: ChildNode;
|
|
18
|
+
query: Result['query'];
|
|
19
|
+
hint: Result['hint'];
|
|
20
20
|
};
|
|
21
21
|
export type Result<T extends string = MatchedReason> = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
type: MatchedReason | UnmatchedReason | T;
|
|
23
|
+
matched: ChildNode[];
|
|
24
|
+
unmatched: ChildNode[];
|
|
25
|
+
zeroMatch: boolean;
|
|
26
|
+
query: string;
|
|
27
|
+
hint: Hints;
|
|
28
28
|
};
|
|
29
29
|
export type Hints = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
max?: number;
|
|
31
|
+
not?: ChildNode;
|
|
32
|
+
transparent?: Element;
|
|
33
|
+
missing?: {
|
|
34
|
+
barelyMatchedElements?: number;
|
|
35
|
+
need?: string;
|
|
36
|
+
};
|
|
37
37
|
};
|
|
38
38
|
export type MatchedReason = 'MATCHED' | 'MATCHED_ZERO';
|
|
39
39
|
export type UnmatchedReason = 'NOTHING' | 'UNEXPECTED_EXTRA_NODE' | 'TRANSPARENT_MODEL_DISALLOWS' | MissingNodeReason;
|
|
40
40
|
export type MissingNodeReason = 'MISSING_NODE_REQUIRED' | 'MISSING_NODE_ONE_OR_MORE';
|
|
41
41
|
export type RepeatSign = '' | '?' | '+' | '*' | `{${number},${number}}`;
|
|
42
42
|
export type TransparentModel = {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
el: Element;
|
|
44
|
+
additionalCondition: string;
|
|
45
45
|
};
|
|
46
46
|
export type TagRule = {
|
|
47
|
-
|
|
47
|
+
tag: string;
|
|
48
48
|
} & ContentModel;
|
|
49
49
|
export type Options = {
|
|
50
|
-
|
|
50
|
+
ignoreHasMutableChildren: boolean;
|
|
51
51
|
};
|
|
@@ -1,50 +1,87 @@
|
|
|
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
|
export declare function getChildNodesWithoutWhitespaces(el: Element): ChildNode[];
|
|
4
13
|
export declare function isModel(model: Model | PermittedContentPattern[]): model is Model;
|
|
5
|
-
export declare function matches(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
export declare function matches(
|
|
15
|
+
selector: string,
|
|
16
|
+
node: ChildNode,
|
|
17
|
+
specs: Specs,
|
|
18
|
+
):
|
|
19
|
+
| {
|
|
20
|
+
matched: boolean;
|
|
21
|
+
not?: undefined;
|
|
22
|
+
}
|
|
23
|
+
| {
|
|
24
|
+
matched: boolean;
|
|
25
|
+
not: ChildNode | undefined;
|
|
26
|
+
};
|
|
12
27
|
export declare function isRequire(content: PermittedContentPattern): content is PermittedContentRequire;
|
|
13
28
|
export declare function isOptional(content: PermittedContentPattern): content is PermittedContentOptional;
|
|
14
29
|
export declare function isOneOrMore(content: PermittedContentPattern): content is PermittedContentOneOrMore;
|
|
15
30
|
export declare function isZeroOrMore(content: PermittedContentPattern): content is PermittedContentZeroOrMore;
|
|
16
31
|
export declare function isChoice(content: PermittedContentPattern): content is PermittedContentChoice;
|
|
17
32
|
export declare function isTransparent(content: PermittedContentPattern): content is PermittedContentTransparent;
|
|
18
|
-
export declare function normalizeModel(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
33
|
+
export declare function normalizeModel(
|
|
34
|
+
pattern:
|
|
35
|
+
| PermittedContentRequire
|
|
36
|
+
| PermittedContentOptional
|
|
37
|
+
| PermittedContentOneOrMore
|
|
38
|
+
| PermittedContentZeroOrMore,
|
|
39
|
+
): {
|
|
40
|
+
model: PermittedContentPattern[] | Model;
|
|
41
|
+
min: number;
|
|
42
|
+
max: number;
|
|
43
|
+
repeat: RepeatSign;
|
|
44
|
+
missingType: MissingNodeReason | undefined;
|
|
24
45
|
};
|
|
25
|
-
export declare function mergeHints(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
46
|
+
export declare function mergeHints(
|
|
47
|
+
a: Hints,
|
|
48
|
+
b: Hints,
|
|
49
|
+
): Partial<{
|
|
50
|
+
missing:
|
|
51
|
+
| Partial<{
|
|
52
|
+
barelyMatchedElements?: number | undefined;
|
|
53
|
+
need?: string | undefined;
|
|
54
|
+
}>
|
|
55
|
+
| undefined;
|
|
56
|
+
max?: number | undefined;
|
|
57
|
+
not?:
|
|
58
|
+
| import('packages/@markuplint/ml-core/lib').DocumentType<
|
|
59
|
+
import('./types').TagRule[],
|
|
60
|
+
import('./types').Options
|
|
61
|
+
>
|
|
62
|
+
| import('packages/@markuplint/ml-core/lib/ml-dom/node/character-data').MLCharacterData<
|
|
63
|
+
import('./types').TagRule[],
|
|
64
|
+
import('./types').Options,
|
|
65
|
+
import('packages/@markuplint/ml-ast/lib').MLASTAbstractNode
|
|
66
|
+
>
|
|
67
|
+
| import('packages/@markuplint/ml-core/lib').Element<import('./types').TagRule[], import('./types').Options>
|
|
68
|
+
| import('packages/@markuplint/ml-core/lib').Block<import('./types').TagRule[], import('./types').Options>
|
|
69
|
+
| undefined;
|
|
70
|
+
transparent?: Element | undefined;
|
|
33
71
|
}>;
|
|
34
72
|
export declare function cleanObject<T extends Object>(object: T): Partial<T>;
|
|
35
73
|
export declare class Collection {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
export declare class UnsupportedError extends Error {
|
|
74
|
+
#private;
|
|
75
|
+
constructor(origin: readonly ChildNode[]);
|
|
76
|
+
get matched(): ChildNode[];
|
|
77
|
+
get matchedCount(): number;
|
|
78
|
+
get nodes(): ChildNode[];
|
|
79
|
+
get unmatched(): ChildNode[];
|
|
80
|
+
addMatched(nodes: ChildNode[]): boolean;
|
|
81
|
+
back(): void;
|
|
82
|
+
lock(): void;
|
|
83
|
+
max(max: number): void;
|
|
84
|
+
toString(highlightExtraNodes?: boolean): string;
|
|
49
85
|
}
|
|
86
|
+
export declare class UnsupportedError extends Error {}
|
|
50
87
|
export declare function modelLog(model: Model | PermittedContentPattern[], repeat: RepeatSign): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
1
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, null>;
|
|
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: import(
|
|
5
|
+
declare const _default: 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: import(
|
|
5
|
+
declare const _default: 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: import(
|
|
6
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<RequiredAttributes, null>;
|
|
7
7
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
2
|
+
ignoreHasMutableContents: boolean;
|
|
3
3
|
};
|
|
4
|
-
declare const _default: import(
|
|
4
|
+
declare const _default: 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: import(
|
|
5
|
+
declare const _default: 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 = string[];
|
|
2
2
|
type Options = {
|
|
3
|
-
|
|
3
|
+
spaceNeededBullets?: string[];
|
|
4
4
|
};
|
|
5
|
-
declare const _default: import(
|
|
5
|
+
declare const _default: import('@markuplint/ml-core').RuleSeed<Bullets, Options>;
|
|
6
6
|
export default _default;
|
|
@@ -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: 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: 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: 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: ARIAProperty[];
|
|
9
|
+
attrSpecs: 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: 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: ARIAProperty[];
|
|
14
|
+
}
|
|
15
|
+
>;
|
|
@@ -1,11 +1,15 @@
|
|
|
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: ARIAProperty[];
|
|
10
|
+
booleanish?: boolean;
|
|
11
|
+
}
|
|
12
|
+
>;
|
|
9
13
|
/**
|
|
10
14
|
*
|
|
11
15
|
* @see https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value
|
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.3.1",
|
|
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,11 +20,13 @@
|
|
|
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/
|
|
23
|
+
"@markuplint/html-spec": "3.3.1",
|
|
24
|
+
"@markuplint/ml-core": "3.3.1",
|
|
25
|
+
"@markuplint/ml-spec": "3.3.0",
|
|
26
|
+
"@markuplint/selector": "3.3.0",
|
|
27
|
+
"@markuplint/types": "3.2.0",
|
|
27
28
|
"@ungap/structured-clone": "^1.0.1",
|
|
29
|
+
"ansi-colors": "^4.1.3",
|
|
28
30
|
"chrono-node": "^2.5.0",
|
|
29
31
|
"debug": "^4.3.4",
|
|
30
32
|
"html-entities": "^2.3.3",
|
|
@@ -33,5 +35,5 @@
|
|
|
33
35
|
"devDependencies": {
|
|
34
36
|
"@types/debug": "^4.1.7"
|
|
35
37
|
},
|
|
36
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "f19e7de726cf01d53342bc5513c30da75d28da63"
|
|
37
39
|
}
|
package/lib/__foo/index.d.ts
DELETED
package/lib/__foo/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ml_core_1 = require("@markuplint/ml-core");
|
|
4
|
-
exports.default = (0, ml_core_1.createRule)({
|
|
5
|
-
defaultValue: true,
|
|
6
|
-
defaultOptions: null,
|
|
7
|
-
async verify({ document, report, t }) {
|
|
8
|
-
// Element
|
|
9
|
-
await document.walkOn("Element", (el) => {
|
|
10
|
-
const raw = el.raw.trim();
|
|
11
|
-
if (/./i.test(raw)) {
|
|
12
|
-
report({
|
|
13
|
-
scope: el,
|
|
14
|
-
message: t("It is {0}", "issue"),
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
// Attribute
|
|
19
|
-
await document.walkOn("Attr", (attr) => {
|
|
20
|
-
var _a, _b, _c;
|
|
21
|
-
if (/./i.test(attr.name)) {
|
|
22
|
-
report({
|
|
23
|
-
scope: attr,
|
|
24
|
-
line: (_a = attr.nameNode) === null || _a === void 0 ? void 0 : _a.startLine,
|
|
25
|
-
col: (_b = attr.nameNode) === null || _b === void 0 ? void 0 : _b.startCol,
|
|
26
|
-
raw: (_c = attr.nameNode) === null || _c === void 0 ? void 0 : _c.raw,
|
|
27
|
-
message: t("It is {0}", "issue"),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
},
|
|
32
|
-
});
|