rintenki 0.13.0 → 0.14.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/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # rintenki
2
2
 
3
- A fast HTML linter powered by html5ever + napi-rs.
3
+ A fast HTML linter powered by [html5ever](https://github.com/servo/html5ever) + [napi-rs](https://napi.rs/).
4
4
 
5
- The name "rintenki" comes from the Japanese word "輪転機" (rintenki), meaning a rotary printing press — a machine that prints large volumes at high speed. The name was chosen because "lint" and "rint" (輪転) sound alike, and like a rotary press that rapidly inspects and produces printed pages, rintenki quickly scans and checks your HTML.
5
+ The name "rintenki" comes from the Japanese word "輪転機" (rintenki), meaning a rotary printing press. Like a rotary press that rapidly inspects and produces printed pages, rintenki quickly scans and checks your HTML.
6
6
 
7
7
  ## Features
8
8
 
9
- - Parsing by html5ever (Rust)
10
- - Node.js native binding via napi-rs
11
- - 78 built-in rules
12
- - CLI / API / VS Code extension / LSP server
13
- - Auto-fix with `--fix`
14
- - JSON output for CI integration
15
- - Per-rule severity customization (error / warning / off)
16
- - Vue / JSX / eRuby support via parser plugins
9
+ - 78 built-in rules based on the [HTML Living Standard](https://html.spec.whatwg.org/)
10
+ - Rust-powered parsing via html5ever with Node.js bindings
11
+ - CLI with `--fix`, `--watch`, `--format json/sarif`
12
+ - VS Code extension with real-time linting, Quick Fix, and status bar
13
+ - LSP server for editor integration
14
+ - Vue / JSX / eRuby / Astro support via parser plugins
15
+ - Per-rule severity customization and inline disable comments
16
+ - JSON Schema for `.rintenkirc.json` editor completion
17
17
 
18
18
  ## Install
19
19
 
@@ -21,10 +21,13 @@ The name "rintenki" comes from the Japanese word "輪転機" (rintenki), meaning
21
21
  npm install rintenki
22
22
  ```
23
23
 
24
- ## CLI
24
+ ## Usage
25
25
 
26
26
  ```bash
27
27
  npx rintenki "src/**/*.html"
28
+ npx rintenki --fix "src/**/*.html"
29
+ npx rintenki --format json "src/**/*.html"
30
+ npx rintenki --watch "src/**/*.html"
28
31
  ```
29
32
 
30
33
  ### Options
@@ -35,35 +38,11 @@ rintenki [options] <files...>
35
38
  -c, --config <path> Path to config file (default: .rintenkirc.json)
36
39
  -f, --format <format> Output format: stylish (default), json, sarif
37
40
  --fix Auto-fix fixable rules
41
+ -w, --watch Watch files for changes and re-lint
38
42
  --max-warnings <number> Exit with error if warnings exceed this number
39
43
  -h, --help Show help
40
44
  ```
41
45
 
42
- ### Examples
43
-
44
- ```bash
45
- # Basic usage
46
- rintenki "src/**/*.html"
47
-
48
- # JSON output
49
- rintenki --format json "src/**/*.html"
50
-
51
- # Auto-fix
52
- rintenki --fix "src/**/*.html"
53
-
54
- # Custom config
55
- rintenki --config custom.json "src/**/*.html"
56
-
57
- # Vue files
58
- rintenki "src/**/*.vue"
59
-
60
- # JSX/TSX files
61
- rintenki "src/**/*.tsx"
62
-
63
- # eRuby files
64
- rintenki "app/views/**/*.erb"
65
- ```
66
-
67
46
  ## API
68
47
 
69
48
  ```js
@@ -82,22 +61,15 @@ Place `.rintenkirc.json` in your project root:
82
61
 
83
62
  ```json
84
63
  {
85
- "parser": {
86
- ".vue": "@rintenki/vue-parser"
87
- },
88
64
  "rules": {
89
65
  "doctype": "error",
90
66
  "no-consecutive-br": "warning",
91
- "no-hard-code-id": "off",
92
- "required-attr": true,
93
- "end-tag": false
67
+ "no-hard-code-id": "off"
94
68
  },
95
69
  "ignore": ["dist/**", "vendor/**"]
96
70
  }
97
71
  ```
98
72
 
99
- ### Severity
100
-
101
73
  | Value | Description |
102
74
  |-------|-------------|
103
75
  | `"error"` | Report as error (exit code 1) |
@@ -105,74 +77,86 @@ Place `.rintenkirc.json` in your project root:
105
77
  | `"off"` / `false` | Disable the rule |
106
78
  | `true` | Use default severity |
107
79
 
108
- ### Ignore
80
+ ### Ignore Patterns
109
81
 
110
- Use a `.rintenkiignore` file or the `ignore` field in config to exclude files by glob pattern. `node_modules` is always excluded automatically.
82
+ Use a `.rintenkiignore` file or the `ignore` field in config. `node_modules` is always excluded.
111
83
 
112
- ## Parser Plugins
84
+ ### Inline Disable Comments
113
85
 
114
- rintenki supports non-HTML files via optional parser plugins.
86
+ ```html
87
+ <!-- rintenki-disable-next-line required-attr -->
88
+ <img src="photo.jpg">
89
+
90
+ <img src="photo.jpg"> <!-- rintenki-disable-line -->
91
+ ```
92
+
93
+ ## Parser Plugins
115
94
 
116
95
  | Plugin | Syntax | Install |
117
96
  |--------|--------|---------|
118
- | `@rintenki/vue-parser` | Vue SFC (`.vue`) | `npm install @rintenki/vue-parser` |
119
- | `@rintenki/jsx-parser` | JSX/TSX (`.jsx`, `.tsx`) | `npm install @rintenki/jsx-parser` |
120
- | `@rintenki/erb-parser` | eRuby (`.erb`) | `npm install @rintenki/erb-parser` |
121
- | `@rintenki/astro-parser` | Astro (`.astro`) | `npm install @rintenki/astro-parser` |
97
+ | [@rintenki/vue-parser](https://www.npmjs.com/package/@rintenki/vue-parser) | Vue SFC (`.vue`) | `npm i @rintenki/vue-parser` |
98
+ | [@rintenki/jsx-parser](https://www.npmjs.com/package/@rintenki/jsx-parser) | JSX/TSX (`.jsx`, `.tsx`) | `npm i @rintenki/jsx-parser` |
99
+ | [@rintenki/erb-parser](https://www.npmjs.com/package/@rintenki/erb-parser) | eRuby (`.erb`) | `npm i @rintenki/erb-parser` |
100
+ | [@rintenki/astro-parser](https://www.npmjs.com/package/@rintenki/astro-parser) | Astro (`.astro`) | `npm i @rintenki/astro-parser` |
122
101
 
123
- Parsers are auto-detected from installed packages, or can be explicitly configured in `.rintenkirc.json`.
102
+ Parsers are auto-detected from installed packages, or configured explicitly:
124
103
 
125
- ### How It Works
126
-
127
- - **Vue**: Extracts `<template>` block via `@vue/compiler-sfc`, masks `{{ }}` interpolations
128
- - **JSX/TSX**: Parses AST via `oxc-parser` (Rust), extracts HTML elements, maps React attributes (`className` → `class`)
129
- - **eRuby**: Masks `<% %>` tags with same-length placeholders, preserving line numbers
130
- - **Astro**: Strips frontmatter (`---...---`), masks `{expression}` with nested brace support
104
+ ```json
105
+ {
106
+ "parser": {
107
+ ".vue": "@rintenki/vue-parser"
108
+ }
109
+ }
110
+ ```
131
111
 
132
112
  ## Rules
133
113
 
114
+ 78 rules across 5 categories. Rules marked with a wrench (🔧) are auto-fixable with `--fix`.
115
+
134
116
  ### Conformance Checking
135
117
 
136
118
  | Rule | Default | Description |
137
119
  |------|---------|-------------|
138
120
  | `attr-duplication` | error | Detect duplicate attributes |
121
+ | `attr-value-quotes` 🔧 | warning | Detect unquoted attribute values |
139
122
  | `colspan-rowspan-range` | error | Validate colspan (1-1000) and rowspan (0-65534) ranges |
140
- | `deprecated-attr` | error | Detect deprecated or obsolete attributes |
141
- | `deprecated-element` | error | Detect deprecated or obsolete elements |
123
+ | `deprecated-attr` | error | Detect deprecated attributes |
124
+ | `deprecated-element` | error | Detect deprecated elements |
142
125
  | `disallowed-element` | off | Detect disallowed elements |
143
- | `doctype` | error | Detect missing DOCTYPE declaration |
126
+ | `doctype` 🔧 | error | Require DOCTYPE declaration |
144
127
  | `empty-title` | error | Detect empty title element |
128
+ | `end-tag` | warning | Detect missing end tags |
145
129
  | `form-dup-name` | warning | Detect duplicate form control names |
146
130
  | `header-footer-nesting` | error | Detect header/footer/main nesting inside header or footer |
147
131
  | `heading-levels` | error | Detect skipped heading levels |
148
- | `id-duplication` | error | Detect duplicate id attribute values |
149
- | `input-attr-applicability` | warning | Detect attributes that do not apply to the input type |
132
+ | `id-duplication` | error | Detect duplicate id values |
133
+ | `input-attr-applicability` | warning | Detect attributes that don't apply to the input type |
150
134
  | `invalid-attr` | error | Detect attributes not in the spec |
135
+ | `link-constraints` | error | Validate link element attribute constraints |
151
136
  | `meta-constraints` | error | Validate meta element attribute constraints |
152
137
  | `no-duplicate-base` | error | Detect multiple base or title elements |
153
138
  | `no-duplicate-dt` | error | Detect duplicate dt names in dl |
139
+ | `no-duplicate-in-head` | error | Detect duplicate charset/viewport/description meta |
154
140
  | `no-empty-palpable-content` | warning | Detect empty palpable content elements |
141
+ | `no-implicit-button-type` | warning | Require explicit type on button |
155
142
  | `no-nested-forms` | error | Detect nested form elements |
156
- | `no-non-scalable-viewport` | error | Detect user-scalable=no in viewport meta |
157
143
  | `no-nested-interactive` | error | Detect interactive content inside a or button |
158
- | `no-orphaned-end-tag` | error | Detect end tags without matching start tags |
144
+ | `no-non-scalable-viewport` | error | Detect user-scalable=no in viewport meta |
145
+ | `no-orphaned-end-tag` | error | Detect unmatched closing tags |
159
146
  | `no-tabindex-on-dialog` | error | Detect tabindex on dialog elements |
160
147
  | `obsolete-but-conforming` | warning | Detect obsolete but conforming features |
161
148
  | `permitted-contents` | error | Detect children not permitted by the spec |
162
149
  | `picture-structure` | error | Validate picture element structure |
163
150
  | `placeholder-label-option` | warning | Detect missing placeholder option in required select |
164
- | `require-datetime` | error | Detect missing datetime attribute on time element |
151
+ | `require-datetime` | error | Require datetime attribute on time element |
165
152
  | `require-meta-charset` | off | Require meta charset declaration |
166
153
  | `required-attr` | error | Detect missing required attributes |
167
154
  | `required-element` | error | Detect missing required child elements |
155
+ | `script-type` | error | Validate script type attribute values |
156
+ | `src-not-empty` | error | Detect empty src or href attributes |
168
157
  | `summary-first-child` | error | Require summary as first child of details |
169
158
  | `th-content-restrictions` | error | Detect disallowed elements inside th |
170
159
  | `unique-main` | error | Require at most one visible main element |
171
- | `link-constraints` | error | Validate link element attribute constraints |
172
- | `no-duplicate-in-head` | error | Detect duplicate charset/viewport/description meta |
173
- | `no-implicit-button-type` | warning | Require explicit type on button elements |
174
- | `script-type` | error | Validate script type attribute values |
175
- | `src-not-empty` | error | Detect empty src or href attributes |
176
160
  | `valid-attr-value` | error | Validate enumerated attribute values |
177
161
  | `valid-autocomplete` | warning | Validate autocomplete attribute values |
178
162
  | `valid-id` | error | Require valid id values (non-empty, no whitespace) |
@@ -186,10 +170,10 @@ Parsers are auto-detected from installed packages, or can be explicitly configur
186
170
  | `aria-attr-conflicts` | error | Detect conflicting ARIA and native HTML attributes |
187
171
  | `aria-attr-valid-values` | warning | Validate ARIA attribute values |
188
172
  | `aria-hidden-focusable` | error | Detect aria-hidden on focusable elements |
189
- | `aria-naming-prohibited` | error | Detect aria-label on elements where naming is prohibited |
190
- | `aria-role-conflicts` | warning | Detect conflicts between explicit role and implicit role |
173
+ | `aria-naming-prohibited` | error | Detect aria-label on naming-prohibited elements |
174
+ | `aria-role-conflicts` | warning | Detect conflicts between explicit and implicit role |
191
175
  | `empty-heading` | warning | Detect empty heading elements |
192
- | `label-has-control` | error | Detect label elements without associated control |
176
+ | `label-has-control` | error | Detect label without associated control |
193
177
  | `landmark-roles` | warning | Detect nested landmark roles |
194
178
  | `neighbor-popovers` | off | Detect non-adjacent popover triggers and targets |
195
179
  | `no-abstract-role` | error | Detect abstract ARIA roles |
@@ -197,15 +181,15 @@ Parsers are auto-detected from installed packages, or can be explicitly configur
197
181
  | `no-aria-hidden-body` | error | Detect aria-hidden on body element |
198
182
  | `no-consecutive-br` | warning | Detect consecutive br elements |
199
183
  | `no-dup-class` | warning | Detect duplicate class names |
200
- | `no-redundant-role` | warning | Detect redundant explicit ARIA roles |
201
- | `no-role-on-meta-elements` | error | Detect role/aria-* on meta elements |
202
184
  | `no-positive-tabindex` | warning | Detect positive tabindex values |
185
+ | `no-redundant-role` | warning | Detect redundant explicit ARIA roles |
203
186
  | `no-refer-to-non-existent-id` | error | Detect references to non-existent ids |
204
- | `require-accessible-name` | error | Detect missing accessible names |
205
- | `required-h1` | error | Detect missing h1 element |
187
+ | `no-role-on-meta-elements` | error | Detect role/aria-* on meta elements |
188
+ | `require-accessible-name` | error | Require accessible name on interactive elements |
189
+ | `required-h1` | error | Require h1 element |
206
190
  | `table-row-column-alignment` | warning | Detect inconsistent table column counts |
207
191
  | `use-list` | warning | Suggest list elements for bullet-prefixed text |
208
- | `wai-aria` | error | Detect invalid WAI-ARIA roles and attributes |
192
+ | `wai-aria` | error | Validate WAI-ARIA roles and attributes |
209
193
 
210
194
  ### Naming Convention
211
195
 
@@ -225,72 +209,33 @@ Parsers are auto-detected from installed packages, or can be explicitly configur
225
209
 
226
210
  | Rule | Default | Description |
227
211
  |------|---------|-------------|
228
- | `attr-value-quotes` | warning | Detect unquoted attribute values |
229
- | `case-sensitive-attr-name` | warning | Detect uppercase attribute names |
230
- | `case-sensitive-tag-name` | warning | Detect uppercase tag names |
231
- | `character-reference` | warning | Detect unescaped `&` characters |
232
- | `end-tag` | warning | Detect missing end tags |
233
- | `ineffective-attr` | warning | Detect attributes with no effect on element |
234
- | `no-boolean-attr-value` | warning | Detect values on boolean attributes |
235
- | `no-default-value` | warning | Detect attributes set to their default value |
236
-
237
- ### Auto-fixable Rules
238
-
239
- The following rules can be auto-fixed with `--fix`:
240
-
241
- - `attr-value-quotes`
242
- - `case-sensitive-attr-name`
243
- - `case-sensitive-tag-name`
244
- - `character-reference`
245
- - `doctype`
246
- - `no-boolean-attr-value`
247
- - `no-default-value`
248
-
249
- ## VS Code Extension
250
-
251
- The `packages/rintenki-vscode` package provides a VS Code extension with real-time linting and Quick Fix support via the LSP server.
252
-
253
- ### Development
254
-
255
- ```bash
256
- pnpm build # Build all packages
257
- code . # Open project root in VS Code
258
- # Press F5 to launch Extension Development Host
259
- ```
260
-
261
- ### Settings
262
-
263
- ```json
264
- {
265
- "rintenki.rules": {
266
- "case-sensitive-attr-name": "off",
267
- "no-hard-code-id": "warning"
268
- }
269
- }
270
- ```
212
+ | `case-sensitive-attr-name` 🔧 | warning | Detect uppercase attribute names |
213
+ | `case-sensitive-tag-name` 🔧 | warning | Detect uppercase tag names |
214
+ | `character-reference` 🔧 | warning | Detect unescaped `&` characters |
215
+ | `ineffective-attr` | warning | Detect attributes with no effect |
216
+ | `no-boolean-attr-value` 🔧 | warning | Detect values on boolean attributes |
217
+ | `no-default-value` 🔧 | warning | Detect attributes set to their default value |
271
218
 
272
219
  ## Packages
273
220
 
274
221
  | Package | Description |
275
222
  |---------|-------------|
276
- | `rintenki` | Linter core (Rust + napi-rs) |
277
- | `rintenki-lsp-server` | LSP server |
278
- | `rintenki-vscode` | VS Code extension |
279
- | `@rintenki/parser-utils` | Shared parser interface |
280
- | `@rintenki/vue-parser` | Vue SFC parser plugin |
281
- | `@rintenki/jsx-parser` | JSX/TSX parser plugin |
282
- | `@rintenki/erb-parser` | eRuby parser plugin |
283
- | `@rintenki/astro-parser` | Astro parser plugin |
223
+ | [rintenki](https://www.npmjs.com/package/rintenki) | Linter core (Rust + napi-rs) |
224
+ | [rintenki-lsp-server](https://www.npmjs.com/package/rintenki-lsp-server) | LSP server |
225
+ | [rintenki-vscode](https://marketplace.visualstudio.com/items?itemName=kzhrk.rintenki-vscode) | VS Code extension |
226
+ | [@rintenki/parser-utils](https://www.npmjs.com/package/@rintenki/parser-utils) | Shared parser interface |
227
+ | [@rintenki/vue-parser](https://www.npmjs.com/package/@rintenki/vue-parser) | Vue SFC parser |
228
+ | [@rintenki/jsx-parser](https://www.npmjs.com/package/@rintenki/jsx-parser) | JSX/TSX parser |
229
+ | [@rintenki/erb-parser](https://www.npmjs.com/package/@rintenki/erb-parser) | eRuby parser |
230
+ | [@rintenki/astro-parser](https://www.npmjs.com/package/@rintenki/astro-parser) | Astro parser |
284
231
 
285
232
  ## Supported Platforms
286
233
 
287
- - macOS (arm64, x64)
288
- - Linux (x64, arm64)
289
- - Windows (x64, arm64)
234
+ macOS (arm64) / Linux (x64) / Windows (x64)
290
235
 
291
236
  ## Inspired by
292
237
 
293
- - [markuplint](https://markuplint.dev/) — The rule set design is inspired by markuplint.
238
+ [markuplint](https://markuplint.dev/)
294
239
 
295
240
  ## License
296
241
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rintenki",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "A fast HTML linter powered by html5ever + napi-rs",
5
5
  "author": "Kazuhiro Kobayashi <https://github.com/kzhrk>",
6
6
  "license": "MIT",
@@ -41,11 +41,8 @@
41
41
  "binaryName": "rintenki",
42
42
  "targets": [
43
43
  "aarch64-apple-darwin",
44
- "x86_64-apple-darwin",
45
44
  "x86_64-unknown-linux-gnu",
46
- "aarch64-unknown-linux-gnu",
47
- "x86_64-pc-windows-msvc",
48
- "aarch64-pc-windows-msvc"
45
+ "x86_64-pc-windows-msvc"
49
46
  ]
50
47
  },
51
48
  "dependencies": {
Binary file
Binary file
Binary file
Binary file