-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add prettier #2
Add prettier #2
Conversation
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.
👌
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.
Bonne idée d'ajouter des outils pour uniformiser le formattage ! Par contre, je ne suis pas sûre qu'on devrait ajouter le folder .vscode
à git. Le formattage automatique ne fonctionnera pas pour quelqu'un qui utilise un autre éditeur de code, et ça peut faire des conflits, ou mener quelqu'un à push sa config personnelle sur git.
À la place, je crois que c'est possible de seulement mettre la config de prettier dans le package.json.
} from "reactstrap"; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Button, NavItem, NavLink, Nav, Container, Row, Col, UncontrolledTooltip } from 'reactstrap'; |
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.
Pour les importations, je préfère quand on laisse chaque élément sur une ligne différente (on voit plus facilement quel nouvel item on ajoute quand on fait un diff par exemple).
Après avoir vérifié comment changer la configuration de prettier pour faire cela, il semble qu'il n'y ait présentement que des hacks... (voir prettier/prettier-vscode#352 (comment) et prettier/prettier#2550).
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.
J'utilisais déjà Prettier à la base et la config par défaut met les dépendances sur plusieurs lignes
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.
Qu'est-ce qu'on fait finalement?
.vscode/.prettierrc.yaml
Outdated
@@ -0,0 +1,5 @@ | |||
trailingComma: 'all' | |||
tabWidth: 4 |
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.
Pour du react, surtout avec du jsx, je préfère du 2 espaces plutôt que du 4. Pour du css, je crois que la norme est généralement de 2 espaces aussi.
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.
Je vais le changer
Les fichiers css et scss provenant de assets/ ne nous appartiennent pas (ils proviennent du thème que nous utilisons). Il n'est alors pas nécessaire de les formatter. |
Je vais revert et maybe faire une PR pour les fetch depuis un CDN |
https://demos.creative-tim.com/argon-dashboard-react/#/documentation/download |
No description provided.