Skip to content
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

Formatage des exemples avec prettier #106

Merged
merged 4 commits into from Feb 14, 2017

Conversation

DirtyF
Copy link
Collaborator

@DirtyF DirtyF commented Feb 13, 2017

J'ai laissé les options par défaut, je te laisse voir ce que tu préfères.

mise à jour: utilisation de https://github.com/kentcdodds/prettier-eslint

@thom4parisot
Copy link
Owner

C'est une bonne idée mais ça fait pas le même travail, faut garder les deux (prettier pour formatter, eslint pour gueuler sur des éléments de syntaxe incorrect, etc.) et surtout l'intégrer au cycle de travail, genre en pre-commit ou autre.

Je fais pas mal de commits atomiques et j'ai pas encore trouvé de moyen où l'automatisme me dégomme pas les commits partiels :-(

@DirtyF
Copy link
Collaborator Author

DirtyF commented Feb 13, 2017

@oncletom OK donc j'ai utilisé prettier-eslint à la place et je lance la commande de test (format && lint) en pre push grâce à husky.

T'en penses quoi ?

"lint": "eslint --ignore-path .gitignore --fix '**/*.js'",
"test": "exit 0",
"posttest": "npm run lint"
"posttest": "npm run format && npm run lint",
"prepush": "npm t"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ça fait quoi npm t ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c'est un raccourci pour npm run test

@thom4parisot
Copy link
Owner

Oui ça me paraît cool comme ça – j'avais pas pensé au pre-push !

@DirtyF
Copy link
Collaborator Author

DirtyF commented Feb 14, 2017

Cette série sur les scripts npm est instructive : https://egghead.io/lessons/tools-run-npm-scripts-with-git-hooks

@thom4parisot
Copy link
Owner

@DirtyF cool je vais mater ça merci :-) J'adore husky, l'intégration avec les scripts npm c'est exactement ça qu'il faut.

@thom4parisot thom4parisot merged commit bf5e89b into thom4parisot:master Feb 14, 2017
@thom4parisot
Copy link
Owner

Follow-up avec les auteurs du module prettier/prettier-eslint-cli#11

@DirtyF DirtyF deleted the prettier-examples branch February 14, 2017 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants