The recommended max-len value in JavaScript and ESLint
When working with JavaScript and ESLint, the recommended maximum value for max-len
depends on personal preference and project requirements.
By default, ESLint sets the max-len
rule to 80, meaning each line should not exceed 80 characters. However, many developers find this limit too restrictive, especially in modern web development where there are often long URLs, complex expressions, and other reasons why lines might exceed this limit.
Some developers prefer a max-len
value of 120, while others prefer even higher values such as 150. However, it's important to keep in mind that longer lines can reduce code readability, especially if they contain multiple statements or complex expressions.
Ultimately, the recommended max-len
value will depend on the specific project and team preferences. It's important to choose a value that strikes a balance between code readability and practicality.