Let $X$ be a nonetherian integral separated scheme which is regular in codimension one, i.e. every local ring $\mathscr{O}_x$ of $X$ of dimension one is regular.
Let $Y$ be a prime divisor, i.e. a closed integral subscheme of codimension one. Let $\eta$ be the generic point of $Y$, meaning the closure of $\{\eta\}$ will be $Y$. Hartshorne claims that $\mathscr{O}_{\eta,X}$ is a discrete valuation ring (Algebraic Geometry, page 130) without even any sketch of a proof so I try to fill the gap and understand the valuation of a prime divisor better.
My question is, how to show that $\dim\mathscr{O}_{\eta,X}=1$? If this is shown then $\mathscr{O}_{\eta,X}$ is automatically a discrete valuation ring.
When $X$ is an integral scheme of finite type over a field, for a closed subset of $X$, we have $$ \operatorname{codim}(Y,X)=\inf\{\dim\mathscr{O}_{P,X}:P \in Y\}. $$ But this does not apply to a noetherian scheme because noetherian scheme is not necessarily of finite type over a field. However, I wonder if it is possible to associate the dimension of $\mathscr{O}_{\eta,X}$ to the codimension of $Y$ over $X$.
One finds the following text on Algebraic Geometry I: Schemes - With Examples and Exercises by Ulrich Görtz and Torsten Wedhorn, section 5.8 (thank @eggplant for the reference) that answers the question neatly:
If we put $Y$ into the identity above we get $\dim\mathscr{O}_{\eta,X}=1$.