@markuplint/rules 4.0.0-alpha.6 → 4.0.0-alpha.7

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2023 Yusuke Hirao
3
+ Copyright (c) 2017-2024 Yusuke Hirao
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,7 +3,7 @@ import { start } from './start.js';
3
3
  export function contentModel(
4
4
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
5
5
  el, rules, options) {
6
- const model = createModel(el, rules);
6
+ const { model, specs } = createModel(el, rules);
7
7
  if (model == null) {
8
8
  return [
9
9
  {
@@ -14,7 +14,7 @@ el, rules, options) {
14
14
  },
15
15
  ];
16
16
  }
17
- const result = start(model, el, el.ownerMLDocument.specs, options);
17
+ const result = start(model, el, specs, options);
18
18
  return result;
19
19
  }
20
20
  function createModel(
@@ -22,7 +22,10 @@ function createModel(
22
22
  el, rules) {
23
23
  const specs = cachedSpecs(el.ownerMLDocument.specs, rules);
24
24
  const model = getContentModel(el, specs.specs);
25
- return model;
25
+ return {
26
+ model,
27
+ specs,
28
+ };
26
29
  }
27
30
  const caches = new Map();
28
31
  function cachedSpecs(specs, rules) {
@@ -1,5 +1,5 @@
1
- /// <reference types="debug" />
2
- export declare const cmLog: import("debug").Debugger;
1
+ import type { Log } from '../debug.js';
2
+ export declare const cmLog: Log;
3
3
  export declare const bgGreen: {
4
4
  (): void;
5
5
  bold(): void;
@@ -1,6 +1,6 @@
1
- /// <reference types="debug" />
1
+ import type { Log } from '../debug.js';
2
2
  import color from 'ansi-colors';
3
- export declare const cmLog: import("debug").Debugger;
3
+ export declare const cmLog: Log;
4
4
  export declare const bgGreen: color.StyleFunction;
5
5
  export declare const green: color.StyleFunction;
6
6
  export declare const bgRed: color.StyleFunction;
@@ -7,9 +7,6 @@ export default createRule({
7
7
  },
8
8
  async verify({ document, report, t }) {
9
9
  await document.walkOn('Element', el => {
10
- if (el.pretenderContext?.type === 'pretender') {
11
- return;
12
- }
13
10
  if (accnameMayBeMutable(el, document)) {
14
11
  return;
15
12
  }
@@ -75,7 +75,7 @@ export const checkingRequiredOwnedElements = ({ el, role }) => t => {
75
75
  if (mayBeBeforeCreated(el)) {
76
76
  return {
77
77
  scope: el,
78
- message: t('{0}. Or, {1}', t('require {0}', role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0]
78
+ message: t('{0}. Or, {1}', t('{0} requires {1}', t('the {0}', 'child element'), role.requiredOwnedElements.length === 1 && role.requiredOwnedElements[0]
79
79
  ? t('the "{0*}" {1}', role.requiredOwnedElements[0], 'role')
80
80
  : t('the {0}', 'roles') + `: ${t(role.requiredOwnedElements)}`), t('require {0}', 'aria-busy="true"')),
81
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "4.0.0-alpha.6",
3
+ "version": "4.0.0-alpha.7",
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,18 +25,18 @@
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.6",
29
- "@markuplint/ml-core": "4.0.0-alpha.6",
30
- "@markuplint/ml-spec": "4.0.0-alpha.6",
31
- "@markuplint/selector": "4.0.0-alpha.6",
32
- "@markuplint/shared": "4.0.0-alpha.6",
33
- "@markuplint/types": "4.0.0-alpha.6",
28
+ "@markuplint/html-spec": "4.0.0-alpha.7",
29
+ "@markuplint/ml-core": "4.0.0-alpha.7",
30
+ "@markuplint/ml-spec": "4.0.0-alpha.7",
31
+ "@markuplint/selector": "4.0.0-alpha.7",
32
+ "@markuplint/shared": "4.0.0-alpha.7",
33
+ "@markuplint/types": "4.0.0-alpha.7",
34
34
  "@types/debug": "^4.1.12",
35
35
  "@ungap/structured-clone": "^1.2.0",
36
36
  "ansi-colors": "^4.1.3",
37
- "chrono-node": "^2.7.3",
37
+ "chrono-node": "^2.7.4",
38
38
  "debug": "^4.3.4",
39
- "type-fest": "^4.8.2"
39
+ "type-fest": "^4.9.0"
40
40
  },
41
- "gitHead": "06e1242d274c72cf08a10a572b06ac35d1b924a4"
41
+ "gitHead": "571129bf6498541125e1e7c3907d5ed9af53459a"
42
42
  }