Skip to content

Conversation

@Lukas-Kullmann
Copy link
Contributor

What:

Removed compiling of types tests during linting.

Why:

Type tests could contain "negative" tests (i.e. dtslint's $ExpectError). See testing-library/dom-testing-library#572 for more context.

How:

I changed the globs to not include the files in types/__tests__. Unfortunately, I had to split up the glob into two since micromatch does not support testing for multiple consecutive directories.

Checklist:

  • Documentation n/a
  • Tests n/a
  • Ready to be merged

@codecov
Copy link

codecov bot commented May 15, 2020

Codecov Report

Merging #141 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #141   +/-   ##
=======================================
  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% <ø> (ø)

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 8899fe9...6884b52. Read the comment docs.

@kentcdodds
Copy link
Owner

Thanks for this! Is there any way to just get tsc to ignore a glob rather than simply not running tsc on the files? I'd like to eventually be able to run tsc --noEmit on the whole project (not during pre-commit) and have it skip those files as well. Is there a way to do this?

@Lukas-Kullmann
Copy link
Contributor Author

Yes. You can add the files to the exclude section of the tsconfig file. You would add the file (or folder) to that exclude section and pass the file to the tsc call.

The problem with that specific project (dom testing library) is that the tsconfig file is not in the root folder. So I don't know a good heuristic to determine the location of the tsconfig. In projects written entirely in typescript, it would be in the root folder, in other projects it would be in a specific subfolder only.

So I'm not sure how to do that. Would requiring a tsconfig in the root of the project be too much of a requirement for projects like dom testing library (that only wants to provide some types for the otherwise pure js codebase)?

@kentcdodds
Copy link
Owner

Yeah, I'm ok with moving the tsconfig.json to the root in dom-testing-library and just requiring that for everyone.

With that in mind, I think we can probably close this PR (sorry about the trouble, thanks for taking the time) and instead just move the tsconfig.json.

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