@lwc/eslint-plugin-lwc-platform
v5.0.0
Published
ESLint rules and configuration of LWC modules used in Salesforce
Downloads
1,533
Maintainers
Keywords
Readme
@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.
$ npm install --save-dev eslint @salesforce/eslint-config-lwc @lwc/eslint-plugin-lwc-platform
Usage
Example of .eslintrc.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 | disallow import of Aura libraries |
| @lwc/lwc-platform/no-community-import | disallow import of community-only modules |
| @lwc/lwc-platform/no-create-context-provider | disallow import of createContextProvider
from lwc
|
| @lwc/lwc-platform/no-deprecated-module-import | disallow import of deprecated modules |
| @lwc/lwc-platform/no-dynamic-import | disallow dynamic import |
| @lwc/lwc-platform/no-dynamic-import-identifier | disallow dynamic import via identifier |
| @lwc/lwc-platform/no-dynamic-import-relative-path-string | disallow relative path dynamic import via string literal |
| @lwc/lwc-platform/no-aura | disallow usage of $A
|
| @lwc/lwc-platform/no-inline-disable | disallow inline disablement of ESLint rule |
| @lwc/lwc-platform/no-interop-create | disallow import of createComponent
from aura
|
| @lwc/lwc-platform/no-interop-dispatch | disallow import of dispatchGlobalEvent
from aura
|
| @lwc/lwc-platform/no-interop-execute | disallow import of executeGlobalController
from aura
|
| @lwc/lwc-platform/no-interop-execute-privileged | disallow import of unstable_executeGlobalControllerPrivileged
from aura
|
| @lwc/lwc-platform/no-interop-execute-raw-response | disallow import of executeGlobalControllerRawResponse
from aura
|
| @lwc/lwc-platform/no-interop-get-event | disallow import of getEventDef
from aura
|
| @lwc/lwc-platform/no-interop-get-module | disallow import of getModule
from aura
|
| @lwc/lwc-platform/no-interop-is-external-definition | disallow import of isExternalDefinition
from aura
|
| @lwc/lwc-platform/no-interop-module-instrumentation | disallow import of aura-instrumentation
|
| @lwc/lwc-platform/no-interop-module-storage | disallow import of aura-storage
|
| @lwc/lwc-platform/no-interop-register | disallow import of registerModule
from aura
|
| @lwc/lwc-platform/no-interop-render | disallow import of renderComponent
from aura
|
| @lwc/lwc-platform/no-interop-sanitize | disallow import of sanitizeDOM
from aura
|
| @lwc/lwc-platform/no-interop-load-definitions | disallow import of unstable_loadComponentDefs
from aura
|
| @lwc/lwc-platform/no-interop | disallow import of aura
|
| @lwc/lwc-platform/no-process-env | restrict usage of the process
global object |
| @lwc/lwc-platform/no-site-import | disallow import of site-only modules |
| @lwc/lwc-platform/no-wire-service | disallow import of wire-service
|
| @lwc/lwc-platform/valid-dynamic-import-hint | validate hint comments usage with dynamic import |
| @lwc/lwc-platform/valid-offline-wire | validate components for offline support |