@markuplint/rules 4.9.3 → 4.9.4

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/CHANGELOG.md CHANGED
@@ -3,16 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.9.3](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.2...@markuplint/rules@4.9.3) (2024-06-25)
6
+ ## [4.9.4](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.3...@markuplint/rules@4.9.4) (2024-09-02)
7
7
 
8
+ **Note:** Version bump only for package @markuplint/rules
8
9
 
9
- ### Bug Fixes
10
10
 
11
- * **ml-core:** `localName` returns lowercase when using case-sensitive parser for tag names ([b1acadd](https://github.com/markuplint/markuplint/commit/b1acaddfd6bf939ee809f6419ce85a701033ca4f))
12
11
 
13
12
 
14
13
 
14
+ ## [4.9.3](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.2...@markuplint/rules@4.9.3) (2024-06-25)
15
+
16
+ ### Bug Fixes
15
17
 
18
+ - **ml-core:** `localName` returns lowercase when using case-sensitive parser for tag names ([b1acadd](https://github.com/markuplint/markuplint/commit/b1acaddfd6bf939ee809f6419ce85a701033ca4f))
16
19
 
17
20
  ## [4.9.2](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.9.1...@markuplint/rules@4.9.2) (2024-06-09)
18
21
 
@@ -224,7 +224,7 @@ function createExpectedObject(type, matches, t) {
224
224
  ? null
225
225
  : 1 < expectedObject.length
226
226
  ? t('either {0}', t(expectedObject))
227
- : expectedObject[0] ?? null;
227
+ : (expectedObject[0] ?? null);
228
228
  return expects;
229
229
  }
230
230
  function expectValueToWord(t, expect, type) {
package/lib/helpers.js CHANGED
@@ -67,7 +67,7 @@ node, attrSpecs,
67
67
  log) {
68
68
  let invalid = false;
69
69
  const spec = attrSpecs.find(s => s.name.toLowerCase() === name.toLowerCase());
70
- log && log('Spec of the %s attr: %o', name, spec);
70
+ log?.('Spec of the %s attr: %o', name, spec);
71
71
  invalid = attrCheck(t, name, value, false, spec);
72
72
  if (invalid === false &&
73
73
  spec &&
@@ -22,7 +22,6 @@ childNodes, specs, options, depth) {
22
22
  let prevResult = null;
23
23
  let barelyResult = null;
24
24
  let loopCount = 0;
25
- // eslint-disable-next-line no-constant-condition
26
25
  while (true) {
27
26
  loopCount++;
28
27
  ptLog('Check#%s: %s', loopCount, collection);
@@ -88,7 +87,7 @@ childNodes, specs, options, depth) {
88
87
  result.type === 'MISSING_NODE_ONE_OR_MORE' ||
89
88
  result.type === 'TRANSPARENT_MODEL_DISALLOWS'
90
89
  ? result.type
91
- : missingType ?? 'MISSING_NODE_REQUIRED';
90
+ : (missingType ?? 'MISSING_NODE_REQUIRED');
92
91
  ptLog('%s(in %s); Needs %s', resultType, missingType, result.query);
93
92
  return compereResult({
94
93
  type: resultType,
@@ -1,7 +1,6 @@
1
1
  import color from 'ansi-colors';
2
2
  import { log } from '../debug.js';
3
3
  export const cmLog = log.extend('content-model');
4
- /* eslint-disable import/no-named-as-default-member */
5
4
  export const bgGreen = color.bgGreen;
6
5
  export const green = color.green;
7
6
  export const bgRed = color.bgRed;
@@ -9,4 +8,3 @@ export const bgBlue = color.bgBlue;
9
8
  export const blue = color.blue;
10
9
  export const bgMagenta = color.bgMagenta;
11
10
  export const cyan = color.cyan;
12
- /* eslint-enable import/no-named-as-default-member */
@@ -55,7 +55,7 @@ el, specs, options) {
55
55
  type: result.type,
56
56
  scope: result.type === 'MISSING_NODE_REQUIRED' || result.type === 'MISSING_NODE_ONE_OR_MORE'
57
57
  ? el
58
- : result.unmatched[0] ?? el,
58
+ : (result.unmatched[0] ?? el),
59
59
  query: result.query,
60
60
  hint: result.hint,
61
61
  },
@@ -16,7 +16,7 @@ export declare function isZeroOrMore(content: ReadonlyDeep<PermittedContentPatte
16
16
  export declare function isChoice(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentChoice>;
17
17
  export declare function isTransparent(content: ReadonlyDeep<PermittedContentPattern>): content is ReadonlyDeep<PermittedContentTransparent>;
18
18
  export declare function normalizeModel(pattern: ReadonlyDeep<PermittedContentRequire> | ReadonlyDeep<PermittedContentOptional> | ReadonlyDeep<PermittedContentOneOrMore> | ReadonlyDeep<PermittedContentZeroOrMore>): {
19
- model: ReadonlyDeep<PermittedContentPattern[] | Model>;
19
+ model: ReadonlyDeep<Model | PermittedContentPattern[]>;
20
20
  min: number;
21
21
  max: number;
22
22
  repeat: RepeatSign;
@@ -31,7 +31,7 @@ export declare function mergeHints(a: Readonly<Hints>, b: Readonly<Hints>): Part
31
31
  not?: ChildNode;
32
32
  transparent?: import("./types.js").Element;
33
33
  }>;
34
- export declare function cleanObject<T extends Object>(object: T): Partial<T>;
34
+ export declare function cleanObject<T extends object>(object: T): Partial<T>;
35
35
  export declare class Collection {
36
36
  #private;
37
37
  constructor(origin: readonly ChildNode[]);
@@ -40,7 +40,7 @@ node, specs) {
40
40
  };
41
41
  }
42
42
  const not = selectorResult
43
- .flatMap(r => (r.matched ? [] : r.not ?? []))
43
+ .flatMap(r => (r.matched ? [] : (r.not ?? [])))
44
44
  .flatMap(descendants)
45
45
  .shift();
46
46
  return {
@@ -17,7 +17,7 @@ export const checkingRequiredProp = ({ el, role, propSpecs }) => t => {
17
17
  const elAriaSpec = getARIA(el.ownerMLDocument.specs, el.localName, el.namespaceURI, el.rule.options.version, el.matches.bind(el));
18
18
  const alt = elAriaSpec?.properties === false
19
19
  ? null
20
- : elAriaSpec?.properties?.without?.find(p => p.name === requiredProp)?.alt ?? null;
20
+ : (elAriaSpec?.properties?.without?.find(p => p.name === requiredProp)?.alt ?? null);
21
21
  if (alt?.method === 'set-attr' && el.hasAttribute(alt.target)) {
22
22
  return;
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/rules",
3
- "version": "4.9.3",
3
+ "version": "4.9.4",
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.8.2",
29
- "@markuplint/ml-core": "4.8.2",
30
- "@markuplint/ml-spec": "4.6.3",
31
- "@markuplint/selector": "4.6.5",
32
- "@markuplint/shared": "4.4.3",
33
- "@markuplint/types": "4.5.3",
28
+ "@markuplint/html-spec": "4.9.0",
29
+ "@markuplint/ml-core": "4.8.3",
30
+ "@markuplint/ml-spec": "4.6.4",
31
+ "@markuplint/selector": "4.6.6",
32
+ "@markuplint/shared": "4.4.4",
33
+ "@markuplint/types": "4.5.4",
34
34
  "@types/debug": "4.1.12",
35
35
  "@ungap/structured-clone": "1.2.0",
36
36
  "ansi-colors": "4.1.3",
37
37
  "chrono-node": "2.7.6",
38
- "debug": "4.3.5",
39
- "type-fest": "4.20.1"
38
+ "debug": "4.3.6",
39
+ "type-fest": "4.26.0"
40
40
  },
41
- "gitHead": "05fdca254661ec335ff0cae4c6a11db164b032b9"
41
+ "gitHead": "77cd5a25d5cf28c83253b7bfe02cd25b54e236b0"
42
42
  }
package/.eslintrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "rules": {
3
- "import/no-default-export": 0
4
- }
5
- }