rrd108 / vue-mess-detector

A static code analysis tool for detecting code smells and best practice violations in Vue.js and Nuxt.js projects
MIT License
226 stars 9 forks source link

feat: enable override option in config object (#276) #279

Closed David-Pena closed 2 months ago

David-Pena commented 2 months ago

Summary

Enable override field in vue-mess-detector.json to overwrite the max value for functionSize and scriptLength.

Proposal

The feedback received in our discord server from @jonathan-terrell about some "hardcoded" limits in our rules helped me align what do I think its one of the best usage for this tool. It's okay to be a bit opinionated but to provide a way for you to setup some of those opinions its a powerful feature for team work.

In my day-to-day job I manage at least two small teams where this overwrite was what it was missing for it to couple perfectly into our workflows.

I think this feature will attract more users 👀

Description

Related Issues

Fixes #276

Type of Change

Screenshots (if applicable)

With this vue-mess-detector.json

{
    "apply": "functionSize,scriptLength",
    "group": "file",
}

image image

Now we include our override options:

{
    "apply": "functionSize,scriptLength",
    "group": "file",
    "override": {
        "maxFunctionSize": 50
    }
}

image image

{
    "apply": "functionSize,scriptLength",
    "group": "file",
    "override": {
        "maxFunctionSize": 50,
        "maxScriptLength": 250
    }
}

With this increase, we have no reports for scriptLength rule image

Updated docs ⬇️ image image