npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@salesforce/eslint-config-lwc

v4.1.1

Published

Opinionated ESLint configurations for LWC projects

Readme

@salesforce/eslint-config-lwc

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

Installation

npm install --save-dev @salesforce/eslint-config-lwc @lwc/eslint-plugin-lwc @salesforce/eslint-plugin-lightning eslint-plugin-import eslint-plugin-jest

Note that @lwc/eslint-plugin-lwc, @salesforce/eslint-plugin-lightning, eslint-plugin-import, and eslint-plugin-jest are peer dependencies of @salesforce/eslint-config-lwc.

Usage

[!IMPORTANT] Starting with v4.0.0, @salesforce/eslint-config-lwc only supports eslint@v9. Use @salesforce/[email protected] for older versions of eslint.

This repo exports the configurations as an array of config objects. Apply the appropriate configuration into your configuration using the spread operator.

Example of eslint.config.js:

const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.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

[Experimental] Usage with TypeScript

To enable working with TypeScript projects, install @babel/preset-typescript as a dependency, and apply any of the TypeScript-enabled configurations (any config ending in Ts).

Note that these configs use @babel/eslint-parser, and compatibility with @typescript-eslint/parser is not guaranteed.

[!IMPORTANT] While these configs are capable of parsing TypeScript files, not all rules support all TypeScript language features. For example, using type assertions (variable as Type) will break many rules.

Example eslint.config.js:

const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.recommendedTs];

Configurations

This package exposes multiple configurations for your usage. Each configuration listed below is available for both JavaScript projects and TypeScript projects (when using Ts suffix).

Base

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

Rules: LWC specific rules only.

Usage:

// eslint.config.js
const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.base];

TypeScript: Use configs.baseTs to use this config in TypeScript projects.

Recommended@salesforce/eslint-config-lwc/recommended

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

Rules: Base rules + Most of the base Potential errors rules + Some of the Best Practices rules + LWC Best Practices.

Usage:

// eslint.config.js
const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.recommended];

TypeScript: Use configs.recommendedTs to use this config in TypeScript projects.

Extended

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: Recommended rules + restrict usage of some slow patterns in COMPAT.

Usage:

// eslint.config.js
const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.extended];

TypeScript: Use configs.extendedTs to use this config in TypeScript projects.

i18n @salesforce/eslint-config-lwc/i18n

Goal: Promote usage of @salesforce/i18n-service over 3rd parties, promote internationalization (I18N) best practices.

Rules: I18N specific rules only.

Usage:

Add the i18n configuration to the extends field in your eslint.config.js configuration file, for example:

// eslint.config.js
const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.recommended, ...lwcConfig.configs.i18n];

TypeScript: Use configs.i18nTs to use this config in TypeScript projects.

Ssr

Goal: Promote writing server-side-rendering friendly components. We only recommend using this configuration if your components are running in experiences supporting LWC server-side-rendering.

Rules: SSR specific rules only.

Usage:

// eslint.config.js
const lwcConfig = require('@salesforce/eslint-config-lwc');

module.exports = [...lwcConfig.configs.ssr];

TypeScript: Use configs.ssrTs to use this config in TypeScript projects.