New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #118: added stylelint #125
Conversation
I've hooked the stylelint script to the test script. Please review my changes. Adding npm-run-all can be filed as another issue. |
This is great, it would have caught the issue in #117. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! A few questions for you.
.stylelintrc.js
Outdated
"!*.css" | ||
], | ||
rules: { | ||
"at-rule-no-unknown": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: why not just use the standard config of rules in https://github.com/stylelint/stylelint-config-standard? How did you arrive at this set of rules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used https://github.com/stylelint/stylelint-config-recommended , should I use the standard config instead of recommended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of manually defining these rules, you can install the recommended:
npm install stylelint-config-recommended --save-dev
and then use
"extends": "stylelint-config-recommended"
And you don't/won't have to specify all these. You'd only use these rules
if you wanted to override something, which we might. This is very similar to what we're doing in eslint with the Airbnb ruleset
package.json
Outdated
"jest": "^24.9.0" | ||
"jest": "^24.9.0", | ||
"stylelint": "^11.1.1", | ||
"stylelint-webpack-plugin": "^1.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this dep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this was a mistake. I thought we need both stylelint and stylelint-webpack-plugin for stylelint to work. I'll remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
I'm excited to see this land, as it will help us catch bugs faster in review for subsequent PRs. |
Added style lint to catch invalid css styles
How to run script:
npm run stylelint
This PR successfully picks up the
h1c
invalid css selector in planet.cssFixes #118