ESLint plugin for Lit (lit-html / LitElement) providing 23+ lint rules covering attribute names, binding positions, lifecycle super calls, legacy syntax, and more. Stable version 2.2.1, released as needed with minor updates. ESM-only since v2.0.0, requires Node >= 18 and ESLint >= 8. Supports flat config and has recommended shareable config. Differentiated from general ESLint rules by targeting Lit-specific constructs like template literals and LitElement classes, with TypeScript type definitions included.
npm install eslint-plugin-litVerified import paths — ran on the pinned version, not inferred.
Flat config usage with recommended rules and a custom rule override.
Use import statements or dynamic import() in CommonJS files.
Switch to eslint.config.js with import { configs } from 'eslint-plugin-lit'.Use import { configs } from 'eslint-plugin-lit' instead of default import.Upgrade Node.js to version 18 or higher.
Ensure your project uses Lit v2 or later if enabling such rules.
Change to import statement or use dynamic import: const plugin = await import('eslint-plugin-lit');Run npm install eslint-plugin-lit --save-dev
Ensure you use import { configs } from 'eslint-plugin-lit' and spread it correctly: export default [configs['flat/recommended'], ...]