@markuplint/rules
Advanced tools
Comparing version 4.0.0-dev.10 to 4.0.0-dev.12
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
async verify({ document, report, t }) { | ||
@@ -4,0 +7,0 @@ const message = t('{0} is {1:c}', t('the {0}', 'attribute name'), 'duplicated'); |
@@ -7,2 +7,5 @@ import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -30,3 +33,2 @@ defaultValue: 'double', | ||
attr.startQuote.fix(quote); | ||
// TODO: attr.endQuote = new MLToken(quote); | ||
attr.endQuote?.fix(quote); | ||
@@ -33,0 +35,0 @@ } |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -4,0 +7,0 @@ defaultValue: 'lower', |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -4,0 +7,0 @@ defaultValue: 'lower', |
@@ -5,2 +5,5 @@ import { createRule, getLocationFromChars } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
async verify({ document, report, t }) { | ||
@@ -7,0 +10,0 @@ const targetNodes = []; |
@@ -5,2 +5,5 @@ import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'naming-convention', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -7,0 +10,0 @@ defaultValue: null, |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
async verify({ document, report, t }) { | ||
@@ -4,0 +7,0 @@ await document.walkOn('Attr', attr => { |
import { createRule, getSpec } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
async verify({ document, report, t }) { | ||
@@ -4,0 +7,0 @@ await document.walkOn('Element', el => { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultValue: [], | ||
@@ -4,0 +7,0 @@ async verify({ document, report, t }) { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultValue: 'always', | ||
@@ -4,0 +7,0 @@ defaultOptions: { |
import { createRule } from '@markuplint/ml-core'; | ||
import { isVoidElement } from '@markuplint/ml-spec'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ async verify({ document, report, t }) { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
async verify({ document, report, t }) { | ||
@@ -4,0 +7,0 @@ const message = t('{0} is {1:c}', t('{0} of {1}', t('the {0}', 'value'), t('the "{0*}" {1}', 'id', 'attribute')), 'duplicated'); |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
import { toNoEmptyStringArrayFromStringOrArray } from '@markuplint/shared'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ async verify({ document, report, t }) { |
@@ -7,2 +7,5 @@ import { createRule, getAttrSpecs, getSpec } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultOptions: {}, | ||
@@ -9,0 +12,0 @@ async verify({ document, report, t }) { |
import { createRule } from '@markuplint/ml-core'; | ||
const controlSelector = ["input:not([type='hidden' i])", 'select', 'textarea'].join(','); | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ async verify({ document, report, t }) { |
@@ -13,2 +13,5 @@ import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -15,0 +18,0 @@ defaultOptions: { |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -4,0 +7,0 @@ async verify({ document, report, t }) { |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
import { toNormalizedValue } from '../helpers.js'; | ||
export default createRule({ | ||
meta: { | ||
category: 'style', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ async verify({ document, report, t }) { |
import { createRule } from '@markuplint/ml-core'; | ||
import { isNothingContentModel, isPalpableElement } from '@markuplint/ml-spec'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ defaultOptions: { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'maintainability', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -4,0 +7,0 @@ async verify({ document, report, t }) { |
@@ -6,2 +6,5 @@ import { createRule, getAttrSpecs, ariaSpecs } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultOptions: { | ||
@@ -8,0 +11,0 @@ ariaVersion: ARIA_RECOMMENDED_VERSION, |
import { createRule } from '@markuplint/ml-core'; | ||
import { match } from '../helpers.js'; | ||
export default createRule({ | ||
meta: { | ||
category: 'maintainability', | ||
}, | ||
defaultSeverity: 'warning', | ||
@@ -5,0 +8,0 @@ defaultOptions: {}, |
@@ -6,3 +6,3 @@ import { getContentModel } from '@markuplint/ml-spec'; | ||
el, rules, options) { | ||
const model = createModel(el, rules); | ||
const { model, specs } = createModel(el, rules); | ||
if (model == null) { | ||
@@ -18,3 +18,3 @@ return [ | ||
} | ||
const result = start(model, el, el.ownerMLDocument.specs, options); | ||
const result = start(model, el, specs, options); | ||
return result; | ||
@@ -27,3 +27,6 @@ } | ||
const model = getContentModel(el, specs.specs); | ||
return model; | ||
return { | ||
model, | ||
specs, | ||
}; | ||
} | ||
@@ -30,0 +33,0 @@ const caches = new Map(); |
@@ -5,2 +5,5 @@ import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultValue: [], | ||
@@ -7,0 +10,0 @@ defaultOptions: { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
verify({ document, report, t }) { | ||
@@ -4,0 +7,0 @@ for (const select of document.querySelectorAll('select')) { |
@@ -5,2 +5,5 @@ import { createRule, getRoleSpec, getComputedRole } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultOptions: { | ||
@@ -11,5 +14,2 @@ ariaVersion: ARIA_RECOMMENDED_VERSION, | ||
await document.walkOn('Element', el => { | ||
if (el.pretenderContext?.type === 'pretender') { | ||
return; | ||
} | ||
if (accnameMayBeMutable(el, document)) { | ||
@@ -16,0 +16,0 @@ return; |
@@ -5,2 +5,5 @@ import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultOptions: { | ||
@@ -7,0 +10,0 @@ langs: undefined, |
import { createRule, getAttrSpecs } from '@markuplint/ml-core'; | ||
import { attrMatches, match } from '../helpers.js'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultValue: [], | ||
@@ -5,0 +8,0 @@ async verify({ document, report, t }) { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'validation', | ||
}, | ||
defaultValue: [], | ||
@@ -4,0 +7,0 @@ defaultOptions: { |
import { createRule } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultOptions: { | ||
@@ -4,0 +7,0 @@ 'expected-once': true, |
import { createRule } from '@markuplint/ml-core'; | ||
import { decodeEntities } from '@markuplint/shared'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultValue: [ | ||
@@ -5,0 +8,0 @@ /** |
@@ -78,3 +78,3 @@ import { getComputedRole, isRequiredOwnedElement } from '@markuplint/ml-spec'; | ||
scope: el, | ||
message: t('{0}. Or, {1}', t('require {0}', role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0] | ||
message: t('{0}. Or, {1}', t('{0} requires {1}', t('the {0}', 'child element'), role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0] | ||
? t('the "{0*}" {1}', role.requiredOwnedElements[0], 'role') | ||
@@ -81,0 +81,0 @@ : t('the {0}', 'roles') + `: ${t(role.requiredOwnedElements)}`), t('require {0}', 'aria-busy="true"')), |
@@ -19,2 +19,5 @@ import { createRule, getAttrSpecs, getComputedRole, ariaSpecs, getSpec } from '@markuplint/ml-core'; | ||
export default createRule({ | ||
meta: { | ||
category: 'a11y', | ||
}, | ||
defaultOptions: { | ||
@@ -21,0 +24,0 @@ checkingValue: true, |
{ | ||
"name": "@markuplint/rules", | ||
"version": "4.0.0-dev.10+b28398ab", | ||
"version": "4.0.0-dev.12+2275fbeb0", | ||
"description": "Built-in rules of markuplint", | ||
@@ -28,16 +28,16 @@ "repository": "git@github.com:markuplint/markuplint.git", | ||
"dependencies": { | ||
"@markuplint/html-spec": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/ml-core": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/ml-spec": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/selector": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/shared": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/types": "4.0.0-dev.10+b28398ab", | ||
"@markuplint/html-spec": "4.0.0-dev.12+2275fbeb0", | ||
"@markuplint/ml-core": "4.0.0-dev.12+2275fbeb0", | ||
"@markuplint/ml-spec": "4.0.0-dev.12+2275fbeb0", | ||
"@markuplint/selector": "4.0.0-dev.12+2275fbeb0", | ||
"@markuplint/shared": "4.0.0-dev.12+2275fbeb0", | ||
"@markuplint/types": "4.0.0-dev.12+2275fbeb0", | ||
"@types/debug": "^4.1.12", | ||
"@ungap/structured-clone": "^1.2.0", | ||
"ansi-colors": "^4.1.3", | ||
"chrono-node": "^2.7.3", | ||
"chrono-node": "^2.7.5", | ||
"debug": "^4.3.4", | ||
"type-fest": "^4.8.3" | ||
"type-fest": "^4.9.0" | ||
}, | ||
"gitHead": "b28398ab9c8f0ad790f2915ad5da8f3a80e9b8d6" | ||
"gitHead": "2275fbeb053605b636f080f4fafd7cd4fc57a9a3" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
199018
5073
Updatedchrono-node@^2.7.5
Updatedtype-fest@^4.9.0