@markuplint/ml-spec 4.0.0-dev.28 → 4.0.0-rc.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2019 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
@@ -5,7 +5,7 @@ export function getExplicitRole(specs,
5
5
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
6
6
  el, version) {
7
7
  const roleValue = el.getAttribute('role');
8
- const roleNames = roleValue?.toLowerCase().trim().split(/\s+/g) ?? [];
8
+ const roleNames = roleValue?.toLowerCase().trim().split(/\s+/) ?? [];
9
9
  const permittedRoles = getPermittedRoles(el, version, specs);
10
10
  const { namespaceURI } = resolveNamespace(el.localName, el.namespaceURI);
11
11
  let error = 'NO_EXPLICIT';
@@ -188,7 +188,7 @@ el) {
188
188
  return false;
189
189
  }
190
190
  // TODO: Improve accuracy
191
- return /display\s*:\s*none|visibility\s*:\s*hidden/gi.test(style);
191
+ return /display\s*:\s*none|visibility\s*:\s*hidden/i.test(style);
192
192
  }
193
193
  function isExposedElement(
194
194
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
@@ -7,7 +7,7 @@ ownedEl, specs, version) {
7
7
  function matchesCondition(condition,
8
8
  // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
9
9
  parentEl, specs, version) {
10
- const conditions = condition.split(/\s+>\s+/g).reverse();
10
+ const conditions = condition.split(/\s+>\s+/).reverse();
11
11
  while (conditions.length > 0) {
12
12
  if (!parentEl) {
13
13
  return false;
@@ -1 +1,3 @@
1
- export declare function isVoidElement(el: Element): boolean;
1
+ export declare function isVoidElement(el: {
2
+ readonly localName: string;
3
+ }): boolean;
@@ -16,8 +16,6 @@ const voidElements = new Set([
16
16
  'track',
17
17
  'wbr',
18
18
  ]);
19
- export function isVoidElement(
20
- // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
21
- el) {
19
+ export function isVoidElement(el) {
22
20
  return voidElements.has(el.localName);
23
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-spec",
3
- "version": "4.0.0-dev.28+0131de5e",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "Types and schema that specs of the Markup languages for markuplint",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -23,22 +23,24 @@
23
23
  "build": "tsc",
24
24
  "dev": "tsc --build --watch",
25
25
  "clean": "tsc --build --clean",
26
- "schema:gen": "ts-node ./gen/gen.ts; prettier --write './schemas/*.json';",
27
- "schema:content-models": "json2ts ./schemas/content-models.schema.json > ./src/types/permitted-structures.ts; prettier --write ./src/types/permitted-structures.ts; eslint --fix --config ../../../.eslintrc ./src/types/permitted-structures.ts",
28
- "schema:attributes": "json2ts ./schemas/attributes.schema.json --cwd ./schemas > ./src/types/attributes.ts; prettier --write ./src/types/attributes.ts; eslint --fix --config ../../../.eslintrc ./src/types/attributes.ts",
29
- "schema:aria": "json2ts ./schemas/aria.schema.json --cwd ./schemas > ./src/types/aria.ts; prettier --write ./src/types/aria.ts; eslint --fix --config ../../../.eslintrc ./src/types/aria.ts",
30
- "schema": "run-s schema:*"
26
+ "schema": "run-s schema:json schema:content-models schema:attributes schema:aria schema:prettier schema:eslint schema:prettier",
27
+ "schema:json": "node --loader ts-node/esm ./gen/gen.ts",
28
+ "schema:content-models": "json2ts ./schemas/content-models.schema.json > ./src/types/permitted-structures.ts",
29
+ "schema:attributes": "json2ts ./schemas/attributes.schema.json --cwd ./schemas > ./src/types/attributes.ts",
30
+ "schema:aria": "json2ts ./schemas/aria.schema.json --cwd ./schemas > ./src/types/aria.ts",
31
+ "schema:eslint": "eslint --fix --config ../../../.eslintrc \"./src/types/*.ts\"",
32
+ "schema:prettier": "prettier --write \"./schemas/*.json\" \"./src/types/*.ts\" --log-level warn"
31
33
  },
32
34
  "dependencies": {
33
- "@markuplint/ml-ast": "4.0.0-dev.28+0131de5e",
34
- "@markuplint/types": "4.0.0-dev.28+0131de5e",
35
+ "@markuplint/ml-ast": "4.0.0-rc.0",
36
+ "@markuplint/types": "4.0.0-rc.0",
35
37
  "dom-accessibility-api": "^0.6.3",
36
38
  "is-plain-object": "^5.0.0",
37
- "type-fest": "^4.5.0"
39
+ "type-fest": "^4.10.2"
38
40
  },
39
41
  "devDependencies": {
40
- "@markuplint/test-tools": "4.0.0-alpha.3",
41
- "json-schema-to-typescript": "13.1.1"
42
+ "@markuplint/test-tools": "4.0.0-rc.0",
43
+ "json-schema-to-typescript": "13.1.2"
42
44
  },
43
- "gitHead": "0131de5ea9dd6d3fd5472d7b414b66644c758881"
45
+ "gitHead": "3fdeb45cb69ed52b3a215a7520cea1181601443f"
44
46
  }