Skip to content

Commit 5240993

Browse files
authored
Added stylelint for styled-components (#36)
1 parent de8e588 commit 5240993

File tree

6 files changed

+923
-44
lines changed

6 files changed

+923
-44
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ workflows:
5858
branches:
5959
ignore: master
6060
tags:
61-
ignore: /^\d+\.\d+\.\d+(\-\w*?\.\d+)?$/
61+
ignore: /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(\-\w*?\.[1-9]\d*)?$/
6262
build_and_cover:
6363
jobs:
6464
- cover:
6565
filters:
6666
branches:
6767
only: master
6868
tags:
69-
ignore: /^\d+\.\d+\.\d+(\-\w*?\.\d+)?$/
69+
ignore: /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(\-\w*?\.[1-9]\d*)?$/
7070
build_and_deploy:
7171
jobs:
7272
- deploy:
7373
filters:
7474
branches:
7575
ignore: /.*/
7676
tags:
77-
only: /^\d+\.\d+\.\d+(\-\w*?\.\d+)?$/
77+
only: /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(\-\w*?\.[1-9]\d*)?$/

.stylelintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"processors": ["stylelint-processor-styled-components"],
3+
"extends": [
4+
"stylelint-config-recommended",
5+
"stylelint-config-styled-components"
6+
]
7+
}

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
"build": "yarn prettier && yarn lint && yarn test:coverage && tsc",
1717
"build-storybook": "build-storybook",
1818
"cover": "coveralls < coverage/lcov.info",
19-
"lint": "tslint -c tslint.json 'src/**/*.ts*'",
19+
"lint": "yarn lint:code && yarn lint:style",
20+
"lint:code": "tslint -c tslint.json \"./src/**/*.ts*\"",
21+
"lint:style": "stylelint \"./src/**/*.ts*\"",
2022
"precommit": "pretty-quick --staged",
2123
"prettier": "prettier \"./*.+(js|json|md)\" \"./src/**/*.*\" --write",
2224
"storybook": "start-storybook -p 6006",
@@ -41,6 +43,7 @@
4143
"@types/storybook__react": "^3.0.7",
4244
"awesome-typescript-loader": "^4.0.1",
4345
"babel-core": "^6.26.0",
46+
"babel-runtime": "^6.26.0",
4447
"coveralls": "^3.0.0",
4548
"enzyme": "^3.3.0",
4649
"enzyme-adapter-react-16": "^1.1.1",
@@ -53,12 +56,16 @@
5356
"pretty-quick": "^1.4.1",
5457
"react": "^16.2.0",
5558
"react-dom": "^16.2.0",
56-
"styled-components": "^3.2.3",
59+
"styled-components": "^3.3.2",
60+
"stylelint": "^9.2.1",
61+
"stylelint-config-recommended": "^2.1.0",
62+
"stylelint-config-styled-components": "^0.1.1",
63+
"stylelint-processor-styled-components": "^1.3.1",
5764
"ts-jest": "^22.0.1",
5865
"tslint": "^5.9.1",
5966
"tslint-react": "^3.3.3",
6067
"tslint-sonarts": "^1.6.0",
61-
"typescript": "^2.8.1"
68+
"typescript": "^2.9.1"
6269
},
6370
"dependencies": {}
6471
}

src/__utils__/Story.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ const Story = styled.div`
1010
"Segoe UI Symbol";
1111
${(props: StoryProperties) => (props.fullscreen ? "height: 100%;" : "")}
1212
13-
${Container},
14-
${Row} {
13+
${/*sc-selector*/ Container},
14+
${/*sc-selector*/ Row} {
1515
background: #ccc;
1616
${(props: StoryProperties) => (props.fullscreen ? "" : "height: 300px;")}
1717
}
1818
19-
${Row} > ${Column} {
19+
${/*sc-selector*/ Row} > ${/*sc-selector*/ Column} {
2020
background: #0a5991;
2121
border: 5px solid #ccc;
22-
color #fff;
22+
color: #fff;
2323
font-size: 2em;
2424
line-height: 65px;
2525
text-align: center;

src/row/renderGutter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default (noGutter?: boolean, theme?: Theme): string => {
88
margin-right: 0;
99
margin-left: 0;
1010
11-
> ${Column} {
11+
> ${/* sc-selector */ Column} {
1212
padding-right: 0;
1313
padding-left: 0;
1414
}
@@ -20,7 +20,7 @@ export default (noGutter?: boolean, theme?: Theme): string => {
2020
margin-right: -${width}px;
2121
margin-left: -${width}px;
2222
23-
> ${Column} {
23+
> ${/* sc-selector */ Column} {
2424
padding-right: ${width}px;
2525
padding-left: ${width}px;
2626
}

0 commit comments

Comments
 (0)