% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/expect_type_linter.R
\name{expect_type_linter}
\alias{expect_type_linter}
\title{Require usage of \code{expect_type(x, type)} over \code{expect_equal(typeof(x), type)}}
\usage{
expect_type_linter()
}
\description{
\code{\link[testthat:inheritance-expectations]{testthat::expect_type()}} exists specifically for testing the storage type
of objects. \code{\link[testthat:equality-expectations]{testthat::expect_equal()}}, \code{\link[testthat:equality-expectations]{testthat::expect_identical()}}, and
\code{\link[testthat:logical-expectations]{testthat::expect_true()}} can also be used for such tests,
but it is better to use the tailored function instead.
}
\examples{
# will produce lints
lint(
  text = 'expect_equal(typeof(x), "double")',
  linters = expect_type_linter()
)

lint(
  text = 'expect_identical(typeof(x), "double")',
  linters = expect_type_linter()
)

# okay
lint(
  text = 'expect_type(x, "double")',
  linters = expect_type_linter()
)

}
\seealso{
\link{linters} for a complete list of linters available in lintr.
}
\section{Tags}{
\link[=best_practices_linters]{best_practices}, \link[=package_development_linters]{package_development}, \link[=pkg_testthat_linters]{pkg_testthat}
}
