Skip to content

Commit

Permalink
Exclude long strings from ESLint max-len rule (#992)
Browse files Browse the repository at this point in the history
DEFRA/water-abstraction-team#115

Whilst we should be making every effort to keep lines shorter than 120 characters the intent of the rule is to stop folks from stringing together complex one-liners.

Sometimes we need to include long pieces of text, build strings from verbose variable names or reference URLS that will cause us to exceed the limit.

We don't want to make them more complex just for the sake of a linter. So, we add this config to exclude these lines of these types from the rule.
  • Loading branch information
Cruikshanks authored May 9, 2024
1 parent 9405ea6 commit c7f77df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ module.exports = {
],
rules: {
'@stylistic/js/max-len': ['error', {
code: 120
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreUrls: true
}]
}
}
Expand Down

0 comments on commit c7f77df

Please sign in to comment.