Installations
npm install eslint-plugin-custom-elements
Developer
github
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.21.3
NPM Version
6.14.18
Statistics
58 Stars
220 Commits
12 Forks
144 Watching
2 Branches
3,725 Contributors
Updated on 31 Jul 2024
Languages
JavaScript (98.83%)
Dockerfile (1.17%)
Total Downloads
Cumulative downloads
Total Downloads
489,656
Last day
7.1%
211
Compared to previous day
Last week
1.2%
1,137
Compared to previous week
Last month
-16.9%
5,241
Compared to previous month
Last year
-27.8%
145,424
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
eslint-plugin-custom-elements (archived)
[!WARNING]
This project has been merged with eslint-plugin-wc. Please head there for updates and maintenance.
This is an ESLint Plugin to help provide best practices for writing Custom Elements aka Web Components. It provides a set of custom rules which can be enforced for files that declare classes that extend from HTMLElement.
Requirements
Node 14.x
Installation
1$ npm install --save-dev eslint eslint-plugin-custom-elements
Setup
Add custom-elements
to your list of plugins in your ESLint config, and enable the rules you want or just add plugin:custom-elements/recommended
to the extends
array.
JSON ESLint config example:
1{ 2 "extends": ["plugin:custom-elements/recommended"] 3}
Rules
- Define Tag After Class Definition
- Expose Class on Global
- Extends Correct Class
- File Name Matches Element
- No Constructor
- No Customized Built in Elements
- No DOM Traversal in Attributechangedcallback
- No DOM Traversal in Connectedcallback
- No Exports with Element
- No Method Prefixed with on
- No Unchecked Define
- One Element Per File
- Tag Name Matches Class
- Valid Tag Name
Development
npm install
npm test
License
Distributed under the MIT license. See LICENSE for details.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy
- Info: Found text in security policy: SECURITY.md:1
Reason
4 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
Reason
Found 9/16 approved changesets -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/format.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/format.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/format.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/nodejs.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/nodejs.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/publish.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/github/eslint-plugin-custom-elements/publish.yml/main?enable=pin
- Warn: containerImage not pinned by hash: .devcontainer/Dockerfile:5
- Warn: npmCommand not pinned by hash: .github/workflows/format.yml:20
- Info: 0 out of 6 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 containerImage dependencies pinned
- Info: 2 out of 3 npmCommand dependencies pinned
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/format.yml:1
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 25 are checked with a SAST tool
Score
4.7
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More