feat: add flat config presets
Fixes https://github.com/schoero/eslint-plugin-better-tailwindcss/issues/148
ESLint docs suggest to not go for "flat/recommended" or flat.recommended. Instead, it is advised to prefix rc configs with legacy-* and reserve 'plain' object keys for the new configs. This is a breaking change, yes.
Context (similar problem in eslint-plugin-react-hooks):
- Official docs: https://eslint.org/docs/latest/extend/plugin-migration-flat-config#backwards-compatibility
- https://github.com/facebook/react/pull/34994
- POV of ESLint maintainer: https://github.com/eslint/eslint/issues/18095#issuecomment-1952981425
Given that this PR has not been merged yet, might be worth one-shoting the naming in eslint-plugin-better-tailwindcss@4. Just deleting rc configs and supporting Flat configs only would not be a bad move too, given that ESLint v10 is coming. This will allow dropping CommonJS.
I've been using 4.0.0-beta.3 in a few projects and it works like a charm!
If there is a major release planned, I'd agree with @kachkaev that flat config should be the default