@jpeakai/mermaidjs-lint 0.4.1 → 0.4.2
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/dist/bin.js +3 -1
- package/dist/index.js +3 -1
- package/dist/testing.js +2 -0
- package/package.json +1 -1
- package/src/check.ts +3 -1
package/dist/bin.js
CHANGED
|
@@ -9,7 +9,7 @@ import { parseArgs } from "node:util";
|
|
|
9
9
|
// package.json
|
|
10
10
|
var package_default = {
|
|
11
11
|
name: "@jpeakai/mermaidjs-lint",
|
|
12
|
-
version: "0.4.
|
|
12
|
+
version: "0.4.2",
|
|
13
13
|
type: "module",
|
|
14
14
|
description: "Deterministic lint gates and verified fixers for Mermaid diagrams in markdown",
|
|
15
15
|
license: "MIT",
|
|
@@ -1843,6 +1843,8 @@ var optionsFor = (rule, configured, flags) => {
|
|
|
1843
1843
|
if (value !== undefined && rule.options?.[name])
|
|
1844
1844
|
options[name] = value;
|
|
1845
1845
|
}
|
|
1846
|
+
if (typeof options.preset === "string")
|
|
1847
|
+
options.preset = canonicalPreset(options.preset) ?? options.preset;
|
|
1846
1848
|
return options;
|
|
1847
1849
|
};
|
|
1848
1850
|
var checkModel = async (doc, file, flags = {}, registry = BUILTIN) => {
|
package/dist/index.js
CHANGED
|
@@ -1765,6 +1765,8 @@ var optionsFor = (rule, configured, flags) => {
|
|
|
1765
1765
|
if (value !== undefined && rule.options?.[name])
|
|
1766
1766
|
options[name] = value;
|
|
1767
1767
|
}
|
|
1768
|
+
if (typeof options.preset === "string")
|
|
1769
|
+
options.preset = canonicalPreset(options.preset) ?? options.preset;
|
|
1768
1770
|
return options;
|
|
1769
1771
|
};
|
|
1770
1772
|
var checkModel = async (doc, file, flags = {}, registry = BUILTIN) => {
|
|
@@ -1781,7 +1783,7 @@ import { parseArgs } from "node:util";
|
|
|
1781
1783
|
// package.json
|
|
1782
1784
|
var package_default = {
|
|
1783
1785
|
name: "@jpeakai/mermaidjs-lint",
|
|
1784
|
-
version: "0.4.
|
|
1786
|
+
version: "0.4.2",
|
|
1785
1787
|
type: "module",
|
|
1786
1788
|
description: "Deterministic lint gates and verified fixers for Mermaid diagrams in markdown",
|
|
1787
1789
|
license: "MIT",
|
package/dist/testing.js
CHANGED
|
@@ -1662,6 +1662,8 @@ var optionsFor = (rule, configured, flags) => {
|
|
|
1662
1662
|
if (value !== undefined && rule.options?.[name])
|
|
1663
1663
|
options[name] = value;
|
|
1664
1664
|
}
|
|
1665
|
+
if (typeof options.preset === "string")
|
|
1666
|
+
options.preset = canonicalPreset(options.preset) ?? options.preset;
|
|
1665
1667
|
return options;
|
|
1666
1668
|
};
|
|
1667
1669
|
var checkModel = async (doc, file, flags = {}, registry = BUILTIN) => {
|
package/package.json
CHANGED
package/src/check.ts
CHANGED
|
@@ -35,13 +35,15 @@ export const checkRunFlags = (flags: RunFlags, prefix = ""): void => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// The options a rule runs with: its configured options, then a flag for any
|
|
38
|
-
// option the rule declares.
|
|
38
|
+
// option the rule declares. A preset reaches the rule by its canonical name,
|
|
39
|
+
// so a plugin rule never has to resolve an alias such as `high` or `H`.
|
|
39
40
|
export const optionsFor = (rule: Rule, configured: RuleOptions | undefined, flags: RunFlags): RuleOptions => {
|
|
40
41
|
const options: Record<string, unknown> = { ...configured };
|
|
41
42
|
for (const name of ["preset", "profile"] as const) {
|
|
42
43
|
const value = flags[name];
|
|
43
44
|
if (value !== undefined && rule.options?.[name]) options[name] = value;
|
|
44
45
|
}
|
|
46
|
+
if (typeof options.preset === "string") options.preset = canonicalPreset(options.preset) ?? options.preset;
|
|
45
47
|
return options;
|
|
46
48
|
};
|
|
47
49
|
|