Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 547 Bytes

80-characters-per-line.md

File metadata and controls

25 lines (19 loc) · 547 Bytes

80 Characters Per Line

Limit your lines to 80 characters. This is useful if you sometimes work in a terminal like me and useful when doing diffs in split screens.

JavaScript

Right:

if (true) {
  var email = '[email protected]';
  var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  var isEmail = regex.test(email);
}

Wrong:

if (true) {
  var email = '[email protected]';
  var isEmail = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(email);
}