Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-lit

Package Overview
Dependencies
Maintainers
0
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-lit

lit-html support for ESLint

  • 1.15.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67K
decreased by-7.5%
Maintainers
0
Weekly downloads
 
Created
Source
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']
  }
];

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

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

Keywords

FAQs

Package last updated on 07 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc