I realized the width of file in GitHub is much wider than '80' (I set 'rulers' in visual studio code as 80). My files are not beautifully displayed. What value should I set on the 'rulers' in my editor?
Choosing the maximum length of your lines based on what will be "beautiful" on GitHub is ridiculous. There are plenty of good reasons to limit line length (though many programmers go beyond 80 characters these days). Shorter lines are easier to read and can help limit complexity.
The JavaScript snippet you show in your screenshot doesn't appear to contain any "artificial" line breaks. What are you planning to do, cram multiple statements onto a single line just to use up columns? How easy would that be to read?
Select a line length limit to use for your project (80 and 120 characters are popular lengths) and stick with it. If you adopt an existing style guide it will probably come with its own limits. Please, don't choose this based on how it renders on GitHub.
For prose, paragraphs automatically wrap unless you add hard breaks by ending lines with two or more spaces.