Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude long strings from ESLint max-len rule #992

Merged
merged 2 commits into from
May 9, 2024

Conversation

Cruikshanks
Copy link
Member

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.

DEFRA/water-abstraction-team#115

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

There are times we need to include long pieces of text, build strings from verbose variable names or reference URLS that will cause us to go over 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 types from the rule.
@Cruikshanks Cruikshanks self-assigned this May 8, 2024
@Cruikshanks Cruikshanks added the conventions Changes to tools that enforce our conventions label May 8, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review May 8, 2024 11:35
@Cruikshanks Cruikshanks merged commit c7f77df into main May 9, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-exclusions-to-max-len-rule branch May 9, 2024 07:46
Cruikshanks added a commit that referenced this pull request May 12, 2024
DEFRA/water-abstraction-team#115

In [Exclude long strings from ESLint max-len rule](#992) we updated our ESLint [max-len](https://eslint.style/rules/js/max-len) to exclude long strings or template literals from being flagged as issues.

That reduced the noise (there were lots of infractions!) and helped us see actual long lines of logic which should be refactored.

This fixes all the remaining `max-len` infractions.
Cruikshanks added a commit that referenced this pull request May 12, 2024
DEFRA/water-abstraction-team#115

In [Exclude long strings from ESLint max-len rule](#992) we updated our ESLint [max-len](https://eslint.style/rules/js/max-len) to exclude long strings or template literals from being flagged as issues.

That reduced the noise (there were lots of infractions!) and helped us see actual long lines of logic which should be refactored.

This fixes all the remaining `max-len` infractions.
Cruikshanks added a commit that referenced this pull request May 12, 2024
DEFRA/water-abstraction-team#115

In [Exclude long strings from ESLint max-len rule](#992) we updated our ESLint [max-len](https://eslint.style/rules/js/max-len) to exclude long strings or template literals from being flagged as issues.

That reduced the noise (there were many infractions!) and helped us see long lines of logic that should be refactored.

This fixes all the remaining `max-len` infractions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conventions Changes to tools that enforce our conventions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants