JSPM

  • Created
  • Published
  • Downloads 84019
  • Score
    100M100P100Q166334F
  • License MIT

lit-html support for ESLint

Package Exports

  • eslint-plugin-lit
  • eslint-plugin-lit/lib/index.js
  • eslint-plugin-lit/lib/template-analyzer
  • eslint-plugin-lit/lib/template-analyzer.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-lit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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"
  ]
}

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

We also automatically include the recommended rules of eslint-plugin-wc.

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"]
}

License

MIT