{"id":19937,"library":"eslint-plugin-smells","title":"eslint-plugin-smells","description":"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.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/elijahmanor/eslint-plugin-smells","tags":["javascript","eslint-plugin","eslintplugin","eslint","smells"],"install":[{"cmd":"npm install eslint-plugin-smells","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-smells","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-smells","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"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.","wrong":"const plugin = require('eslint-plugin-smells')","symbol":"eslint-plugin-smells","correct":"import { rules } from 'eslint-plugin-smells'"},{"note":"Rule names use the 'smells/' prefix. Set severity as 0, 1, or 2, not boolean.","wrong":"\"smells/no-switch\": true","symbol":"no-switch","correct":"// In .eslintrc: \"rules\": { \"smells/no-switch\": 1 }"},{"note":"Rules are not exported as named symbols; they are accessed via plugin namespace.","wrong":"import { noThisAssign } from 'eslint-plugin-smells'","symbol":"no-this-assign","correct":"// In .eslintrc: \"rules\": { \"smells/no-this-assign\": 2 }"}],"quickstart":{"code":"{\n  \"plugins\": [\"smells\"],\n  \"rules\": {\n    \"smells/no-switch\": 1,\n    \"smells/no-complex-switch-case\": 1,\n    \"smells/no-setinterval\": 1,\n    \"smells/no-this-assign\": 1,\n    \"smells/no-complex-string-concat\": 1,\n    \"smells/no-complex-chaining\": 1\n  }\n}","lang":"javascript","description":"Minimal ESLint configuration to enable all code smell rules from eslint-plugin-smells."},"warnings":[{"fix":"Use 'smells/no-switch' instead of 'no-switch'.","message":"Rules must be prefixed with 'smells/' in the rules configuration.","severity":"gotcha","affected_versions":"*"},{"fix":"Install and configure via .eslintrc plugins array.","message":"Plugin does not export individual rules; import the whole package.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider alternative plugins like eslint-plugin-sonarjs for more active development.","message":"Repository has not been updated since 2017, and no new rules have been added.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install eslint-plugin-smells --save-dev` and verify package is in node_modules.","cause":"Plugin not installed or incorrectly referenced in ESLint config.","error":"Error: Failed to load plugin 'smells': Cannot find module 'eslint-plugin-smells'"},{"fix":"Set severity to 1 (warning) or 2 (error), not true.","cause":"Boolean value used instead of numeric severity.","error":"ESLint: Invalid severity for rule 'smells/no-switch': expected 0, 1, or 2, got true"},{"fix":"Add 'smells' to plugins in .eslintrc and ensure rule name is exactly 'smells/no-switch'.","cause":"Plugin not added to plugins array or rule name misspelled.","error":"ESLint: Definition for rule 'smells/no-switch' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}