MCPcopy Index your code
hub / github.com/43081j/eslint-plugin-lit

github.com/43081j/eslint-plugin-lit @2.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.3.1 ↗ · + Follow
92 symbols 287 edges 62 files 37 documented · 40% 6 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Eslint + Lit

eslint-plugin-lit

npm version Build Status Coverage Status License: MIT

ESLint plugin for Lit.

Install

Assuming you already have ESLint installed, run:

# npm
npm install eslint-plugin-lit --save-dev

# yarn
yarn add eslint-plugin-lit --dev

Usage

Then extend the recommended eslint config:

{
  "extends": [
    // ...
    "plugin:lit/recommended"
  ]
}

Or if you're using (flat) config files, add to your eslint.config.js:

import {configs} from 'eslint-plugin-lit';

export default [
  configs['flat/recommended'],

  // or if you want to specify `files`, or other options
  {
    ...configs['flat/recommended'],
    files: ['test/**/*.js']
  }
];

You can also specify settings that will be shared across all the plugin rules.

{
  settings: {
    lit: {
      elementBaseClasses: ['ClassExtendingLitElement'] // Recognize `ClassExtendingLitElement` as a sub-class of LitElement
    }
  }
}

Custom Configuration

If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file:

{
  "plugins": [
    // ...
    "lit"
  ],
  "rules": {
    // ...
    "lit/no-legacy-template-syntax": "error",
    "lit/no-template-arrow": "warn"
  }
}

List of supported rules

Shareable configurations

Recommended

This plugin exports a recommended configuration that enforces Lit good practices.

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": ["eslint:recommended", "plugin:lit/recommended"]
}

Usage with eslint-plugin-wc

We highly recommend you also depend on eslint-plugin-wc as it will provide additional rules for web components in general:

npm i -D eslint-plugin-wc

Then extend the recommended eslint config:

{
  "extends": ["plugin:wc/recommended", "plugin:lit/recommended"]
}

License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 74
Interface 8
Method 8
Class 2

Languages

TypeScript100%

Modules by API surface

src/util.ts18 symbols
src/template-analyzer.ts14 symbols
src/rules/prefer-query-decorators.ts9 symbols
src/rules/no-property-change-update.ts7 symbols
src/rules/no-this-assign-in-render.ts6 symbols
src/rules/lifecycle-super.ts6 symbols
src/test/template-analyzer_test.ts3 symbols
src/rules/prefer-static-styles.ts2 symbols
src/rules/no-useless-template-literals.ts2 symbols
src/rules/no-template-bind.ts2 symbols
src/rules/no-template-arrow.ts2 symbols
src/rules/binding-positions.ts2 symbols

For agents

$ claude mcp add eslint-plugin-lit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page