npm package: @lwc/eslint-plugin-lwc-platform
Description: ESLint rules and configuration of LWC modules used in Salesforce
Latest version: 6.3.0

# @lwc/eslint-plugin-lwc-platform

> ESLint rules and configuration of LWC modules used in Core

## Should I use this plugin?

This plugin contains linting rules that are run on LWC components deployed to Salesforce. If you author such components, you may use this plugin.

## Installation

This plugin is intended to be used along with the official `@salesforce/eslint-config-lwc` config. The `@lwc/eslint-plugin-lwc-platform` only contains an extra set of rules that are relevant in the context of Salesforce.

```sh
$ npm install --save-dev eslint @salesforce/eslint-config-lwc @lwc/eslint-plugin-lwc-platform
```

## Usage

Example of `.eslintrc.json`:

```json
{
    "plugins": ["@lwc/lwc-platform"],
    "extends": [
        "@salesforce/eslint-config-lwc/recommended",
        "plugin:@lwc/lwc-platform/recommended",
        "plugin:@lwc/lwc-platform/style"
    ]
}
```

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

## Rules

| Rule ID                                                                                                                          | Description                                                                           |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [@lwc/lwc-platform/no-aura-libs](./docs/rules/no-aura-libs.md)                                                                   | disallow import of Aura libraries                                                     |
| [@lwc/lwc-platform/no-community-import](./docs/rules/no-community-import.md)                                                     | disallow import of community-only modules                                             |
| [@lwc/lwc-platform/no-create-context-provider](./docs/rules/no-create-context-provider.md)                                       | disallow import of `createContextProvider` from `lwc`                                 |
| [@lwc/lwc-platform/no-deprecated-module-import](./docs/rules/no-deprecated-module-import.md)                                     | disallow import of deprecated modules                                                 |
| [@lwc/lwc-platform/no-dynamic-import](./docs/rules/no-dynamic-import.md)                                                         | disallow dynamic import                                                               |
| [@lwc/lwc-platform/no-dynamic-import-identifier](./docs/rules/no-dynamic-import-identifier.md)                                   | disallow dynamic import via identifier                                                |
| [@lwc/lwc-platform/no-dynamic-import-relative-path-string](./docs/rules/no-dynamic-import-relative-path-string.md)               | disallow relative path dynamic import via string literal                              |
| [@lwc/lwc-platform/no-aura](./docs/rules/no-aura.md)                                                                             | disallow usage of `$A`                                                                |
| [@lwc/lwc-platform/no-inline-disable](./docs/rules/no-inline-disable.md)                                                         | disallow inline disablement of ESLint rule                                            |
| [@lwc/lwc-platform/no-interop-create](./docs/rules/no-interop-create.md)                                                         | disallow import of `createComponent` from `aura`                                      |
| [@lwc/lwc-platform/no-interop-dispatch](./docs/rules/no-interop-dispatch.md)                                                     | disallow import of `dispatchGlobalEvent` from `aura`                                  |
| [@lwc/lwc-platform/no-interop-execute](./docs/rules/no-interop-execute.md)                                                       | disallow import of `executeGlobalController` from `aura`                              |
| [@lwc/lwc-platform/no-interop-execute-privileged](./docs/rules/no-interop-execute-privileged.md)                                 | disallow import of `unstable_executeGlobalControllerPrivileged` from `aura`           |
| [@lwc/lwc-platform/no-interop-execute-raw-response](./docs/rules/no-interop-execute-raw-response.md)                             | disallow import of `executeGlobalControllerRawResponse` from `aura`                   |
| [@lwc/lwc-platform/no-interop-execute-with-callback](./docs/rules/no-interop-execute-with-callback.md)                           | disallow import of `executeGlobalControllerWithCallback` from `aura`                  |
| [@lwc/lwc-platform/no-interop-execute-controller-with-client-def](./docs/rules/no-interop-execute-controller-with-client-def.md) | disallow import of `executeControllerWithClientSideActionDef` from `aura`             |
| [@lwc/lwc-platform/no-interop-get-event](./docs/rules/no-interop-get-event.md)                                                   | disallow import of `getEventDef` from `aura`                                          |
| [@lwc/lwc-platform/no-interop-get-module](./docs/rules/no-interop-get-module.md)                                                 | disallow import of `getModule` from `aura`                                            |
| [@lwc/lwc-platform/no-interop-is-external-definition](./docs/rules/no-interop-is-external-definition.md)                         | disallow import of `isExternalDefinition` from `aura`                                 |
| [@lwc/lwc-platform/no-interop-module-instrumentation](./docs/rules/no-interop-module-instrumentation.md)                         | disallow import of `aura-instrumentation`                                             |
| [@lwc/lwc-platform/no-interop-module-storage](./docs/rules/no-interop-module-storage.md)                                         | disallow import of `aura-storage`                                                     |
| [@lwc/lwc-platform/no-interop-register](./docs/rules/no-interop-register.md)                                                     | disallow import of `registerModule` from `aura`                                       |
| [@lwc/lwc-platform/no-interop-render](./docs/rules/no-interop-render.md)                                                         | disallow import of `renderComponent` from `aura`                                      |
| [@lwc/lwc-platform/no-interop-sanitize](./docs/rules/no-interop-sanitize.md)                                                     | disallow import of `sanitizeDOM` from `aura`                                          |
| [@lwc/lwc-platform/no-interop-load-definitions](./docs/rules/no-interop-load-definitions.md)                                     | disallow import of `unstable_loadComponentDefs` from `aura`                           |
| [@lwc/lwc-platform/no-interop](./docs/rules/no-interop.md)                                                                       | disallow import of `aura`                                                             |
| [@lwc/lwc-platform/no-process-env](./docs/rules/no-process-env.md)                                                               | restrict usage of the `process` global object                                         |
| [@lwc/lwc-platform/no-site-import](./docs/rules/no-site-import.md)                                                               | disallow import of site-only modules                                                  |
| [@lwc/lwc-platform/no-wire-service](./docs/rules/no-wire-service.md)                                                             | disallow import of `wire-service`                                                     |
| [@lwc/lwc-platform/no-restricted-namespaces](./docs/rules/no-restricted-namespaces.md)                                           | disallow importing from restricted namespaces                                         |
| [@lwc/lwc-platform/valid-dynamic-import-hint](./docs/rules/valid-dynamic-import-hint.md)                                         | validate hint comments usage with dynamic import                                      |
| [@lwc/lwc-platform/valid-offline-wire](./docs/rules/valid-offline-wire.md)                                                       | validate components for offline support                                               |
| [@lwc/lwc-platform/no-lds-aura-controller-method](./docs/rules/no-lds-aura-controller-method.md)                                 | disallow import of `UnstableAuraControllerMethod`from `force/ldsAuraControllerMethod` |