From 59aff4c63bb2b5f4882c34bf0fbd551eecc9668b Mon Sep 17 00:00:00 2001 From: Alan Cruikshanks Date: Wed, 8 May 2024 09:26:03 +0100 Subject: [PATCH] Use @stylistic/eslint-plugin-js for max-len rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/DEFRA/water-abstraction-team/issues/115 In [Add linting using eslint with standard as the base](https://github.com/DEFRA/water-abstraction-system/pull/948) we switched from using [standard](https://www.npmjs.com/package/standard) directly for linting to using [ESlint](https://eslint.org/). This is all part of work we are doing to start codifying our conventions rather than writing them up for no one to read! 😁 As a start, we enabled the rule [max-len](https://eslint.org/docs/latest/rules/max-len) which **standard** doesn't have. That flagged some long text strings we have, and we don't want to break them up just for the sake of the linter. So, we went to check what options there are for the rule and found this > This rule was **deprecated** in ESLint v8.53.0. Please use the [corresponding rule](https://eslint.style/rules/js/max-len) in [@stylistic/eslint-plugin-js](https://eslint.style/packages/js). But it looks like ESLint has moved on a bit since we last used it and has chosen to [move some of its core stylistic based rules to a plugin](https://eslint.style/packages/js). This change switches to using the plugin to lint `max-len`. It also updates the config to exclude strings and template literals from the rule.