You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionsnake_case_string(str){returnstr&&str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(s=>s.toLowerCase()).join('_');}exportdefault(properties,_,{ path })=>{constresults=[];for(const[property,_]ofObject.entries(properties)){constexpectedPropertyName=snake_case_string(property);if(property!==expectedPropertyName){results.push({message: `Property MUST follow snake-case. Expected property "${property}" to be called "${expectedPropertyName}"`,path: [...path,property],});}}returnresults;};
The text was updated successfully, but these errors were encountered:
User story.
As a user, I want to force the snake_case format for all properties.
Describe the solution you'd like
I think it makes sense for the rule to only focus on a single format, but maybe in the future, it makes sense?
I want this rule to be part of the built-in ruleset.
Additional context
The way I am currently enforcing it, is through the rule:
And with the function:
The text was updated successfully, but these errors were encountered: