govuk-design-system icon indicating copy to clipboard operation
govuk-design-system copied to clipboard

eslintrc.js is about to be deprecated

Open domoscargin opened this issue 11 months ago • 7 comments

What

We're using an .eslintrc.js file to configure our eslint. This is due to be deprecated in eslint 9.0.0, and has caused some issues with eslint plugins.

We should look into updating to the new eslint.config.js style.

Who needs to work on this

Developer

Who needs to review this

Developer

Done when

  • [ ] Our eslint config is in the new style.

domoscargin avatar Mar 11 '24 17:03 domoscargin

The plugins used by our config for eslint also have to support the new 'flat config' format before we can make this upgrade. I will watch these issues and update this list when they are merged.

Library Ready
eslint
eslint-config-standard ❌ (need to change to new plugin)
eslint-config-prettier
eslint-plugin-import import-js/eslint-plugin-import#2948
eslint-plugin-n
eslint-plugin-promise ✅ (if updated to latest version)
eslint-plugin-jest

patrickpatrickpatrick avatar May 07 '24 15:05 patrickpatrickpatrick

The latest update to this is that standard is now no longer going to be maintained and has splintered into a different plugin neo-standard. I guess this means that the eslint-config-standard is no longer maintained also and so we need to change to a different plugin.

patrickpatrickpatrick avatar Jun 03 '24 09:06 patrickpatrickpatrick

Discovered that ESLint recently introduced a configuration migrator, taking advantage of the FlatConfig class for compatibility. This might come handy for making the jump.

romaricpascal avatar Jun 13 '24 16:06 romaricpascal

neostandard is indeed like eslint-config-standard, but using ESLint 9 and Flat Config from the ground up, and more importantly: Has an open governance model

Feedback and questions are welcome 🙏

Since you use prettier as well the new option to deactivate style rules in neostandard should be welcome for you, may make eslint-config-prettier redundant

voxpelli avatar Jul 04 '24 22:07 voxpelli

https://github.com/un-ts/eslint-plugin-import-x this is a fork of eslint-plugin-import that seemingly does support v9 (but not flat config). Could spike into updating to v9 and using this instead of plugin-import (which doesn't seem to have had any movement at all as of late).

patrickpatrickpatrick avatar Aug 28 '24 09:08 patrickpatrickpatrick