I wrote a JS module for detecting indentation some years ago. I ended up with an algorithm [0] that looks for the most common difference between two consecutive non-empty lines.
[0]: https://github.com/sindresorhus/detect-indent#algorithm
[0]: https://github.com/sindresorhus/detect-indent#algorithm
No comments yet.