AntonNiklasson / eslint-plugin-knex

Lint rule(s) for Knex.js
9 stars 8 forks source link

Optionally add havingRaw, orderByRaw, groupByRaw #14

Open ITsvetkoFF opened 3 years ago

ITsvetkoFF commented 3 years ago

Have you considered other Raw methods to be added (probably as separate rules)? Any ideas? :)

AntonNiklasson commented 3 years ago

I have thought about it. We could probably add them to avoid-injections without too much hassle. Do you have any sample code that we can use as test cases? 🤗

ITsvetkoFF commented 3 years ago

not something I can share :) adding to avoid-injections is simple but may be a breaking change for current users of a rule.

as I understand rules can include some parameters - so ideally usage could be

{
  "plugins": ["knex"],
  "rules": {
    "knex/avoid-injections": [ "error", {includeOrderBy: true, includeHaving: true, includeGroupBy: true}
  }
}

(if you want some help in form of PR just let me know)

ghost commented 2 years ago

Thanks, another one to cover would be orWhereRaw