Registry / testing / eslint-plugin-clean-styled-components

eslint-plugin-clean-styled-components

JSON →
library0.0.2jsnpmunverified

An ESLint plugin that enforces clean code practices in styled-components usage. Version 0.0.2 is the latest, with no known release cadence. It provides rules such as 'single-component-per-file' to enforce one styled component per file. Unlike other styled-components lint plugins, this focuses on structural cleanliness rather than syntax or style. No major changes or updates have been made since initial release.

npm install eslint-plugin-clean-styled-components
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-CLEA
E
eslint-plugin-clean-styled-components
testingjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

plugin
✓ // In .eslintrc: "plugins": ["clean-styled-components"]
✗ // Wrong: include full name "eslint-plugin-clean-styled-components" in plugins list is unnecessary
ESLint automatically resolves 'eslint-plugin-' prefix.
rules
✓ // In .eslintrc: "rules": { "clean-styled-components/single-component-per-file": 2 }
✗ // Wrong: using snake_case (clean_styled_components) instead of kebab-case (clean-styled-components)
Rule names are kebab-case and scoped under the plugin.
single-component-per-file
✓ import singleComponentPerFile from 'eslint-plugin-clean-styled-components'?
✗ // Wrong: This rule is not directly imported; it's used via ESLint configuration.
Rules are not exported as JS modules; they are configured via ESLint config.

Shows how to enable the 'single-component-per-file' rule in ESLint config and an example that violates it.

// .eslintrc.json { "plugins": ["clean-styled-components"], "rules": { "clean-styled-components/single-component-per-file": 2 } } // styled-components file (styled.js) // This will fail lint because multiple styled components are in one file import styled from 'styled-components'; export const Button = styled.button` color: red; `; export const Input = styled.input` border: 1px solid; `;
Debug
Known issues
gotchaThe plugin is very early (v0.0.2) and may have limited rules or bugs. Only one rule is documented.
fix
Consider other mature styled-components lint plugins like eslint-plugin-styled-components-a11y or custom rules.
affects: >=0.0.0
gotchaThe plugin does not appear to support TypeScript or styled-components macro syntax out of the box.
fix
Use a more comprehensive plugin or extend with custom rule parsers.
affects: >=0.0.0
Errors
Common errors & fixes
ESLint couldn't find the plugin "eslint-plugin-clean-styled-components".
Plugin not installed or ESLint cannot find it due to global/local mismatch.
fix
Install plugin locally: npm install eslint-plugin-clean-styled-components --save-dev
Configuration for rule "clean-styled-components/single-component-per-file" is invalid.
Invalid rule severity or rule name typo.
fix
Use numeric severity (0,1,2) or string ('off','warn','error'). Ensure rule name is kebab-case.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
eslintoptionalPeer dependency; plugin requires ESLint to function.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-clean-styled-components — npm install eslint-plugin-clean-styled-components · libregistry