Skip to content

🚀 Feature: Simplify ESLint config's yml portions #2208

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

Open
2 tasks done
JoshuaKGoldberg opened this issue Apr 15, 2025 · 0 comments
Open
2 tasks done

🚀 Feature: Simplify ESLint config's yml portions #2208

JoshuaKGoldberg opened this issue Apr 15, 2025 · 0 comments
Labels
status: needs investigation Further research required...? type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

Feature Request Checklist

Overview

The ESLint config generated by CTA's Everything preset contains over a dozen lines dedicated to YML normalization:

{
extends: [yml.configs["flat/recommended"], yml.configs["flat/prettier"]],
files: ["**/*.{yml,yaml}"],
rules: {
"yml/file-extension": ["error", { extension: "yml" }],
"yml/sort-keys": [
"error",
{ order: { type: "asc" }, pathPattern: "^.*$" },
],
"yml/sort-sequence-values": [
"error",
{ order: { type: "asc" }, pathPattern: "^.*$" },
],
},
},

That's ~15% of the default generated ESLint config. Not ideal. I'm trying to reduce the ESLint config over time to make it more approachable.

Most of those lines come from the manual enabling rules object. It'd be nice to, if possible, remove that rules object - but I also want to keep those three rules enabled.

Investigation required, maybe >=1 of the following is the solution?:

  • Would eslint-plugin-yml accept a PR to add those sorting rules to some more pedantic/stylistic preset?
  • Would eslint-plugin-perfectionist actually be a better place for key sorting?

Additional Info

🎁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs investigation Further research required...? type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

1 participant