Skip to content

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

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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

🎁

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions