Skip to content
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

fix: add name field to @stylistic/eslint-plugin configuration #374

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

chadwickellis
Copy link
Contributor

This pull request introduces the implementation of the proposed name field within the @stylistic/eslint-plugin configuration, addressing the feature request for enhanced configuration clarity and simplicity. By integrating a name field, we enable users to directly and intuitively identify and modify the configuration.

Changes Made:

  • Added a name field to the configuration objects within @stylistic/eslint-plugin, allowing for straightforward identification.

Benefits:

  • Improved Clarity: Directly identifying configurations by name enhances the understandability of the configuration process.
  • Reduced Complexity: Eliminates the need to inspect the plugins array, simplifying the configuration adjustment steps.
  • Enhanced Developer Experience: Streamlines the process of modifying ESLint rules, making it more accessible and less error-prone.

Examples:
The following code snippet illustrates how a configuration named nuxt:stylistic can now be easily modified:

import { createConfigForNuxt, defineFlatConfigs } from '@nuxt/eslint-config/flat'

export default defineFlatConfigs(
  createConfigForNuxt().then((configs) => {
    return configs.map((config) => {
      return config.name === 'nuxt:stylistic'
        ? {
            ...config,
            rules: {
              ...config.rules,
              // Rule configuration here…
            },
          }
        : config
    })
  }),
)

I look forward to your feedback and any further suggestions for improvement.

@antfu antfu merged commit d45b250 into nuxt:main Apr 3, 2024
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.

None yet

2 participants