@locker/eslint-plugin-locker
v0.22.8
Published
Lightning Web Security ESLint rules
Downloads
25,153
Readme
@locker/eslint-plugin-locker
Lightning Web Security ESLint rules
Installation
$ yarn add --dev eslint @locker/eslint-plugin-locker
Usage
Add @locker/eslint-plugin-locker
to the plugins
section of your configuration.
Then configure the desired rules in the rules
section.
Example of .eslintrc
:
{
"plugins": ["@locker/eslint-plugin-locker"],
"rules": {
"@locker/locker/blocked-document-properties": "error",
"@locker/locker/distorted-document-cookie": "warn"
}
}
For more details about configuration please refer to the dedicated section in the ESLint documentation: https://eslint.org/docs/user-guide/configuring
Configurations
To choose configuration settings, install the @locker/eslint-config-locker
sharable configuration package.
Rules
Lightning Web Security
| Rule ID | Description | Fixable Using | | --- | --- | --- | | @locker/locker/distorted-cachestorage-properties | distorted CacheStorage properties | | | @locker/locker/distorted-cookie-store-blocked-properties | disallowed CookieStore properties | | | @locker/locker/distorted-cookie-store-properties | distorted CookieStore properties | | | @locker/locker/distorted-data-transfer-blocked-properties | disallow blocked DataTransfer properties | | | @locker/locker/distorted-document-blocked-properties | disallow blocked Document properties | | | @locker/locker/distorted-document-cookie | distorted document.cookie | | | @locker/locker/distorted-document-domain-setter | distort Document#domain setter | | | @locker/locker/distorted-document-element-replacechildren | distort {Document|Element}.prototype.replaceChildren | | | @locker/locker/distorted-document-exec-command | distorted document.execCommand | | | @locker/locker/distorted-element-attach-shadow | distorted Element.prototype.attachShadow | | | @locker/locker/distorted-element-blocked-properties | disallow blocked Element properties | | | @locker/locker/distorted-element-get-inner-html | distort Element.prototype.getInnerHTML | | | @locker/locker/distorted-element-inner-html-setter | distort Element.prototype.innerHTML setter | | | @locker/locker/distorted-element-insert-adjacent-html | distort Element.prototype.insertAdjacentHTML | | | @locker/locker/distorted-element-outer-html-setter | distort Element.prototype.outerHTML setter | | | @locker/locker/distorted-element-set-attribute | distort Element.prototype.setAttribute APIs | | | @locker/locker/distorted-element-set-html | distort Element.prototype.setHTML | | | @locker/locker/distorted-element-shadow-root-getter | distort Element.prototype.shadowRoot getter | | | @locker/locker/distorted-element-toggle-attribute | distort Element.prototype.toggleAttribute | | | @locker/locker/distorted-html-element-blocked-properties | disallow blocked HTMLElement properties | | | @locker/locker/distorted-html-element-inner-text-setter | distort HTMLElement.prototype.innerText setter | | | @locker/locker/distorted-html-element-outer-text-setter | distort HTMLElement.prototype.outerText setter | | | @locker/locker/distorted-html-embed-object-element-blocked-properties | disallow blocked HTML{Embed|Object}Element properties | | | @locker/locker/distorted-html-iframe-element-blocked-properties | disallow blocked HTMLIFrameElement properties | | | @locker/locker/distorted-html-iframe-script-element-src-setter | distort HTML{IFrame|Script}Element.prototype.src setter | | | @locker/locker/distorted-html-link-element-rel-list-setter | distort HTMLLinkElement.prototype.relList setter | | | @locker/locker/distorted-html-link-element-rel-setter | distort HTMLLinkElement.prototype.rel setter | | | @locker/locker/distorted-named-node-map-set-named-item | distorted NamedNodeMap.prototype.setNamedItem | | | @locker/locker/distorted-navigator-sendbeacon | distorted navigator.sendBeacon | | | @locker/locker/distorted-navigator-service-worker-getter | distorted navigator.serviceWorker getter | | | @locker/locker/distorted-node-insertbefore | distort Node.prototype.insertBefore | | | @locker/locker/distorted-node-removechild | distort Node.prototype.removeChild | | | @locker/locker/distorted-node-replacechild | distort Node.prototype.replaceChild | | | @locker/locker/distorted-node-text-content-setter | distort Node.prototype.textContent setter | | | @locker/locker/distorted-range-create-contextual-fragment | distorted Range.prototype.createContextualFragment | | | @locker/locker/distorted-range-delete-contents | distorted Range.prototype.deleteContents | | | @locker/locker/distorted-range-extract-contents | distorted Range.prototype.extractContents | | | @locker/locker/distorted-range-insertnode | distorted Range.prototype.insertNode | | | @locker/locker/distorted-shared-worker-constructor | distorted SharedWorker constructor | | | @locker/locker/distorted-storage-constructor | distorted Storage constructor | | | @locker/locker/distorted-trusted-type-policy-factory-create-policy | distort TrustedTypePolicyFactory.prototype.createPolicy | | | @locker/locker/distorted-url-create-object-url | distorted URL.createObjectURL | | | @locker/locker/distorted-window-blocked-properties | disallow blocked Window properties | | | @locker/locker/distorted-window-fetch | distorted window.fetch | | | @locker/locker/distorted-window-frames-getter | distorted window.frames getter | | | @locker/locker/distorted-window-length-getter | distorted window.length getter | | | @locker/locker/distorted-window-onstorage-setter | distorted window.onstorage setter | | | @locker/locker/distorted-window-set-interval | distorted window.setInterval | | | @locker/locker/distorted-window-set-timeout | distorted window.setTimeout | | | @locker/locker/distorted-worker-constructor | distorted Worker constructor | | | @locker/locker/distorted-xml-http-request-window-open | distorted {XMLHttpRequest|Window}.prototype.open | | | @locker/locker/distorted-xsltprocessor-transformtodocument | distorted XSLTProcessor.prototype.transformToDocument | | | @locker/locker/distorted-xsltprocessor-transformtofragment | distorted XSLTProcessor.prototype.transformToFragment | | | @locker/locker/undefined-document-all | document.all is undefined | |