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

run tsc -noemit on Typescript files during lint-staged #135

Merged
merged 1 commit into from
Apr 18, 2020

Conversation

AndrewCsontos
Copy link
Contributor

What
For TypeScript projects, developers would like to verify that their .ts and .tsx files compile in the lint-staged stop by running
tsc -noemit

Format, lint and test were running on .ts and .tsc files, but nothing was checking that TypeScript code compiled correctly.

Why
Enable safer Typescript development

How
Used ifTypeScript from utils to check if TypeScript is enabled.
If enabled, run tsc --noEmilt on all .ts and .tsx files

  • Documentation
  • Tests
  • Ready to be merged

I ran tests with a local project, but did not see a good way to test within this project. If you have ideas, let me know and i'll implement them.

…pt" (#1)

* Run tsc on staged files when TypeScript is enabled
@codecov
Copy link

codecov bot commented Apr 18, 2020

Codecov Report

Merging #135 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #135   +/-   ##
=======================================
  Coverage   87.65%   87.65%           
=======================================
  Files          18       18           
  Lines         332      332           
  Branches       78       78           
=======================================
  Hits          291      291           
  Misses         34       34           
  Partials        7        7           
Impacted Files Coverage Δ
src/config/lintstagedrc.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 225cbdb...15c3731. Read the comment docs.

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Super 👍

@kentcdodds kentcdodds merged commit 03172ac into kentcdodds:master Apr 18, 2020
@kentcdodds
Copy link
Owner

🎉 This PR is included in version 5.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants