eslint-plugin-chai-expect weekly downloads statistics
By Turbo87 · npm · ESLint plugins
ESLint plugin that checks for common chai.js expect() mistakes
eslint-plugin-chai-expect has 143,568 recorded weekly downloads on npm, an increase of 17.8% over the past 30 days, ranking #577 of 3,247 tracked listings.
About eslint-plugin-chai-expect
eslint-plugin-chai-expect
ESLint plugin that checks for common chai.js expect() mistakes
[!IMPORTANT] The
recommendedpreset is for the ESLint legacy configuration system (.eslintrc.json). Therecommended-flatconfiguration is for the new flat configuration system.
Requirements
- Node.js 20 or above
- ESLint 2.x to 10.x
Installation
npm install --save-dev eslint-plugin-chai-expect
Configuration
Legacy ESLint Configuration Format (.eslintrc.json)
Add a plugins section and specify chai-expect as a plugin:
{
"plugins": [
"chai-expect"
]
}
Enable the rules that you would like to use:
{
"rules": {
"chai-expect/no-inner-compare": 2,
"chai-expect/no-inner-literal": 2,
"chai-expect/missing-assertion": 2,
"chai-expect/terminating-properties": 2
}
}
Or, if you just want the above defaults, you can avoid all of the above and just extend the config:
{
"extends": ["plugin:chai-expect/recommended"]
}
Flat ESLint Configuration Format (eslint.config.js)
Add a plugins section and specify chai-expect as a plugin and enable the rules that you would like to use:
import chaiExpectPlugin from 'eslint-plugin-chai-expect';
export default [
{
"plugins": {
"chai-expect": chaiExpectPlugin
},
"rules": {
"chai-expect/no-inner-compare": 2,
"chai-expect/no-inner-literal": 2,
"chai-expect/missing-assertion": 2,
"chai-expect/terminating-properties": 2,
"chai-expect/no-uncalled-method": 2
}
}
];
Or, if you just want the above defaults, you can avoid all of the above and just extend the config:
import chaiExpectPlugin from 'eslint-plugin-chai-expect';
export default [
chaiExpectPlugin.configs["recommended-flat"],
{
// ...
},
];
Rules
no-inner-compare- Prevent using comparisons in theexpect()argumentno-inner-literal- Prevent using literals in theexpect()argument (undefined,null,NaN,(+|-)Infinity,this, booleans, numbers, strings, and BigInt or regex literals)missing-assertion- Prevent callingexpect(...)without an assertion like.to.be.okterminating-properties- Prevent callingto.be.okand other assertion properties as functionsno-uncalled-method- Prevent usingto.throwand other assertion methods as properties without calling them
Additional configuration
terminating-properties rule
A number of extensions to chai add additional terminating properties. For example chai-http adds:
- headers
- html
- ip
- json
- redirect
- text
The terminating-properties rule can be configured to ensure these (or other) additional properties are not used as functions:
{
"rules": {
"chai-expect/terminating-properties": ["error", {
"properties": ["headers", "html", "ip", "json", "redirect", "test"]
}]
}
}
no-uncalled-method rule
By default, this rule checks for throw, throws, and Throw. You can configure additional methods that should not be used as properties:
{
"rules": {
"chai-expect/no-uncalled-method": ["error", {
"methods": ["include", "satisfy", "respondTo"]
}]
}
}
Development
Run yarn test to lint the project and run the tests with Node.js's built-in
test runner. Use yarn unit-test to run only the tests.
Run yarn coverage for Node.js's experimental coverage report. Coverage is
informational; no minimum coverage threshold is enforced.
License
eslint-plugin-chai-expect is licensed under the MIT License.
Description from the npm listing.
- chai
- eslint
- eslint-plugin
- eslintplugin
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm ESLint plugins plugins
All 20 eslint-plugin-chai-expect alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-chai-expect. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.