rintenki HTML LSP Server
rintenki-lsp-server is a Language Server Protocol (LSP) implementation specifically designed for the rintenki HTML linter. It provides real-time diagnostics, code actions (including quick fixes for auto-fixable rules), and rich hover information for HTML documents. Currently at version 0.14.5, it is under active development, likely with a release cadence tied to the core rintenki linter. Key differentiators include its focus on precise HTML linting, integration with the robust rintenki ruleset, and configurability via a `.rintenkirc.json` file or editor-specific settings. While primarily consumed by editor extensions like the rintenki VS Code extension, it can be integrated with any LSP-compatible client by launching it as a standard I/O process.
Common errors
-
Language server exited unexpectedly. Check output for more details.
cause This common error indicates a runtime issue within the `rintenki-lsp-server` process. Possible causes include an invalid `.rintenkirc.json` configuration, missing `rintenki` dependency, or an unhandled exception during server initialization or document processing.fixFirst, check your editor's LSP output/log panel for specific error messages. Verify the syntax and content of your `.rintenkirc.json`. Ensure `rintenki` is installed as a peer dependency (`npm install rintenki`). If logs are unavailable, try running the server manually with `node ./node_modules/rintenki-lsp-server/lib/server.js --stdio` to see direct console output. -
No diagnostics/linting errors are showing for HTML files.
cause The LSP client might not be correctly configured to associate HTML file types with `rintenki-lsp-server`, the server process might not be running or connected, or the `rintenki` configuration might be too permissive or exclude relevant files.fixConfirm your editor's LSP client settings properly link HTML file types (e.g., `.html`, `.vue`, `.svelte`) to the `rintenki-lsp-server`. Ensure the server is successfully launched and connected. Review your `.rintenkirc.json` file for 'ignore' patterns or overly lenient rule severities (e.g., 'off').
Warnings
- breaking As a package in the 0.x.x version range, breaking changes can occur between minor versions. Always consult the GitHub release notes or changelog when upgrading, especially for changes in rintenki's core rules, options, or the server's configuration schema which may require `.rintenkirc.json` updates.
- gotcha The effectiveness of the LSP server is highly dependent on the correct configuration of the underlying `rintenki` linter. Misconfigured, invalid, or missing `.rintenkirc.json` files can lead to the server not providing expected diagnostics or quick fixes.
- gotcha rintenki-lsp-server is designed to be launched as a separate process via standard I/O (stdio) and is not intended for direct programmatic `import` and execution within browser environments or other JavaScript applications by end-users. Its primary interface is the LSP protocol.
Install
-
npm install rintenki-lsp-server -
yarn add rintenki-lsp-server -
pnpm add rintenki-lsp-server
Imports
- RintenkiSettings
import type { RintenkiSettings } from 'rintenki-lsp-server'; - RintenkiDiagnostic
import type { RintenkiDiagnostic } from 'rintenki-lsp-server'; - startServer
import { startServer } from 'rintenki-lsp-server/lib/server';
Quickstart
npm install rintenki-lsp-server rintenki
# To launch the rintenki LSP server for generic LSP clients (e.g., Neovim, Emacs):
# Configure your LSP client to execute this command:
# (ensure 'node' is in your PATH or specify the full path to your Node.js executable)
node ./node_modules/rintenki-lsp-server/lib/server.js --stdio
// Example .rintenkirc.json in your project root for configuration:
// {
// "rules": {
// "no-bare-script": "warn",
// "self-closing-void-elements": "error",
// "prefer-button-type": "off"
// }
// }