JSPM

  • Created
  • Published
  • Downloads 18922
  • Score
    100M100P100Q141572F
  • License MIT

Eslint config following open-wc recommendations

Package Exports

  • @open-wc/eslint-config

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 (@open-wc/eslint-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Linting ESLint

Part of Open Web Component Recommendation open-wc Recommendations open-wc

We want to provide a good set of defaults on how to facilitate your web component.

CircleCI BrowserStack Status Renovate enabled

Uses ESLint to lint your es6 code.

Setup

npx -p yo -p generator-open-wc -c 'yo open-wc:lint-eslint'

::: tip Info This is part of the default open-wc recommendation :::

Manual

  • yarn add --dev @open-wc/eslint-config
  • copy .eslintignore to .eslintignore
  • copy .eslintrc.js to .eslintrc.js
  • add these scripts to your package.json
    "scripts": {
      "lint:eslint": "eslint --ext .js,.html .",
      "format:eslint": "eslint --ext .js,.html . --fix"
    },

What you get

This will install @open-wc/eslint-config. A config based on airbnb but allow for specialities needed for web components like.

  • apply linting to js and html files
  • allow dynamic module imports
  • allow imports in test/demos from devDependencies
  • allow underscore dangle
  • do not prefer default exports
  • do not prefer no file extension

Usage

Run:

  • npm run lint:eslint to check if any file is not correctly formatted
  • npm run format:eslint to auto format your files