@markuplint/rules 3.6.0 → 3.6.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.
@@ -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
- invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
6
- message: string;
7
- loc?: Loc;
5
+ invalidType: 'non-existent' | 'invalid-value' | 'disallowed-attr';
6
+ message: string;
7
+ loc?: Loc;
8
8
  };
9
9
  type Loc = {
10
- raw: string;
11
- line: number;
12
- col: number;
10
+ raw: string;
11
+ line: number;
12
+ col: number;
13
13
  };
14
14
  /**
15
15
  * Use in rules `invalid-attr` and `wai-aria`
@@ -19,17 +19,6 @@ type Loc = {
19
19
  * @param isCustomRule
20
20
  * @param spec
21
21
  */
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;
22
+ export declare function attrCheck(t: Translator, name: string, value: string, isCustomRule: boolean, spec?: AttrSpec): Invalid | false;
23
+ export declare function valueCheck(t: Translator, name: string, value: string, type: ReadonlyDeep<AttributeType>): [string, Loc] | false;
35
24
  export {};
@@ -1,51 +1,100 @@
1
1
  import type { ChildNode, Element, Hints, MissingNodeReason, RepeatSign, Specs } from './types';
2
- import type { PermittedContentPattern, PermittedContentChoice, PermittedContentOneOrMore, PermittedContentOptional, PermittedContentRequire, PermittedContentTransparent, PermittedContentZeroOrMore, Model } from '@markuplint/ml-spec';
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(selector: string, node: ChildNode, specs: Specs): {
7
- matched: boolean;
8
- not?: undefined;
9
- } | {
10
- matched: boolean;
11
- not: ChildNode | undefined;
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 isRequire(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentRequire>;
14
- export declare function isOptional(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentOptional>;
15
- export declare function isOneOrMore(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentOneOrMore>;
16
- export declare function isZeroOrMore(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentZeroOrMore>;
17
- export declare function isChoice(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentChoice>;
18
- export declare function isTransparent(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentTransparent>;
19
- export declare function normalizeModel(pattern: ReadonlyDeep<PermittedContentRequire> | ReadonlyDeep<PermittedContentOptional> | ReadonlyDeep<PermittedContentOneOrMore> | ReadonlyDeep<PermittedContentZeroOrMore>): {
20
- model: ReadonlyDeep<PermittedContentPattern[] | Model>;
21
- min: number;
22
- max: number;
23
- repeat: RepeatSign;
24
- missingType: MissingNodeReason | undefined;
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?: import("packages/@markuplint/ml-core/lib").DocumentType<import("./types").TagRule[], import("./types").Options> | import("packages/@markuplint/ml-core/lib/ml-dom/node/character-data").MLCharacterData<import("./types").TagRule[], import("./types").Options, import("packages/@markuplint/ml-ast/lib").MLASTAbstractNode> | import("packages/@markuplint/ml-core/lib").Element<import("./types").TagRule[], import("./types").Options> | import("packages/@markuplint/ml-core/lib").Block<import("./types").TagRule[], import("./types").Options> | 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?:
71
+ | import('packages/@markuplint/ml-core/lib').DocumentType<
72
+ import('./types').TagRule[],
73
+ import('./types').Options
74
+ >
75
+ | import('packages/@markuplint/ml-core/lib/ml-dom/node/character-data').MLCharacterData<
76
+ import('./types').TagRule[],
77
+ import('./types').Options,
78
+ import('packages/@markuplint/ml-ast/lib').MLASTAbstractNode
79
+ >
80
+ | import('packages/@markuplint/ml-core/lib').Element<import('./types').TagRule[], import('./types').Options>
81
+ | import('packages/@markuplint/ml-core/lib').Block<import('./types').TagRule[], import('./types').Options>
82
+ | undefined;
83
+ transparent?: Element | undefined;
34
84
  }>;
35
85
  export declare function cleanObject<T extends Object>(object: T): Partial<T>;
36
86
  export declare class Collection {
37
- #private;
38
- constructor(origin: readonly ChildNode[]);
39
- get matched(): ChildNode[];
40
- get matchedCount(): number;
41
- get nodes(): ChildNode[];
42
- get unmatched(): ChildNode[];
43
- addMatched(nodes: ChildNode[]): boolean;
44
- back(): void;
45
- lock(): void;
46
- max(max: number): void;
47
- toString(highlightExtraNodes?: boolean): string;
48
- }
49
- export declare class UnsupportedError extends Error {
87
+ #private;
88
+ constructor(origin: readonly ChildNode[]);
89
+ get matched(): ChildNode[];
90
+ get matchedCount(): number;
91
+ get nodes(): ChildNode[];
92
+ get unmatched(): ChildNode[];
93
+ addMatched(nodes: ChildNode[]): boolean;
94
+ back(): void;
95
+ lock(): void;
96
+ max(max: number): void;
97
+ toString(highlightExtraNodes?: boolean): string;
50
98
  }
99
+ export declare class UnsupportedError extends Error {}
51
100
  export declare function modelLog(model: ReadonlyDeep<Model | PermittedContentPattern[]>, repeat: RepeatSign): string;
@@ -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<boolean, Options, {
5
- role: ARIARole | null;
6
- propSpecs: readonly ARIAProperty[];
7
- }>;
4
+ export declare const checkingDisallowedProp: AttrChecker<
5
+ boolean,
6
+ Options,
7
+ {
8
+ role: ARIARole | null;
9
+ propSpecs: readonly ARIAProperty[];
10
+ }
11
+ >;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "3.6.0",
3
+ "version": "3.6.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,12 +20,12 @@
20
20
  "./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
21
21
  },
22
22
  "dependencies": {
23
- "@markuplint/html-spec": "3.6.0",
24
- "@markuplint/ml-core": "3.6.0",
25
- "@markuplint/ml-spec": "3.6.0",
26
- "@markuplint/selector": "3.6.0",
23
+ "@markuplint/html-spec": "3.6.1",
24
+ "@markuplint/ml-core": "3.6.1",
25
+ "@markuplint/ml-spec": "3.6.1",
26
+ "@markuplint/selector": "3.6.1",
27
27
  "@markuplint/shared": "3.5.0",
28
- "@markuplint/types": "3.5.0",
28
+ "@markuplint/types": "3.5.1",
29
29
  "@ungap/structured-clone": "^1.0.1",
30
30
  "ansi-colors": "^4.1.3",
31
31
  "chrono-node": "^2.5.0",
@@ -36,5 +36,5 @@
36
36
  "@types/debug": "^4.1.7",
37
37
  "type-fest": "^3.6.1"
38
38
  },
39
- "gitHead": "715dd53d3b1064a9bcf616c1533921cad9e3b187"
39
+ "gitHead": "3cdf5a088b2da03773d5d4461d0e65ec32290a00"
40
40
  }