> It's probably good enough to just always split on /\r?\n/.

I tried that first, but this causes problems in `line_endings` linting, in precisely the case that Unix line endings are to be enforced (because the `\r` disappears).

Hence the branching on `line_endings` to force splitting by only `\n` if Unix should be enforced (then `\r` is illegal and should be detected). In all other cases (`line_endings` set to `ignore`, or `value` other than `'unix'`), either of `\n`, `\r\n` is an acceptable line break. So I think all cases are covered.

Maybe you see an easier solution (with no rule sniffing), this was just a quick fix I came up with.