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
119 stars 6 forks source link

Add cli option to `ignore` and `apply` rulesets/rules #63

Closed rrd108 closed 2 weeks ago

rrd108 commented 1 month ago

Discussed in https://github.com/rrd108/vue-mess-detector/discussions/62

Originally posted by **David-Pena** July 18, 2024 Now that you mentioned adding a `group` flag to the `analyze` command in #5, I was wondering what do you think about a feature to toggle on/off rules? (Being this package kind of opinionated for some rules) And I picture this like though the `analyze` command too, like with the flag `toggle` it will prompt like a CLI to select wich rules you want to apply to the check or not. But I have no idea how can that be done, or if its worth it so I'll just let the idea here in discussion 👨‍💻
rrd108 commented 1 month ago
David-Pena commented 1 month ago

Let me know if you need any help with the pending TODOs 👀

rrd108 commented 1 month ago

I think I will finish this one. You already assigned yourself to a couple others :smile:

David-Pena commented 1 month ago

haha, I got excited! keep going then 👌

FauconFan commented 3 weeks ago

Hey!

Is it possible to specify the rules to apply (or ignore) into a config file also? This is useful when it comes to sharing the same standards across a team.

cli arguments are good, but keeping them in a config file means consistency!

Ty for this software, this is a good linter :)

We discussed about it here: https://x.com/radharadhya/status/1825913771413426300

rrd108 commented 3 weeks ago

new issue added #161

David-Pena commented 3 weeks ago

Let me take this issue @rrd108

David-Pena commented 2 weeks ago

Kind of struggling here rethinking the logic to use the same flags for rulesets and specific rules...

I'll try something and if it doesnt lead me to anything I'll push changes so you check it out and give me a hint 😅

rrd108 commented 2 weeks ago

My idea was this

--apply=vue-strong,nestedTernary

The script make an array of the param and then check the array elements. If it is a ruleset it adds all rule from the ruleset. If it is a rule it adds the rule. So in the end the apply array has a list of rules to apply.

David-Pena commented 2 weeks ago

I think I have it @rrd108 , I'll update you through the day

image

Now Ill do the --ignore flag

David-Pena commented 2 weeks ago

Hi @FauconFan

I created a PR for this, soon you will be able to test this feature 🚀