Skip to content

Defaults in eslint plugin to avoid config code #931

@BioPhoton

Description

@BioPhoton

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
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions