Hi Slavik, There isn't a way to do this. ESLint is designed so that the rule severity is determined only by the config and cannot be read from inside a processor.
It sounds like you're implementing rules inside of the processor, which isn't a supported use of processors (processors are meant to convert a format that ESLint doesn't understand into one that it does). A better approach would be to create a custom parser designed to parse JSON into an AST that ESLint can understand. Then you can implement your rules in a plugin and have them work like any other rule. I hope this helps. On Sun, Dec 24, 2017 at 11:57 PM Slavik Lvovsky <[email protected]> wrote: > Hi Experts, > > Is it possible somehow to get a rule severity from the rule itself ? > I work on some hybrid solution which will enable me to run and configure > rules for .json files. > > Currently the only problem i have is that i need to get rule severity and > pass it to json processor. > I can set the severity in json processor to be some constant but i want my > clients to configure it , as a regular rule, from config file. > > Regards, > Slavik. > > -- > You received this message because you are subscribed to the Google Groups > "ESLint" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "ESLint" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
