ESLint rules for formatting test suites written for jest.
Installations
npm install eslint-plugin-jest-formatting
Releases
Developer
dangreenisrael
Developer Guide
Module System
CommonJS
Min. Node Version
^12.22.0 || ^14.17.0 || >=16.0.0
Typescript Support
No
Node Version
12.22.7
NPM Version
6.14.15
Statistics
156 Stars
117 Commits
13 Forks
4 Watching
2 Branches
12 Contributors
Updated on 21 Nov 2024
Languages
JavaScript (52.17%)
TypeScript (47.83%)
Total Downloads
Cumulative downloads
Total Downloads
75,424,868
Last day
-3.2%
111,306
Compared to previous day
Last week
5.4%
590,697
Compared to previous week
Last month
7.9%
2,536,036
Compared to previous month
Last year
17.6%
26,774,651
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
17
eslint-plugin-jest-formatting
This package provides ESLint rules for jest test suites.
This project aims to provide formatting rules (auto-fixable where possible) to ensure consistency and readability in jest test suites.
Like this plugin? Say thanks with a ⭐️
Note: The master version may not be the version deployed to npm. Please treat https://www.npmjs.com/package/eslint-plugin-jest-formatting as the cannonical source for docs.
Installation
You'll first need to install ESLint:
$ yarn add eslint --dev
Next, install eslint-plugin-jest-formatting
:
$ yarn add eslint-plugin-jest-formatting --dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-jest-formatting
globally.
Usage
Add jest-formatting
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
1{ 2 "plugins": ["jest-formatting"] 3}
Then configure the rules you want to use under the rules section.
1{ 2 "rules": { 3 "jest-formatting/padding-around-describe-blocks": 2, 4 "jest-formatting/padding-around-test-blocks": 2 5 } 6}
or
You can use our "recommended" settings which enables most of the rules for you
1{ 2 "extends": ["plugin:jest-formatting/recommended"] 3}
We also support a "strict" settings which enabled all of the rules for you
1{ 2 "extends": ["plugin:jest-formatting/strict"] 3}
Rule Documentation
- padding-around-after-all-blocks
- padding-around-after-each-blocks
- padding-around-before-all-blocks
- padding-around-before-each-blocks
- padding-around-expect-groups
- padding-around-describe-blocks
- padding-around-test-blocks
- padding-around-all
Related Projects
eslint-plugin-jest
This provides an extensive set of jest eslint rules
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
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Info: no jobLevel write permissions found
Reason
Found 13/16 approved changesets -- score normalized to 8
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/dangreenisrael/eslint-plugin-jest-formatting/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/dangreenisrael/eslint-plugin-jest-formatting/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/dangreenisrael/eslint-plugin-jest-formatting/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/dangreenisrael/eslint-plugin-jest-formatting/codeql-analysis.yml/master?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
10 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
5
/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 MoreOther packages similar to eslint-plugin-jest-formatting
eslint-plugin-jest
ESLint rules for Jest
eslint-config-react-app
ESLint configuration used by Create React App
eslint-plugin-jest-dom
ESLint plugin to follow best practices and anticipate common mistakes when writing tests with jest-dom
@vue/eslint-config-prettier
eslint-config-prettier for create-vue