Gathering detailed insights and metrics for stylelint-processor-styled-components
Gathering detailed insights and metrics for stylelint-processor-styled-components
Gathering detailed insights and metrics for stylelint-processor-styled-components
Gathering detailed insights and metrics for stylelint-processor-styled-components
stylelint-config-styled-components
A shareable stylelint config for stylelint-processor-styled-components
@auvee/stylelint-processor-styled-components
A stylelint processor for styled-components
@asvetliakov/stylelint-processor-styled-components
A stylelint processor for styled-components
stylelint-processor-styled-components-s3
A stylelint processor for styled-components
Lint your styled components with stylelint!
npm install stylelint-processor-styled-components
Typescript
Module System
Node Version
NPM Version
95.3
Supply Chain
98.4
Quality
79.5
Maintenance
50
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
654 Stars
487 Commits
61 Forks
32 Watchers
3 Branches
123 Contributors
Updated on Feb 28, 2025
Latest Version
1.10.0
Package Id
stylelint-processor-styled-components@1.10.0
Size
25.97 kB
NPM Version
6.9.0
Node Version
10.17.0
Published on
Feb 14, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
stylelint-processor-styled-components
Lint your styled components with stylelint!
You need:
stylelint
(duh)styled-components
stylelint-config-styled-components
config to disable stylelint rules that clash with styled-components
stylelint
config! (for example stylelint-config-recommended
)(npm install --save-dev \
stylelint \
stylelint-processor-styled-components \
stylelint-config-styled-components \
stylelint-config-recommended)
Now use those in your .stylelintrc
and run stylelint with your JavaScript files!
1{ 2 "processors": ["stylelint-processor-styled-components"], 3 "extends": [ 4 "stylelint-config-recommended", 5 "stylelint-config-styled-components" 6 ] 7}
NOTE: The processor works with Flow- and TypeScript-typed files too! (we'll assume TypeScript usage if your files end in
.ts
or.tsx
)
And it also has some options. Their default values are,
1{ 2 "processors": [["stylelint-processor-styled-components", { 3 "moduleName": "styled-components", 4 "importName": "default", 5 "strict": false, 6 "ignoreFiles": [], 7 "parserPlugins": [ 8 "jsx", 9 ["decorators", { "decoratorsBeforeExport": true }], 10 "classProperties", 11 "exportExtensions", 12 "functionBind", 13 "functionSent" 14 ] 15 }]] 16}
moduleName
, importName
and strict
, you can tell the processor what kinds of tagged template literals to lint.import styled, { css, keyframes } from 'styled-components';
// `importName` from `moduleName`, which means where `styled` comes from
styled(Component)``;
styled('div')``;
styled.div``;
// any other imports from `moduleName` (if `strict` is true, they will not be linted)
css``;
keyframes``;
// special extend calls, which have been deprecated in styled-components v4
Component.extend``;
ignoreFiles
is passed to micromatch as the second parameter, which means one or more glob patterns for matching.
parserPlugins
is used to make the processor's parser be able to parse new syntaxes. All available babel parser plugins and related options can be found in Babel's website.
Further documentation for this processor lives on the styled-components website!
Unexpected token
? Even thought the file didn't import styled-components
.You can custom babel plugins by option.parserPlugins
now. An API example is our test. But if someone can implement #231, that will be much better.
If your project includes yarn.lock
or package-lock.json
, an alternative cause can be that babel related dependencies, i.e. @babel/parser
and @babel/traverse
, are outdated, especially when linting files with new TypeScript syntaxes. You can upgrade them by removing their entries in the lockfile and reinstall dependencies.
The processor can not always parse interpolations with right things. But you can use interpolation-tagging to help it. If you have ideas to make it more intelligent, feel free to send a PR or share your solution by an new issue.
What's more, if set syntax: css-in-js
in stylelint@10, it can extract styles from styled-components
without this processor. Even though there are still lots of differences with this processor, we hope this processor's abilities can be migrated to stylelint totally in the future.
css
.You can set option.strict
. More examples are in #258.
Licensed under the MIT License, Copyright © 2017 Maximilian Stoiber. See LICENSE.md for more information!
Based on Mapbox' excellent stylelint-processor-markdown
, thanks to @davidtheclark!
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/6 approved changesets -- score normalized to 5
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
43 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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 More