@contextlint/core 0.1.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 +21 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.d.ts +12 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +56 -0
- package/dist/parser.js.map +1 -0
- package/dist/registry.d.ts +3 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +22 -0
- package/dist/registry.js.map +1 -0
- package/dist/rule.d.ts +26 -0
- package/dist/rule.d.ts.map +1 -0
- package/dist/rule.js +16 -0
- package/dist/rule.js.map +1 -0
- package/dist/rules/sec-001.d.ts +6 -0
- package/dist/rules/sec-001.d.ts.map +1 -0
- package/dist/rules/sec-001.js +19 -0
- package/dist/rules/sec-001.js.map +1 -0
- package/dist/rules/str-001.d.ts +6 -0
- package/dist/rules/str-001.d.ts.map +1 -0
- package/dist/rules/str-001.js +23 -0
- package/dist/rules/str-001.js.map +1 -0
- package/dist/rules/tbl-001.d.ts +6 -0
- package/dist/rules/tbl-001.d.ts.map +1 -0
- package/dist/rules/tbl-001.js +21 -0
- package/dist/rules/tbl-001.js.map +1 -0
- package/dist/rules/tbl-002.d.ts +6 -0
- package/dist/rules/tbl-002.d.ts.map +1 -0
- package/dist/rules/tbl-002.js +25 -0
- package/dist/rules/tbl-002.js.map +1 -0
- package/dist/rules/tbl-003.d.ts +7 -0
- package/dist/rules/tbl-003.d.ts.map +1 -0
- package/dist/rules/tbl-003.js +25 -0
- package/dist/rules/tbl-003.js.map +1 -0
- package/dist/rules/tbl-004.d.ts +7 -0
- package/dist/rules/tbl-004.d.ts.map +1 -0
- package/dist/rules/tbl-004.js +26 -0
- package/dist/rules/tbl-004.js.map +1 -0
- package/package.json +29 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nozomi Koborinai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { parseDocument } from "./parser.js";
|
|
2
|
+
export type { ParsedTable, ParsedDocument } from "./parser.js";
|
|
3
|
+
export { runRules } from "./rule.js";
|
|
4
|
+
export type { Severity, LintMessage, RuleContext, Rule, RunOptions, } from "./rule.js";
|
|
5
|
+
export { tbl001 } from "./rules/tbl-001.js";
|
|
6
|
+
export type { Tbl001Options } from "./rules/tbl-001.js";
|
|
7
|
+
export { tbl002 } from "./rules/tbl-002.js";
|
|
8
|
+
export type { Tbl002Options } from "./rules/tbl-002.js";
|
|
9
|
+
export { tbl003 } from "./rules/tbl-003.js";
|
|
10
|
+
export type { Tbl003Options } from "./rules/tbl-003.js";
|
|
11
|
+
export { str001 } from "./rules/str-001.js";
|
|
12
|
+
export type { Str001Options } from "./rules/str-001.js";
|
|
13
|
+
export { sec001 } from "./rules/sec-001.js";
|
|
14
|
+
export type { Sec001Options } from "./rules/sec-001.js";
|
|
15
|
+
export { tbl004 } from "./rules/tbl-004.js";
|
|
16
|
+
export type { Tbl004Options } from "./rules/tbl-004.js";
|
|
17
|
+
export { resolveRule } from "./registry.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,YAAY,EACV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,IAAI,EACJ,UAAU,GACX,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { parseDocument } from "./parser.js";
|
|
2
|
+
export { runRules } from "./rule.js";
|
|
3
|
+
export { tbl001 } from "./rules/tbl-001.js";
|
|
4
|
+
export { tbl002 } from "./rules/tbl-002.js";
|
|
5
|
+
export { tbl003 } from "./rules/tbl-003.js";
|
|
6
|
+
export { str001 } from "./rules/str-001.js";
|
|
7
|
+
export { sec001 } from "./rules/sec-001.js";
|
|
8
|
+
export { tbl004 } from "./rules/tbl-004.js";
|
|
9
|
+
export { resolveRule } from "./registry.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AASrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ParsedTable {
|
|
2
|
+
line: number;
|
|
3
|
+
section: string | null;
|
|
4
|
+
headers: string[];
|
|
5
|
+
rows: Record<string, string>[];
|
|
6
|
+
}
|
|
7
|
+
export interface ParsedDocument {
|
|
8
|
+
tables: ParsedTable[];
|
|
9
|
+
sections: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function parseDocument(content: string): ParsedDocument;
|
|
12
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAgBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CA8C7D"}
|
package/dist/parser.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { unified } from "unified";
|
|
2
|
+
import remarkParse from "remark-parse";
|
|
3
|
+
import remarkGfm from "remark-gfm";
|
|
4
|
+
import { visit } from "unist-util-visit";
|
|
5
|
+
function extractText(node) {
|
|
6
|
+
if (node.type === "text") {
|
|
7
|
+
return node.value;
|
|
8
|
+
}
|
|
9
|
+
if ("children" in node) {
|
|
10
|
+
return node.children.map(extractText).join("");
|
|
11
|
+
}
|
|
12
|
+
return "";
|
|
13
|
+
}
|
|
14
|
+
function extractCellText(row) {
|
|
15
|
+
return row.children.map((cell) => extractText(cell).trim());
|
|
16
|
+
}
|
|
17
|
+
export function parseDocument(content) {
|
|
18
|
+
const tree = unified().use(remarkParse).use(remarkGfm).parse(content);
|
|
19
|
+
const headings = [];
|
|
20
|
+
const tables = [];
|
|
21
|
+
visit(tree, "heading", (node) => {
|
|
22
|
+
headings.push({
|
|
23
|
+
text: extractText(node),
|
|
24
|
+
line: node.position?.start.line ?? 0,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
visit(tree, "table", (node) => {
|
|
28
|
+
const tableLine = node.position?.start.line ?? 0;
|
|
29
|
+
const [headerRow, ...dataRows] = node.children;
|
|
30
|
+
if (!headerRow)
|
|
31
|
+
return;
|
|
32
|
+
const headers = extractCellText(headerRow);
|
|
33
|
+
const rows = dataRows.map((row) => {
|
|
34
|
+
const cells = extractCellText(row);
|
|
35
|
+
const record = {};
|
|
36
|
+
headers.forEach((header, i) => {
|
|
37
|
+
record[header] = cells[i] ?? "";
|
|
38
|
+
});
|
|
39
|
+
return record;
|
|
40
|
+
});
|
|
41
|
+
// Find the nearest heading above this table
|
|
42
|
+
let section = null;
|
|
43
|
+
for (let i = headings.length - 1; i >= 0; i--) {
|
|
44
|
+
if (headings[i].line < tableLine) {
|
|
45
|
+
section = headings[i].text;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
tables.push({ line: tableLine, section, headers, rows });
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
tables,
|
|
53
|
+
sections: headings.map((h) => h.text),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAgBzC,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAK,IAAa,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACnC,OAAQ,IAAa,CAAC,KAAK,CAAC;IAC9B,CAAC;IACD,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,OAAQ,IAA6B,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,QAAQ,GAAqC,EAAE,CAAC;IACtD,MAAM,MAAM,GAAkB,EAAE,CAAC;IAEjC,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,IAAa,EAAE,EAAE;QACvC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;YACvB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC;SACrC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,IAAW,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/C,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,MAAM,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC;QAE3C,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,MAAM,KAAK,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC5B,MAAM,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,4CAA4C;QAC5C,IAAI,OAAO,GAAkB,IAAI,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9C,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,EAAE,CAAC;gBACjC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBAC3B,MAAM;YACR,CAAC;QACH,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,MAAM;QACN,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAyBtC,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,IAAI,CAMN"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { tbl001 } from "./rules/tbl-001.js";
|
|
2
|
+
import { tbl002 } from "./rules/tbl-002.js";
|
|
3
|
+
import { tbl003 } from "./rules/tbl-003.js";
|
|
4
|
+
import { tbl004 } from "./rules/tbl-004.js";
|
|
5
|
+
import { str001 } from "./rules/str-001.js";
|
|
6
|
+
import { sec001 } from "./rules/sec-001.js";
|
|
7
|
+
const registry = {
|
|
8
|
+
tbl001: (options) => tbl001(options),
|
|
9
|
+
tbl002: (options) => tbl002(options),
|
|
10
|
+
tbl003: (options) => tbl003(options),
|
|
11
|
+
tbl004: (options) => tbl004(options),
|
|
12
|
+
str001: (options) => str001(options),
|
|
13
|
+
sec001: (options) => sec001(options),
|
|
14
|
+
};
|
|
15
|
+
export function resolveRule(name, options) {
|
|
16
|
+
const factory = registry[name];
|
|
17
|
+
if (!factory) {
|
|
18
|
+
throw new Error(`Unknown rule: "${name}"`);
|
|
19
|
+
}
|
|
20
|
+
return factory(options);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,MAAM,QAAQ,GAAgC;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAAwC,CAAC;IAClD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAA6C,CAAC;IACvD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAA+C,CAAC;IACzD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAA8C,CAAC;IACxD,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAA8B,CAAC;IACxC,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAClB,MAAM,CAAC,OAAiC,CAAC;CAC5C,CAAC;AAEF,MAAM,UAAU,WAAW,CACzB,IAAY,EACZ,OAAiC;IAEjC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/rule.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ParsedDocument } from "./parser.js";
|
|
2
|
+
export type Severity = "error" | "warning";
|
|
3
|
+
export interface LintMessage {
|
|
4
|
+
ruleId: string;
|
|
5
|
+
severity: Severity;
|
|
6
|
+
message: string;
|
|
7
|
+
line: number;
|
|
8
|
+
}
|
|
9
|
+
export interface RuleContext {
|
|
10
|
+
document: ParsedDocument;
|
|
11
|
+
filePath: string;
|
|
12
|
+
projectFiles?: string[];
|
|
13
|
+
report: (msg: Omit<LintMessage, "ruleId">) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface Rule {
|
|
16
|
+
id: string;
|
|
17
|
+
description: string;
|
|
18
|
+
severity: Severity;
|
|
19
|
+
scope?: "document" | "project";
|
|
20
|
+
check: (context: RuleContext) => void;
|
|
21
|
+
}
|
|
22
|
+
export interface RunOptions {
|
|
23
|
+
projectFiles?: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function runRules(rules: Rule[], document: ParsedDocument, filePath: string, options?: RunOptions): LintMessage[];
|
|
26
|
+
//# sourceMappingURL=rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../src/rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,KAAK,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,UAAU,GACnB,WAAW,EAAE,CAgBf"}
|
package/dist/rule.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function runRules(rules, document, filePath, options) {
|
|
2
|
+
const messages = [];
|
|
3
|
+
for (const rule of rules) {
|
|
4
|
+
const context = {
|
|
5
|
+
document,
|
|
6
|
+
filePath,
|
|
7
|
+
projectFiles: options?.projectFiles,
|
|
8
|
+
report: (msg) => {
|
|
9
|
+
messages.push({ ruleId: rule.id, ...msg });
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
rule.check(context);
|
|
13
|
+
}
|
|
14
|
+
return messages;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=rule.js.map
|
package/dist/rule.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule.js","sourceRoot":"","sources":["../src/rule.ts"],"names":[],"mappings":"AA8BA,MAAM,UAAU,QAAQ,CACtB,KAAa,EACb,QAAwB,EACxB,QAAgB,EAChB,OAAoB;IAEpB,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAgB;YAC3B,QAAQ;YACR,QAAQ;YACR,YAAY,EAAE,OAAO,EAAE,YAAY;YACnC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;gBACd,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;YAC7C,CAAC;SACF,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sec-001.d.ts","sourceRoot":"","sources":["../../src/rules/sec-001.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAiBnD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function sec001(options) {
|
|
2
|
+
return {
|
|
3
|
+
id: "SEC-001",
|
|
4
|
+
description: "Required sections must exist in the document",
|
|
5
|
+
severity: "error",
|
|
6
|
+
check: (context) => {
|
|
7
|
+
for (const section of options.sections) {
|
|
8
|
+
if (!context.document.sections.includes(section)) {
|
|
9
|
+
context.report({
|
|
10
|
+
severity: "error",
|
|
11
|
+
message: `Missing required section "${section}"`,
|
|
12
|
+
line: 0,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=sec-001.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sec-001.js","sourceRoot":"","sources":["../../src/rules/sec-001.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACvC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBACjD,OAAO,CAAC,MAAM,CAAC;wBACb,QAAQ,EAAE,OAAO;wBACjB,OAAO,EAAE,6BAA6B,OAAO,GAAG;wBAChD,IAAI,EAAE,CAAC;qBACR,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"str-001.d.ts","sourceRoot":"","sources":["../../src/rules/str-001.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAsBnD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function str001(options) {
|
|
2
|
+
return {
|
|
3
|
+
id: "STR-001",
|
|
4
|
+
description: "Required files must exist in the project",
|
|
5
|
+
severity: "error",
|
|
6
|
+
scope: "project",
|
|
7
|
+
check: (context) => {
|
|
8
|
+
if (!context.projectFiles) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
for (const file of options.files) {
|
|
12
|
+
if (!context.projectFiles.includes(file)) {
|
|
13
|
+
context.report({
|
|
14
|
+
severity: "error",
|
|
15
|
+
message: `Required file "${file}" not found`,
|
|
16
|
+
line: 0,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=str-001.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"str-001.js","sourceRoot":"","sources":["../../src/rules/str-001.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,0CAA0C;QACvD,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACzC,OAAO,CAAC,MAAM,CAAC;wBACb,QAAQ,EAAE,OAAO;wBACjB,OAAO,EAAE,kBAAkB,IAAI,aAAa;wBAC5C,IAAI,EAAE,CAAC;qBACR,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-001.d.ts","sourceRoot":"","sources":["../../src/rules/tbl-001.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAmBnD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function tbl001(options) {
|
|
2
|
+
return {
|
|
3
|
+
id: "TBL-001",
|
|
4
|
+
description: "Required columns must exist in tables",
|
|
5
|
+
severity: "error",
|
|
6
|
+
check: (context) => {
|
|
7
|
+
for (const table of context.document.tables) {
|
|
8
|
+
for (const col of options.requiredColumns) {
|
|
9
|
+
if (!table.headers.includes(col)) {
|
|
10
|
+
context.report({
|
|
11
|
+
severity: "error",
|
|
12
|
+
message: `Missing required column "${col}" in table`,
|
|
13
|
+
line: table.line,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=tbl-001.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-001.js","sourceRoot":"","sources":["../../src/rules/tbl-001.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,uCAAuC;QACpD,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;oBAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;wBACjC,OAAO,CAAC,MAAM,CAAC;4BACb,QAAQ,EAAE,OAAO;4BACjB,OAAO,EAAE,4BAA4B,GAAG,YAAY;4BACpD,IAAI,EAAE,KAAK,CAAC,IAAI;yBACjB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-002.d.ts","sourceRoot":"","sources":["../../src/rules/tbl-002.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,wBAAgB,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAyBpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function tbl002(options) {
|
|
2
|
+
return {
|
|
3
|
+
id: "TBL-002",
|
|
4
|
+
description: "Table cells must not be empty",
|
|
5
|
+
severity: "warning",
|
|
6
|
+
check: (context) => {
|
|
7
|
+
for (const table of context.document.tables) {
|
|
8
|
+
const targetColumns = options?.columns?.filter((c) => table.headers.includes(c)) ??
|
|
9
|
+
table.headers;
|
|
10
|
+
for (const row of table.rows) {
|
|
11
|
+
for (const col of targetColumns) {
|
|
12
|
+
if (!row[col] || row[col].trim() === "") {
|
|
13
|
+
context.report({
|
|
14
|
+
severity: "warning",
|
|
15
|
+
message: `Empty cell in column "${col}"`,
|
|
16
|
+
line: table.line,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tbl-002.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-002.js","sourceRoot":"","sources":["../../src/rules/tbl-002.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,MAAM,CAAC,OAAuB;IAC5C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,+BAA+B;QAC5C,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,MAAM,aAAa,GACjB,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;oBAC1D,KAAK,CAAC,OAAO,CAAC;gBAEhB,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;oBAC7B,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;wBAChC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;4BACxC,OAAO,CAAC,MAAM,CAAC;gCACb,QAAQ,EAAE,SAAS;gCACnB,OAAO,EAAE,yBAAyB,GAAG,GAAG;gCACxC,IAAI,EAAE,KAAK,CAAC,IAAI;6BACjB,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-003.d.ts","sourceRoot":"","sources":["../../src/rules/tbl-003.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAwBnD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function tbl003(options) {
|
|
2
|
+
return {
|
|
3
|
+
id: "TBL-003",
|
|
4
|
+
description: "Cell values must be from an allowed list",
|
|
5
|
+
severity: "error",
|
|
6
|
+
check: (context) => {
|
|
7
|
+
for (const table of context.document.tables) {
|
|
8
|
+
if (!table.headers.includes(options.column)) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
for (const row of table.rows) {
|
|
12
|
+
const value = row[options.column];
|
|
13
|
+
if (value && !options.values.includes(value)) {
|
|
14
|
+
context.report({
|
|
15
|
+
severity: "error",
|
|
16
|
+
message: `Invalid value "${value}" in column "${options.column}". Allowed: ${options.values.join(", ")}`,
|
|
17
|
+
line: table.line,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=tbl-003.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-003.js","sourceRoot":"","sources":["../../src/rules/tbl-003.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,0CAA0C;QACvD,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5C,SAAS;gBACX,CAAC;gBAED,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;oBAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBAClC,IAAI,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;wBAC7C,OAAO,CAAC,MAAM,CAAC;4BACb,QAAQ,EAAE,OAAO;4BACjB,OAAO,EAAE,kBAAkB,KAAK,gBAAgB,OAAO,CAAC,MAAM,eAAe,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;4BACxG,IAAI,EAAE,KAAK,CAAC,IAAI;yBACjB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-004.d.ts","sourceRoot":"","sources":["../../src/rules/tbl-004.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CA0BnD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function tbl004(options) {
|
|
2
|
+
const regex = new RegExp(options.pattern);
|
|
3
|
+
return {
|
|
4
|
+
id: "TBL-004",
|
|
5
|
+
description: "Cell values must match the specified pattern",
|
|
6
|
+
severity: "error",
|
|
7
|
+
check: (context) => {
|
|
8
|
+
for (const table of context.document.tables) {
|
|
9
|
+
if (!table.headers.includes(options.column)) {
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
for (const row of table.rows) {
|
|
13
|
+
const value = row[options.column];
|
|
14
|
+
if (value && !regex.test(value)) {
|
|
15
|
+
context.report({
|
|
16
|
+
severity: "error",
|
|
17
|
+
message: `Value "${value}" in column "${options.column}" does not match pattern "${options.pattern}"`,
|
|
18
|
+
line: table.line,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=tbl-004.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tbl-004.js","sourceRoot":"","sources":["../../src/rules/tbl-004.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C,OAAO;QACL,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,8CAA8C;QAC3D,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE;YACjB,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC5C,SAAS;gBACX,CAAC;gBAED,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;oBAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBAClC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;wBAChC,OAAO,CAAC,MAAM,CAAC;4BACb,QAAQ,EAAE,OAAO;4BACjB,OAAO,EAAE,UAAU,KAAK,gBAAgB,OAAO,CAAC,MAAM,6BAA6B,OAAO,CAAC,OAAO,GAAG;4BACrG,IAAI,EAAE,KAAK,CAAC,IAAI;yBACjB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contextlint/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Rule engine and Markdown table parser for contextlint",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"remark-gfm": "^4.0.1",
|
|
17
|
+
"remark-parse": "^11.0.0",
|
|
18
|
+
"unified": "^11.0.5",
|
|
19
|
+
"unist-util-visit": "^5.1.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/mdast": "^4.0.4",
|
|
23
|
+
"@types/unist": "^3.0.3"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
}
|
|
29
|
+
}
|