alphagov / govuk-design-system

One place for service teams to find styles, components and patterns for designing government services.
https://www.gov.uk/design-system
MIT License
498 stars 231 forks source link

eslintrc.js is about to be deprecated #3649

Open domoscargin opened 6 months ago

domoscargin commented 6 months ago

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

patrickpatrickpatrick commented 4 months ago

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 commented 4 months ago

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.

romaricpascal commented 3 months ago

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

voxpelli commented 3 months ago

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

patrickpatrickpatrick commented 1 month ago

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 commented 3 days ago

https://github.com/import-js/eslint-plugin-import/pull/2996 looks like this will soon be updated to v9 which will mean the last blocker has been removed

patrickpatrickpatrick commented 3 days ago

https://eslint.org/version-support/#current-release-lines v8 will soon be deprecated