Skip to content

Support linting + formatting with pre-commit hook #169

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

Merged
merged 5 commits into from
Oct 17, 2018

Conversation

liangchunn
Copy link
Contributor

Description

This PR enforces linting with prettier, eslint and tslint for the project by leveraging pre-commit looks with husky and lint-staged

  • Upgraded tslint, eslint packages
  • Added prettier, tslint-config-prettier (to disable conflicting rules), husky, and lint-staged packages
  • Ran prettier for files matching src/**/*.{ts,json} and src/**/*.js files once
  • Hand off eslint and tslint styling rules, like spacing, and semicolons, to prettier with a pre-commit hook (needs review)
  • Run yarn lint in CI

I've tested the pre-commit hooks, and they seem to be working fine.

"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be removed once #166 is merged, or the object spread is migrated to Object.assign in index.spec.js#L26 and vue.spec.js#27 due to node6 compat

@johnnyreilly
Copy link
Member

Great work! @piotr-oles are you happy for us to merge this? I think it'll make inconsistent styling a thing of the past; we're using prettier with good results in ts-loader.

@johnnyreilly
Copy link
Member

I'm going to be bold and assume @piotr-oles is fine with this 😄

@johnnyreilly johnnyreilly merged commit aa4a97e into TypeStrong:master Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants