@markuplint/rules 2.0.0-rc.6 → 2.0.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.
Files changed (39) hide show
  1. package/README.md +34 -66
  2. package/lib/attr-check.d.ts +19 -8
  3. package/lib/attr-duplication/index.d.ts +1 -1
  4. package/lib/attr-equal-space-after/index.d.ts +1 -1
  5. package/lib/attr-equal-space-before/index.d.ts +1 -1
  6. package/lib/attr-spacing/index.d.ts +3 -3
  7. package/lib/attr-value-quotes/index.d.ts +2 -2
  8. package/lib/case-sensitive-attr-name/index.d.ts +1 -1
  9. package/lib/case-sensitive-tag-name/index.d.ts +1 -1
  10. package/lib/character-reference/index.d.ts +1 -1
  11. package/lib/class-naming/index.d.ts +1 -1
  12. package/lib/create-message.d.ts +12 -2
  13. package/lib/deprecated-attr/index.d.ts +1 -1
  14. package/lib/deprecated-element/index.d.ts +1 -1
  15. package/lib/disallowed-element/index.d.ts +1 -1
  16. package/lib/doctype/index.d.ts +2 -2
  17. package/lib/end-tag/index.d.ts +1 -1
  18. package/lib/helpers.d.ts +74 -41
  19. package/lib/id-duplication/index.d.ts +1 -1
  20. package/lib/indentation/index.d.ts +3 -3
  21. package/lib/index.d.ts +147 -61
  22. package/lib/ineffective-attr/index.d.ts +1 -1
  23. package/lib/invalid-attr/index.d.ts +16 -12
  24. package/lib/landmark-roles/index.d.ts +3 -3
  25. package/lib/no-boolean-attr-value/index.d.ts +1 -1
  26. package/lib/no-default-value/index.d.ts +1 -1
  27. package/lib/no-hard-code-id/index.d.ts +1 -1
  28. package/lib/no-refer-to-non-existent-id/index.d.ts +1 -1
  29. package/lib/no-use-event-handler-attr/index.d.ts +2 -2
  30. package/lib/permitted-contents/index.d.ts +2 -2
  31. package/lib/permitted-contents/permitted-content.spec-to-regexp.d.ts +8 -8
  32. package/lib/permitted-contents/types.d.ts +6 -6
  33. package/lib/require-element/index.d.ts +1 -1
  34. package/lib/required-attr/index.d.ts +3 -3
  35. package/lib/required-element/index.d.ts +2 -2
  36. package/lib/required-h1/index.d.ts +3 -3
  37. package/lib/wai-aria/index.d.ts +7 -7
  38. package/package.json +7 -7
  39. package/tsconfig.tsbuildinfo +1 -1
package/lib/index.d.ts CHANGED
@@ -1,64 +1,150 @@
1
1
  declare const _default: {
2
- 'attr-duplication': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
3
- 'attr-equal-space-after': import("packages/@markuplint/ml-core/lib").RuleSeed<"never" | "always" | "always-single-line" | "never-single-line", null>;
4
- 'attr-equal-space-before': import("packages/@markuplint/ml-core/lib").RuleSeed<"never" | "always" | "always-single-line" | "never-single-line", null>;
5
- 'attr-spacing': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, import("./attr-spacing").AttrSpasingOptions>;
6
- 'attr-value-quotes': import("packages/@markuplint/ml-core/lib").RuleSeed<import("./attr-value-quotes").Type, null>;
7
- 'case-sensitive-attr-name': import("packages/@markuplint/ml-core/lib").RuleSeed<import("./case-sensitive-attr-name").Value | import("./case-sensitive-attr-name").Value_v1, null>;
8
- 'case-sensitive-tag-name': import("packages/@markuplint/ml-core/lib").RuleSeed<import("./case-sensitive-tag-name").Value, null>;
9
- 'character-reference': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
10
- 'class-naming': import("packages/@markuplint/ml-core/lib").RuleSeed<import("./class-naming").Value, null>;
11
- 'deprecated-attr': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
12
- 'deprecated-element': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
13
- 'disallowed-element': import("packages/@markuplint/ml-core/lib").RuleSeed<string[], null>;
14
- doctype: import("packages/@markuplint/ml-core/lib").RuleSeed<"always", {
15
- denyObsolateType: boolean;
16
- }>;
17
- 'end-tag': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, null>;
18
- 'id-duplication': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
19
- indentation: import("packages/@markuplint/ml-core/lib").RuleSeed<import("./indentation").Value, import("./indentation").IndentationOptions>;
20
- 'ineffective-attr': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
21
- 'invalid-attr': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, {
22
- attrs?: Record<string, {
23
- enum: [string, ...string[]];
24
- } | {
25
- pattern: string;
26
- } | {
27
- type: import("packages/@markuplint/ml-spec/lib").AttributeType;
28
- } | {
29
- disallowed: true;
30
- }> | undefined;
31
- ignoreAttrNamePrefix?: string | string[] | undefined;
32
- }>;
33
- 'landmark-roles': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, {
34
- ignoreRoles?: (("banner" | "main" | "complementary" | "contentinfo") | "form" | "navigation" | "region")[] | undefined;
35
- labelEachArea?: boolean | undefined;
36
- }>;
37
- 'no-boolean-attr-value': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
38
- 'no-default-value': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
39
- 'no-hard-code-id': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
40
- 'no-refer-to-non-existent-id': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-config/src").RuleConfigValue, null>;
41
- 'no-use-event-handler-attr': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, {
42
- ignore?: string | string[] | undefined;
43
- }>;
44
- 'permitted-contents': import("packages/@markuplint/ml-core/lib").RuleSeed<import("packages/@markuplint/ml-spec/lib").PermittedStructuresSchema[], {
45
- ignoreHasMutableChildren: boolean;
46
- }>;
47
- 'required-attr': import("packages/@markuplint/ml-core/lib").RuleSeed<string | (string | {
48
- name: string;
49
- value: string | string[];
50
- })[], null>;
51
- 'required-element': import("packages/@markuplint/ml-core/lib").RuleSeed<string[], {
52
- ignoreHasMutableContents?: boolean | undefined;
53
- }>;
54
- 'required-h1': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, import("./required-h1").Options>;
55
- 'wai-aria': import("packages/@markuplint/ml-core/lib").RuleSeed<boolean, {
56
- checkingValue?: boolean | undefined;
57
- checkingDeprecatedProps?: boolean | undefined;
58
- permittedAriaRoles?: boolean | undefined;
59
- disallowSetImplicitRole?: boolean | undefined;
60
- disallowSetImplicitProps?: boolean | undefined;
61
- disallowDefaultValue?: boolean | undefined;
62
- }>;
2
+ 'attr-duplication': import('packages/@markuplint/ml-core/lib').RuleSeed<
3
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
4
+ null
5
+ >;
6
+ 'attr-equal-space-after': import('packages/@markuplint/ml-core/lib').RuleSeed<
7
+ 'always' | 'never' | 'always-single-line' | 'never-single-line',
8
+ null
9
+ >;
10
+ 'attr-equal-space-before': import('packages/@markuplint/ml-core/lib').RuleSeed<
11
+ 'always' | 'never' | 'always-single-line' | 'never-single-line',
12
+ null
13
+ >;
14
+ 'attr-spacing': import('packages/@markuplint/ml-core/lib').RuleSeed<
15
+ boolean,
16
+ import('./attr-spacing').AttrSpasingOptions
17
+ >;
18
+ 'attr-value-quotes': import('packages/@markuplint/ml-core/lib').RuleSeed<import('./attr-value-quotes').Type, null>;
19
+ 'case-sensitive-attr-name': import('packages/@markuplint/ml-core/lib').RuleSeed<
20
+ import('./case-sensitive-attr-name').Value | import('./case-sensitive-attr-name').Value_v1,
21
+ null
22
+ >;
23
+ 'case-sensitive-tag-name': import('packages/@markuplint/ml-core/lib').RuleSeed<
24
+ import('./case-sensitive-tag-name').Value,
25
+ null
26
+ >;
27
+ 'character-reference': import('packages/@markuplint/ml-core/lib').RuleSeed<
28
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
29
+ null
30
+ >;
31
+ 'class-naming': import('packages/@markuplint/ml-core/lib').RuleSeed<import('./class-naming').Value, null>;
32
+ 'deprecated-attr': import('packages/@markuplint/ml-core/lib').RuleSeed<
33
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
34
+ null
35
+ >;
36
+ 'deprecated-element': import('packages/@markuplint/ml-core/lib').RuleSeed<
37
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
38
+ null
39
+ >;
40
+ 'disallowed-element': import('packages/@markuplint/ml-core/lib').RuleSeed<string[], null>;
41
+ doctype: import('packages/@markuplint/ml-core/lib').RuleSeed<
42
+ 'always',
43
+ {
44
+ denyObsolateType: boolean;
45
+ }
46
+ >;
47
+ 'end-tag': import('packages/@markuplint/ml-core/lib').RuleSeed<boolean, null>;
48
+ 'id-duplication': import('packages/@markuplint/ml-core/lib').RuleSeed<
49
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
50
+ null
51
+ >;
52
+ indentation: import('packages/@markuplint/ml-core/lib').RuleSeed<
53
+ import('./indentation').Value,
54
+ import('./indentation').IndentationOptions
55
+ >;
56
+ 'ineffective-attr': import('packages/@markuplint/ml-core/lib').RuleSeed<
57
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
58
+ null
59
+ >;
60
+ 'invalid-attr': import('packages/@markuplint/ml-core/lib').RuleSeed<
61
+ boolean,
62
+ {
63
+ attrs?:
64
+ | Record<
65
+ string,
66
+ | {
67
+ enum: [string, ...string[]];
68
+ }
69
+ | {
70
+ pattern: string;
71
+ }
72
+ | {
73
+ type: import('packages/@markuplint/ml-spec/lib').AttributeType;
74
+ }
75
+ | {
76
+ disallowed: true;
77
+ }
78
+ >
79
+ | undefined;
80
+ ignoreAttrNamePrefix?: string | string[] | undefined;
81
+ }
82
+ >;
83
+ 'landmark-roles': import('packages/@markuplint/ml-core/lib').RuleSeed<
84
+ boolean,
85
+ {
86
+ ignoreRoles?:
87
+ | (('banner' | 'main' | 'complementary' | 'contentinfo') | 'form' | 'navigation' | 'region')[]
88
+ | undefined;
89
+ labelEachArea?: boolean | undefined;
90
+ }
91
+ >;
92
+ 'no-boolean-attr-value': import('packages/@markuplint/ml-core/lib').RuleSeed<
93
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
94
+ null
95
+ >;
96
+ 'no-default-value': import('packages/@markuplint/ml-core/lib').RuleSeed<
97
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
98
+ null
99
+ >;
100
+ 'no-hard-code-id': import('packages/@markuplint/ml-core/lib').RuleSeed<
101
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
102
+ null
103
+ >;
104
+ 'no-refer-to-non-existent-id': import('packages/@markuplint/ml-core/lib').RuleSeed<
105
+ import('packages/@markuplint/ml-config/src').RuleConfigValue,
106
+ null
107
+ >;
108
+ 'no-use-event-handler-attr': import('packages/@markuplint/ml-core/lib').RuleSeed<
109
+ boolean,
110
+ {
111
+ ignore?: string | string[] | undefined;
112
+ }
113
+ >;
114
+ 'permitted-contents': import('packages/@markuplint/ml-core/lib').RuleSeed<
115
+ import('packages/@markuplint/ml-spec/lib').PermittedStructuresSchema[],
116
+ {
117
+ ignoreHasMutableChildren: boolean;
118
+ }
119
+ >;
120
+ 'required-attr': import('packages/@markuplint/ml-core/lib').RuleSeed<
121
+ | string
122
+ | (
123
+ | string
124
+ | {
125
+ name: string;
126
+ value: string | string[];
127
+ }
128
+ )[],
129
+ null
130
+ >;
131
+ 'required-element': import('packages/@markuplint/ml-core/lib').RuleSeed<
132
+ string[],
133
+ {
134
+ ignoreHasMutableContents?: boolean | undefined;
135
+ }
136
+ >;
137
+ 'required-h1': import('packages/@markuplint/ml-core/lib').RuleSeed<boolean, import('./required-h1').Options>;
138
+ 'wai-aria': import('packages/@markuplint/ml-core/lib').RuleSeed<
139
+ boolean,
140
+ {
141
+ checkingValue?: boolean | undefined;
142
+ checkingDeprecatedProps?: boolean | undefined;
143
+ permittedAriaRoles?: boolean | undefined;
144
+ disallowSetImplicitRole?: boolean | undefined;
145
+ disallowSetImplicitProps?: boolean | undefined;
146
+ disallowDefaultValue?: boolean | undefined;
147
+ }
148
+ >;
63
149
  };
64
150
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, null>;
1
+ declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
2
2
  export default _default;
@@ -1,16 +1,20 @@
1
1
  import type { AttributeType } from '@markuplint/ml-spec';
2
2
  declare type Option = {
3
- attrs?: Record<string, Rule>;
4
- ignoreAttrNamePrefix?: string | string[];
3
+ attrs?: Record<string, Rule>;
4
+ ignoreAttrNamePrefix?: string | string[];
5
5
  };
6
- declare type Rule = {
7
- enum: [string, ...string[]];
8
- } | {
9
- pattern: string;
10
- } | {
11
- type: AttributeType;
12
- } | {
13
- disallowed: true;
14
- };
15
- declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Option>;
6
+ declare type Rule =
7
+ | {
8
+ enum: [string, ...string[]];
9
+ }
10
+ | {
11
+ pattern: string;
12
+ }
13
+ | {
14
+ type: AttributeType;
15
+ }
16
+ | {
17
+ disallowed: true;
18
+ };
19
+ declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Option>;
16
20
  export default _default;
@@ -1,8 +1,8 @@
1
1
  declare type Options = {
2
- ignoreRoles?: Roles[];
3
- labelEachArea?: boolean;
2
+ ignoreRoles?: Roles[];
3
+ labelEachArea?: boolean;
4
4
  };
5
5
  declare type TopLevelRoles = 'banner' | 'main' | 'complementary' | 'contentinfo';
6
6
  declare type Roles = TopLevelRoles | 'form' | 'navigation' | 'region';
7
- declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Options>;
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("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, null>;
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("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, null>;
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("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, null>;
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("@markuplint/ml-core").RuleSeed<import("@markuplint/ml-core").RuleConfigValue, null>;
1
+ declare const _default: import('@markuplint/ml-core').RuleSeed<import('@markuplint/ml-core').RuleConfigValue, null>;
2
2
  export default _default;
@@ -1,5 +1,5 @@
1
1
  declare type Options = {
2
- ignore?: string | string[];
2
+ ignore?: string | string[];
3
3
  };
4
- declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Options>;
4
+ declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
5
5
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import type { PermittedStructuresSchema } from '@markuplint/ml-spec';
2
2
  declare type Options = {
3
- ignoreHasMutableChildren: boolean;
3
+ ignoreHasMutableChildren: boolean;
4
4
  };
5
- declare const _default: import("@markuplint/ml-core").RuleSeed<PermittedStructuresSchema[], Options>;
5
+ declare const _default: import('@markuplint/ml-core').RuleSeed<PermittedStructuresSchema[], Options>;
6
6
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { PermittedContent } from '@markuplint/ml-spec';
2
2
  export default class ExpGenerator {
3
- private _id;
4
- private _idCounter;
5
- constructor(_id: number);
6
- specToRegExp(contentRule: PermittedContent[] | boolean, parentExp?: RegExp | null, ownNS?: string | null): RegExp;
7
- private _toPattern;
8
- private _interleavePattern;
9
- private _targetTags;
10
- private _resolveTags;
3
+ private _id;
4
+ private _idCounter;
5
+ constructor(_id: number);
6
+ specToRegExp(contentRule: PermittedContent[] | boolean, parentExp?: RegExp | null, ownNS?: string | null): RegExp;
7
+ private _toPattern;
8
+ private _interleavePattern;
9
+ private _targetTags;
10
+ private _resolveTags;
11
11
  }
@@ -1,8 +1,8 @@
1
1
  export declare type El = {
2
- uuid: string;
3
- nodeName: string;
4
- parentNode: El | null;
5
- isCustomElement?: boolean;
6
- nameWithNS?: string;
7
- ns?: string | null;
2
+ uuid: string;
3
+ nodeName: string;
4
+ parentNode: El | null;
5
+ isCustomElement?: boolean;
6
+ nameWithNS?: string;
7
+ ns?: string | null;
8
8
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import("@markuplint/ml-core").RuleSeed<string[], null>;
1
+ declare const _default: import('@markuplint/ml-core').RuleSeed<string[], null>;
2
2
  export default _default;
@@ -1,7 +1,7 @@
1
1
  declare type RequiredAttributes = string | (string | Attr)[];
2
2
  declare type Attr = {
3
- name: string;
4
- value: string | string[];
3
+ name: string;
4
+ value: string | string[];
5
5
  };
6
- declare const _default: import("@markuplint/ml-core").RuleSeed<RequiredAttributes, null>;
6
+ declare const _default: import('@markuplint/ml-core').RuleSeed<RequiredAttributes, null>;
7
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  declare type Options = {
2
- ignoreHasMutableContents?: boolean;
2
+ ignoreHasMutableContents?: boolean;
3
3
  };
4
- declare const _default: import("@markuplint/ml-core").RuleSeed<string[], Options>;
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
- 'expected-once'?: boolean;
3
- 'in-document-fragment'?: boolean;
2
+ 'expected-once'?: boolean;
3
+ 'in-document-fragment'?: boolean;
4
4
  }
5
- declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Options>;
5
+ declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
6
6
  export default _default;
@@ -1,10 +1,10 @@
1
1
  declare type Options = {
2
- checkingValue?: boolean;
3
- checkingDeprecatedProps?: boolean;
4
- permittedAriaRoles?: boolean;
5
- disallowSetImplicitRole?: boolean;
6
- disallowSetImplicitProps?: boolean;
7
- disallowDefaultValue?: boolean;
2
+ checkingValue?: boolean;
3
+ checkingDeprecatedProps?: boolean;
4
+ permittedAriaRoles?: boolean;
5
+ disallowSetImplicitRole?: boolean;
6
+ disallowSetImplicitProps?: boolean;
7
+ disallowDefaultValue?: boolean;
8
8
  };
9
- declare const _default: import("@markuplint/ml-core").RuleSeed<boolean, Options>;
9
+ declare const _default: import('@markuplint/ml-core').RuleSeed<boolean, Options>;
10
10
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "2.0.0-rc.6",
3
+ "version": "2.0.0",
4
4
  "description": "Rules for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -17,15 +17,15 @@
17
17
  "clean": "tsc --build --clean"
18
18
  },
19
19
  "dependencies": {
20
- "@markuplint/html-spec": "2.0.0-rc.6",
21
- "@markuplint/ml-core": "2.0.0-rc.6",
22
- "@markuplint/ml-spec": "2.0.0-rc.6",
23
- "@markuplint/types": "2.0.0-rc.6",
24
- "debug": "^4.3.2",
20
+ "@markuplint/html-spec": "2.0.0",
21
+ "@markuplint/ml-core": "2.0.0",
22
+ "@markuplint/ml-spec": "2.0.0",
23
+ "@markuplint/types": "2.0.0",
24
+ "debug": "^4.3.3",
25
25
  "tslib": "^2.3.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/debug": "^4.1.7"
29
29
  },
30
- "gitHead": "7c93367a86f935f6b94780b1fa14f3293f900b87"
30
+ "gitHead": "de81fc514acdf472f87184e3499e9364258f9b66"
31
31
  }