Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Defaults in eslint plugin to avoid config code #931

Open
1 task
BioPhoton opened this issue Feb 12, 2025 · 0 comments
Open
1 task

Defaults in eslint plugin to avoid config code #931

BioPhoton opened this issue Feb 12, 2025 · 0 comments

Comments

@BioPhoton
Copy link
Collaborator

BioPhoton commented Feb 12, 2025

User story

As a developer I want to have smart defaults to have as little setup time as possible.
ATM I have to think about the file patters when I set up the eslint plugin.

code-pushup.config.ts

export default {
  // ...
  plugins: [
    eslintPlugin({
        patterns: "."  // 👈 required property
    })
  ]
}

As new user it can be even more cumbersome to think about the file pattern as you might coe from other tools that default the pattern away.

Nx for example falls back to "." by default:

If I run nx run prj:lint internally "." is used as file pattern.
Image

Acceptance criteria

  • if no patters is given "." is used as default value

Implementation details

const eslintTargetObjectSchema = z.object({
  eslintrc: eslintrcSchema.optional(),
  patterns: patternsSchema.optional(), // 👈 optional property
});

code-pushup.config.ts

export default {
  // ...
  plugins: [
    eslintPlugin()  // 👈 no setup config needed
  ]
}
@BioPhoton BioPhoton changed the title Defaults in eslint plugin config Defaults in eslint plugin to avoid config code Feb 12, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant