Skip to content

Conversation

@benedictleejh
Copy link
Contributor

πŸ”— Linked issue

resolves #606

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Currently, the nuxt-sort-config-keys rule only applies to a file named nuxt.config.{ts,js,mts,mjs,tsx,jsx}. This prevents people from using the rule to sort config files they may extract from the main Nuxt config due to e.g. file size. The rule is updated to remove the early return when the filename does not match nuxt.config.{ts,js,mts,mjs,tsx,jsx}.

As Nuxt supports the config-dir proposal, the default setup for nuxt/sort-config has been expanded to support .config/nuxt.{ts,js,mts,mjs,tsx,jsx} as well, following conventions from the proposal. Any other filename may be easily added using a user's own ESLint config.

This allows users to use this rule in their ESLint configs with other files as this rule would skip processing any file not matching the name, effectively ignoring ESLint configs applying it to other files
…onfig`

Nuxt supports the [config-dir proposal](https://github.com/pi0/config-dir) in the code, though it seems to be left out of the docs at the moment.

This commit only directly supports the convention for configs as defined in the proposal (i.e. `.config/<toolname>.<ext>`). For other filenames, users can use the rule in their own ESLint configs
@antfu antfu merged commit be2e993 into nuxt:main Nov 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow nuxt/nuxt-config-keys-order rule to be used on files chosen by the user

2 participants