zemdomu 1.1.4 โ 1.1.5
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/README.md +41 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
ZemDomu
|
|
1
|
+
# ZemDomu Core
|
|
2
2
|
|
|
3
|
-
Semantic HTML linting engine for clean, accessible
|
|
3
|
+
Semantic HTML linting engine for clean, accessible and SEO-friendly markup. This package provides the shared core logic used by the ZemDomu VS Code extension and upcoming GitHub Action.
|
|
4
4
|
|
|
5
|
+
## ๐ง What is ZemDomu Core?
|
|
5
6
|
|
|
7
|
+
**ZemDomu** is a semantic-first linter that helps developers write better HTML and JSX by catching accessibility and structural issues. It parses `.html`, `.jsx` and `.tsx` files and exposes a simple `lint()` function that returns semantic violations.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ZemDomu is a semantic-first linter that helps developers write better HTML and JSX by catching accessibility and structural issues. This package contains the framework-agnostic linting engine used by other tools in the ZemDomu ecosystem.
|
|
10
|
-
|
|
11
|
-
It parses .html, .jsx, and .tsx content and exposes a simple lint() function that returns semantic violations.
|
|
12
|
-
|
|
13
|
-
๐ Installation
|
|
9
|
+
## ๐ Installation
|
|
14
10
|
|
|
11
|
+
```bash
|
|
15
12
|
npm install zemdomu
|
|
16
13
|
# or
|
|
17
14
|
yarn add zemdomu
|
|
15
|
+
```
|
|
18
16
|
|
|
19
|
-
โจ Features
|
|
20
|
-
|
|
21
|
-
โ
Lint semantic issues in HTML, JSX, and TSX
|
|
22
|
-
|
|
23
|
-
๐ฆ Works in Node.js, CI, or any JS runtime
|
|
24
|
-
|
|
25
|
-
โ๏ธ Extensible rule system
|
|
26
|
-
|
|
27
|
-
๐ Shared by extension and GitHub Action
|
|
17
|
+
## โจ Features
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
- โ
Lint semantic issues in HTML, JSX and TSX
|
|
20
|
+
- ๐ฆ Works in Node.js, CI or any JS runtime
|
|
21
|
+
- โ๏ธ Extensible rule system
|
|
22
|
+
- ๐ Shared by the extension and GitHub Action
|
|
23
|
+
- ๐งช Simple API: `lint(content, options)`
|
|
30
24
|
|
|
31
|
-
โ๏ธ Usage Example
|
|
25
|
+
## โ๏ธ Usage Example
|
|
32
26
|
|
|
27
|
+
```ts
|
|
33
28
|
import { lint } from 'zemdomu';
|
|
34
29
|
|
|
35
30
|
const html = '<img>';
|
|
@@ -48,20 +43,21 @@ console.log(results);
|
|
|
48
43
|
// Custom rules can be supplied via the `customRules` option
|
|
49
44
|
// const myRule = { name: 'demo', checkHtml: () => [] };
|
|
50
45
|
// lint(html, { customRules: [myRule] });
|
|
46
|
+
```
|
|
51
47
|
|
|
52
|
-
๐ API
|
|
48
|
+
## ๐ API
|
|
53
49
|
|
|
54
|
-
lint(content: string, options?: LinterOptions): LintResult[]
|
|
50
|
+
`lint(content: string, options?: LinterOptions): LintResult[]`
|
|
55
51
|
|
|
56
|
-
Parameters
|
|
52
|
+
**Parameters**
|
|
57
53
|
|
|
58
|
-
content โ HTML, JSX
|
|
54
|
+
- `content` โ HTML, JSX or TSX string input
|
|
55
|
+
- `options.rules` โ toggles for built-in rules
|
|
56
|
+
- `options.customRules` โ array of additional rules
|
|
59
57
|
|
|
60
|
-
|
|
61
|
-
options.customRules โ array of additional rules
|
|
62
|
-
|
|
63
|
-
Example LinterOptions
|
|
58
|
+
**Example `LinterOptions`**
|
|
64
59
|
|
|
60
|
+
```ts
|
|
65
61
|
interface LinterOptions {
|
|
66
62
|
rules: {
|
|
67
63
|
requireAltText: boolean;
|
|
@@ -69,44 +65,44 @@ interface LinterOptions {
|
|
|
69
65
|
};
|
|
70
66
|
customRules?: Rule[];
|
|
71
67
|
}
|
|
68
|
+
```
|
|
72
69
|
|
|
73
|
-
Example LintResult
|
|
70
|
+
**Example `LintResult`**
|
|
74
71
|
|
|
72
|
+
```ts
|
|
75
73
|
interface LintResult {
|
|
76
74
|
line: number;
|
|
77
75
|
column: number;
|
|
78
76
|
message: string;
|
|
79
77
|
rule: string;
|
|
80
78
|
}
|
|
79
|
+
```
|
|
81
80
|
|
|
82
|
-
๐ Related Tools
|
|
83
|
-
|
|
84
|
-
ZemDomu VS Code Extension
|
|
81
|
+
## ๐ Related Tools
|
|
85
82
|
|
|
86
|
-
ZemDomu
|
|
83
|
+
- [ZemDomu VS Code Extension](../ZemDomu-Extension)
|
|
84
|
+
- ZemDomu GitHub Action (coming soon)
|
|
87
85
|
|
|
88
|
-
๐ Development
|
|
86
|
+
## ๐ Development
|
|
89
87
|
|
|
88
|
+
```bash
|
|
90
89
|
git clone https://github.com/Zemdomu/ZemDomu-core.git
|
|
91
90
|
cd ZemDomu-core
|
|
92
91
|
npm install
|
|
93
92
|
npm run build
|
|
93
|
+
```
|
|
94
94
|
|
|
95
95
|
Tests and coverage support coming soon.
|
|
96
96
|
|
|
97
|
-
๐ค Contributing
|
|
98
|
-
|
|
99
|
-
We welcome contributions! If you'd like to add rules, improve parsing, or integrate new consumers:
|
|
97
|
+
## ๐ค Contributing
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
We welcome contributions! If you'd like to add rules, improve parsing or integrate new consumers:
|
|
102
100
|
|
|
103
|
-
|
|
101
|
+
1. Fork this repo
|
|
102
|
+
2. Add your logic inside `src/rules` or `src/linter.ts`
|
|
103
|
+
3. Write or update tests (if applicable)
|
|
104
|
+
4. Submit a pull request!
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
Submit a pull request!
|
|
108
|
-
|
|
109
|
-
๐ License
|
|
106
|
+
## ๐ License
|
|
110
107
|
|
|
111
108
|
MIT ยฉ 2025 Zacharias Eryd Berlin
|
|
112
|
-
|