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

Allow config as a function to create custom configs with access to dirs #375

Closed
2 of 4 tasks
enkot opened this issue Apr 2, 2024 · 0 comments
Closed
2 of 4 tasks

Comments

@enkot
Copy link

enkot commented Apr 2, 2024

Describe the feature

It would be great to allow users to create custom configs based on the Nuxt layers/dirs.
Use case:

export default withNuxt()
  .append((options) => {
    const { dirs } = resolveOptions(options)

    return {
      name: 'custom:layer-based-config',
      files: dirs.src?.map(srcDir => join(srcDir, `config/*.${GLOB_EXTS}`)) || []),
      rules: {
        // some rules for config directory files inside each layer
      },
    }
  })

It can be done with eslint:config:addons hook, but it is not the easiest way.

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

@enkot enkot changed the title Allow config as a function that takes options object Allow config as a function to create custom configs with access to dirs Apr 2, 2024
@antfu antfu closed this as completed in 84b7891 Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant