Registry / testing / eslint-plugin-smells

eslint-plugin-smells

JSON →
library1.0.1jsnpmunverified

eslint-plugin-smells is an ESLint plugin that provides rules to detect code smells in JavaScript. Version 1.0.1 is the latest release. The plugin includes rules such as no-switch, no-complex-switch-case, no-setinterval, no-this-assign, no-complex-string-concat, and no-complex-chaining. It helps enforce cleaner coding practices by flagging common anti-patterns. The project is maintained but has not seen recent updates. It requires ESLint as a peer dependency and is used as an ESLint plugin via the plugins configuration.

npm install eslint-plugin-smells
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-SMEL
E
eslint-plugin-smells
testingjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-plugin-smells
import { rules } from 'eslint-plugin-smells'
const plugin = require('eslint-plugin-smells')
The plugin is typically configured in .eslintrc without explicit import; direct import is rarely needed. Use require for CommonJS or import for ESM if you must access rules programmatically.
no-switch
// In .eslintrc: "rules": { "smells/no-switch": 1 }
"smells/no-switch": true
Rule names use the 'smells/' prefix. Set severity as 0, 1, or 2, not boolean.
no-this-assign
// In .eslintrc: "rules": { "smells/no-this-assign": 2 }
import { noThisAssign } from 'eslint-plugin-smells'
Rules are not exported as named symbols; they are accessed via plugin namespace.

Minimal ESLint configuration to enable all code smell rules from eslint-plugin-smells.

{ "plugins": ["smells"], "rules": { "smells/no-switch": 1, "smells/no-complex-switch-case": 1, "smells/no-setinterval": 1, "smells/no-this-assign": 1, "smells/no-complex-string-concat": 1, "smells/no-complex-chaining": 1 } }
Debug
Known issues
gotchaRules must be prefixed with 'smells/' in the rules configuration.
fix
Use 'smells/no-switch' instead of 'no-switch'.
affects: *
gotchaPlugin does not export individual rules; import the whole package.
fix
Install and configure via .eslintrc plugins array.
affects: *
deprecatedRepository has not been updated since 2017, and no new rules have been added.
fix
Consider alternative plugins like eslint-plugin-sonarjs for more active development.
affects: *
Errors
Common errors & fixes
Error: Failed to load plugin 'smells': Cannot find module 'eslint-plugin-smells'
Plugin not installed or incorrectly referenced in ESLint config.
fix
Run `npm install eslint-plugin-smells --save-dev` and verify package is in node_modules.
ESLint: Invalid severity for rule 'smells/no-switch': expected 0, 1, or 2, got true
Boolean value used instead of numeric severity.
fix
Set severity to 1 (warning) or 2 (error), not true.
ESLint: Definition for rule 'smells/no-switch' was not found
Plugin not added to plugins array or rule name misspelled.
fix
Add 'smells' to plugins in .eslintrc and ensure rule name is exactly 'smells/no-switch'.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; required to run the plugin
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources