Code Monkey home page Code Monkey logo

eslint-config-lwc's Introduction

@salesforce/eslint-config-lwc

Opinionated ESLint configurations for Lightning Web Components (LWC) projects.

Installation

$ npm install eslint @salesforce/eslint-config-lwc --save-dev

Usage

Add the appropriate configuration to the extends field in your configuration.

Example of .eslintrc:

{
    "extends": ["@salesforce/eslint-config-lwc/recommended"]
}

For more details about configuration, please refer to the dedicated section in the ESLint documentation: https://eslint.org/docs/user-guide/configuring#using-a-shareable-configuration-package

Configurations

This package exposes 3 configurations for your usage.

@salesforce/eslint-config-lwc/base configuration

Goal: Prevent common pitfalls with LWC, and enforce other Salesforce platform restrictions.

Rules: LWC specific rules only.

@salesforce/eslint-config-lwc/recommended configuration

Goal: Prevent common Javascript pitfalls and enforce all best practices.

Rules: @salesforce/eslint-config-lwc/base rules + Most of the base Potential errors rules + Some of the Best Practices rules.

@salesforce/eslint-config-lwc/extended configuration

Goal: Restrict usage of some Javascript language features known to be slow after the COMPAT transformation. LWC runs in COMPAT mode on older browsers (eg. IE11). To support new Javascript syntax and language features on older browser the LWC compiler transforms LWC modules. This linting configuration targets patterns known to be slow in COMPAT mode.

Rules: @salesforce/eslint-config-lwc/recommended rules + restrict usage of some slow patterns in COMPAT.

eslint-config-lwc's People

Contributors

pmdartus avatar ravijayaramappa avatar diervo avatar jbleylesf avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.