@markuplint/rules 4.0.0-alpha.7 → 4.0.0-alpha.8
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-duplication/index.js +3 -0
- package/lib/attr-value-quotes/index.js +3 -0
- package/lib/case-sensitive-attr-name/index.js +3 -0
- package/lib/case-sensitive-tag-name/index.js +3 -0
- package/lib/character-reference/index.js +3 -0
- package/lib/class-naming/index.js +3 -0
- package/lib/deprecated-attr/index.js +3 -0
- package/lib/deprecated-element/index.js +3 -0
- package/lib/disallowed-element/index.js +3 -0
- package/lib/doctype/index.js +3 -0
- package/lib/end-tag/index.js +3 -0
- package/lib/id-duplication/index.js +3 -0
- package/lib/ineffective-attr/index.js +3 -0
- package/lib/invalid-attr/index.js +3 -0
- package/lib/label-has-control/index.js +3 -0
- package/lib/landmark-roles/index.js +3 -0
- package/lib/no-boolean-attr-value/index.js +3 -0
- package/lib/no-default-value/index.js +3 -0
- package/lib/no-empty-palpable-content/index.js +3 -0
- package/lib/no-hard-code-id/index.js +3 -0
- package/lib/no-refer-to-non-existent-id/index.js +3 -0
- package/lib/no-use-event-handler-attr/index.js +3 -0
- package/lib/permitted-contents/index.js +3 -0
- package/lib/placeholder-label-option/index.js +3 -0
- package/lib/require-accessible-name/index.js +3 -0
- package/lib/require-datetime/index.js +3 -0
- package/lib/required-attr/index.js +3 -0
- package/lib/required-element/index.js +3 -0
- package/lib/required-h1/index.js +3 -0
- package/lib/use-list/index.js +3 -0
- package/lib/wai-aria/index.js +3 -0
- package/package.json +8 -8
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
export default createRule({
|
|
3
|
+
meta: {
|
|
4
|
+
category: 'validation',
|
|
5
|
+
},
|
|
3
6
|
async verify({ document, report, t }) {
|
|
4
7
|
const message = t('{0} is {1:c}', t('the {0}', 'attribute name'), 'duplicated');
|
|
5
8
|
await document.walkOn('Element', node => {
|
|
@@ -2,6 +2,9 @@ import { createRule, getLocationFromChars } from '@markuplint/ml-core';
|
|
|
2
2
|
const defaultChars = ['"', '&', '<', '>'];
|
|
3
3
|
const ignoreParentElement = new Set(['script', 'style']);
|
|
4
4
|
export default createRule({
|
|
5
|
+
meta: {
|
|
6
|
+
category: 'style',
|
|
7
|
+
},
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
const targetNodes = [];
|
|
7
10
|
await document.walkOn('Text', node => {
|
|
@@ -2,6 +2,9 @@ import { createRule } from '@markuplint/ml-core';
|
|
|
2
2
|
import { toNoEmptyStringArrayFromStringOrArray } from '@markuplint/shared';
|
|
3
3
|
import { match } from '../helpers.js';
|
|
4
4
|
export default createRule({
|
|
5
|
+
meta: {
|
|
6
|
+
category: 'naming-convention',
|
|
7
|
+
},
|
|
5
8
|
defaultSeverity: 'warning',
|
|
6
9
|
defaultValue: null,
|
|
7
10
|
async verify({ document, report, t }) {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createRule, getAttrSpecs } from '@markuplint/ml-core';
|
|
2
2
|
export default createRule({
|
|
3
|
+
meta: {
|
|
4
|
+
category: 'validation',
|
|
5
|
+
},
|
|
3
6
|
async verify({ document, report, t }) {
|
|
4
7
|
await document.walkOn('Attr', attr => {
|
|
5
8
|
const attrSpecs = getAttrSpecs(attr.ownerElement, document.specs);
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createRule, getSpec } from '@markuplint/ml-core';
|
|
2
2
|
export default createRule({
|
|
3
|
+
meta: {
|
|
4
|
+
category: 'validation',
|
|
5
|
+
},
|
|
3
6
|
async verify({ document, report, t }) {
|
|
4
7
|
await document.walkOn('Element', el => {
|
|
5
8
|
if (!(el.namespaceURI === 'http://www.w3.org/1999/xhtml' ||
|
package/lib/doctype/index.js
CHANGED
package/lib/end-tag/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
import { isVoidElement } from '@markuplint/ml-spec';
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'style',
|
|
6
|
+
},
|
|
4
7
|
defaultSeverity: 'warning',
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
if (document.endTag === 'never') {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
export default createRule({
|
|
3
|
+
meta: {
|
|
4
|
+
category: 'validation',
|
|
5
|
+
},
|
|
3
6
|
async verify({ document, report, t }) {
|
|
4
7
|
const message = t('{0} is {1:c}', t('{0} of {1}', t('the {0}', 'value'), t('the "{0*}" {1}', 'id', 'attribute')), 'duplicated');
|
|
5
8
|
const idStack = [];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule, getAttrSpecs } from '@markuplint/ml-core';
|
|
2
2
|
import { toNoEmptyStringArrayFromStringOrArray } from '@markuplint/shared';
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'style',
|
|
6
|
+
},
|
|
4
7
|
defaultSeverity: 'warning',
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
await document.walkOn('Attr', attr => {
|
|
@@ -4,6 +4,9 @@ import { log as ruleLog } from '../debug.js';
|
|
|
4
4
|
import { isValidAttr, match } from '../helpers.js';
|
|
5
5
|
const log = ruleLog.extend('invalid-attr');
|
|
6
6
|
export default createRule({
|
|
7
|
+
meta: {
|
|
8
|
+
category: 'validation',
|
|
9
|
+
},
|
|
7
10
|
defaultOptions: {},
|
|
8
11
|
async verify({ document, report, t }) {
|
|
9
12
|
await document.walkOn('Attr', attr => {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
const controlSelector = ["input:not([type='hidden' i])", 'select', 'textarea'].join(',');
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'a11y',
|
|
6
|
+
},
|
|
4
7
|
defaultSeverity: 'warning',
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
await document.walkOn('Element', el => {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule, getAttrSpecs } from '@markuplint/ml-core';
|
|
2
2
|
import { toNormalizedValue } from '../helpers.js';
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'style',
|
|
6
|
+
},
|
|
4
7
|
defaultSeverity: 'warning',
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
await document.walkOn('Attr', attr => {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule } from '@markuplint/ml-core';
|
|
2
2
|
import { isNothingContentModel, isPalpableElement } from '@markuplint/ml-spec';
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'validation',
|
|
6
|
+
},
|
|
4
7
|
defaultSeverity: 'warning',
|
|
5
8
|
defaultOptions: {
|
|
6
9
|
extendsExposableElements: true,
|
|
@@ -3,6 +3,9 @@ import { ARIA_RECOMMENDED_VERSION } from '@markuplint/ml-spec';
|
|
|
3
3
|
import { decodeEntities, decodeHref } from '@markuplint/shared';
|
|
4
4
|
const HYPERLINK_SELECTOR = 'a[href], area[href]';
|
|
5
5
|
export default createRule({
|
|
6
|
+
meta: {
|
|
7
|
+
category: 'a11y',
|
|
8
|
+
},
|
|
6
9
|
defaultOptions: {
|
|
7
10
|
ariaVersion: ARIA_RECOMMENDED_VERSION,
|
|
8
11
|
fragmentRefersNameAttr: false,
|
|
@@ -2,6 +2,9 @@ import { createRule } from '@markuplint/ml-core';
|
|
|
2
2
|
import { contentModel } from './content-model.js';
|
|
3
3
|
import { transparentMode } from './represent-transparent-nodes.js';
|
|
4
4
|
export default createRule({
|
|
5
|
+
meta: {
|
|
6
|
+
category: 'validation',
|
|
7
|
+
},
|
|
5
8
|
defaultValue: [],
|
|
6
9
|
defaultOptions: {
|
|
7
10
|
ignoreHasMutableChildren: true,
|
|
@@ -2,6 +2,9 @@ import { createRule, getRoleSpec, getComputedRole } from '@markuplint/ml-core';
|
|
|
2
2
|
import { ARIA_RECOMMENDED_VERSION, isExposed } from '@markuplint/ml-spec';
|
|
3
3
|
import { accnameMayBeMutable } from '../helpers.js';
|
|
4
4
|
export default createRule({
|
|
5
|
+
meta: {
|
|
6
|
+
category: 'a11y',
|
|
7
|
+
},
|
|
5
8
|
defaultOptions: {
|
|
6
9
|
ariaVersion: ARIA_RECOMMENDED_VERSION,
|
|
7
10
|
},
|
|
@@ -2,6 +2,9 @@ import { createRule } from '@markuplint/ml-core';
|
|
|
2
2
|
import { check } from '@markuplint/types';
|
|
3
3
|
import { getCandidateDatetimeString } from './utils.js';
|
|
4
4
|
export default createRule({
|
|
5
|
+
meta: {
|
|
6
|
+
category: 'validation',
|
|
7
|
+
},
|
|
5
8
|
defaultOptions: {
|
|
6
9
|
langs: undefined,
|
|
7
10
|
},
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRule, getAttrSpecs } from '@markuplint/ml-core';
|
|
2
2
|
import { attrMatches, match } from '../helpers.js';
|
|
3
3
|
export default createRule({
|
|
4
|
+
meta: {
|
|
5
|
+
category: 'validation',
|
|
6
|
+
},
|
|
4
7
|
defaultValue: [],
|
|
5
8
|
async verify({ document, report, t }) {
|
|
6
9
|
await document.walkOn('Element', el => {
|
package/lib/required-h1/index.js
CHANGED
package/lib/use-list/index.js
CHANGED
package/lib/wai-aria/index.js
CHANGED
|
@@ -16,6 +16,9 @@ import { checkingRequiredOwnedElements } from './checkings/required-owned-elemen
|
|
|
16
16
|
import { checkingRequiredProp } from './checkings/required-prop.js';
|
|
17
17
|
import { checkingValue } from './checkings/value.js';
|
|
18
18
|
export default createRule({
|
|
19
|
+
meta: {
|
|
20
|
+
category: 'a11y',
|
|
21
|
+
},
|
|
19
22
|
defaultOptions: {
|
|
20
23
|
checkingValue: true,
|
|
21
24
|
checkingDeprecatedProps: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/rules",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.8",
|
|
4
4
|
"description": "Built-in rules of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@markuplint/html-spec": "4.0.0-alpha.
|
|
29
|
-
"@markuplint/ml-core": "4.0.0-alpha.
|
|
30
|
-
"@markuplint/ml-spec": "4.0.0-alpha.
|
|
31
|
-
"@markuplint/selector": "4.0.0-alpha.
|
|
32
|
-
"@markuplint/shared": "4.0.0-alpha.
|
|
33
|
-
"@markuplint/types": "4.0.0-alpha.
|
|
28
|
+
"@markuplint/html-spec": "4.0.0-alpha.8",
|
|
29
|
+
"@markuplint/ml-core": "4.0.0-alpha.8",
|
|
30
|
+
"@markuplint/ml-spec": "4.0.0-alpha.8",
|
|
31
|
+
"@markuplint/selector": "4.0.0-alpha.8",
|
|
32
|
+
"@markuplint/shared": "4.0.0-alpha.8",
|
|
33
|
+
"@markuplint/types": "4.0.0-alpha.8",
|
|
34
34
|
"@types/debug": "^4.1.12",
|
|
35
35
|
"@ungap/structured-clone": "^1.2.0",
|
|
36
36
|
"ansi-colors": "^4.1.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"debug": "^4.3.4",
|
|
39
39
|
"type-fest": "^4.9.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "5bcd25f13ff804af0d09aaabd87e495af668e6a8"
|
|
42
42
|
}
|