-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
chore(v2): add stylelint #2361
chore(v2): add stylelint #2361
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 583cb9b |
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.
Thanks! This looks great! I'll merge it first and make some tweaks later on as it's easier for me to do so. This is hugely helpful!
@@ -0,0 +1,11 @@ | |||
{ | |||
"name": "stylelint-copyright", |
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.
Indentation is off here. I recommend you use VS Code and install the Prettier plugin to autoformat your JS files upon save.
@@ -1,3 +1,10 @@ | |||
/** |
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.
We don't really want to add this copyright notice to the non-FB templates because they are... non-FB. It's ok I'll remove it later on.
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.
Good to know, thanks!
{ | ||
"plugins": ["./packages/stylelint-copyright/index.js"], | ||
"rules": { | ||
"plugin/stylelint-copyright": 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.
Indentation is off...
@@ -0,0 +1,6 @@ | |||
{ | |||
"plugins": ["../../..//stylelint-copyright/index.js"], |
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.
Relative paths won't work because when someone initializes this template in their own machine there's no such path existing. It only works within the repo. We should publish that plugin on npm, and then we can install in package.json
and import it here.
I will take care of publishing that on npm.
@@ -0,0 +1,6 @@ | |||
{ |
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.
In general I prefer to use configs in JS because you can add comments to them. But then you will need a JS parser to read the file whereas other languages can easily read JSON. Since I don't expect our stylelint config to be read by non-JS environments, we can use JS instead.
@@ -17,7 +17,8 @@ | |||
"@docusaurus/preset-classic": "^2.0.0-alpha.43", | |||
"classnames": "^2.2.6", | |||
"react": "^16.8.4", | |||
"react-dom": "^16.8.4" | |||
"react-dom": "^16.8.4", | |||
"stylelint": "^13.2.0" |
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 should be in devDependencies
. dependencies
are things that are needed to be bundled in the application.
Motivation
Fixes #2321
Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
yarn lint
You can also remove the word "copyright" from an existing CSS file and check that
yarn lint
fails.Related PRs
N/A