# Restart line numbers after every chapter

I am using the lineno package to add line numbers to my document. Is there a way to restart the numbering after every chapter?

There is an option called pagewise which restarts line numbering on every page. But I'm looking for something like "chapterwise" numbering.

MWE

\documentclass[12pt,a4paper]{report}
\usepackage{blindtext}
\usepackage{lineno}
\linenumbers

\begin{document}

\chapter{First}
\blindtext[5]

\chapter{Second}
\blindtext[5]

\end{document}


You can add \resetlinenumber before \chapter.

Automating it is maybe better:

\documentclass[12pt,a4paper]{report}
\usepackage{lineno}
\usepackage{etoolbox}

\usepackage{blindtext}

\preto{\chapter}{\resetlinenumber}

\linenumbers

\begin{document}

\chapter{First}
\blindtext[5]

\chapter{Second}
\blindtext[5]

\end{document}