ESLint plugin enforcing best practices for Web Components, compatible with custom elements and libraries like LitElement. Current stable version 3.1.0, maintained actively. Requires ESLint >=8.40.0 and ships TypeScript types. Key differentiator: dedicated Web Components lint rules covering lifecycle callbacks, naming conventions, and shadow DOM correctness. ESM-only since v3.0.0; provides both legacy .eslintrc and flat config support.
npm install eslint-plugin-wcVerified import paths — ran on the pinned version, not inferred.
Minimal configuration to enable recommended Web Components linting with both legacy .eslintrc and flat config formats.
Use import statements or update to dynamic import().
Update ESLint to version 8.40.0 or later.
Use default import or configs export for configuration.
Use `configs['flat/recommended']` in eslint.config.js.
Add settings.wc.elementBaseClasses in your ESLint config.
Switch to import statement or use dynamic import().
Run npm install eslint-plugin-wc --save-dev.
Check rule documentation for valid option schema; options are typically an empty array or specific format.
Use import { configs } from 'eslint-plugin-wc' and access configs['flat/recommended'].