cli icon indicating copy to clipboard operation
cli copied to clipboard

Defaults in eslint plugin to avoid config code

Open BioPhoton opened this issue 10 months ago • 0 comments

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 avatar Feb 12 '25 09:02 BioPhoton