bahmutov / eslint-rules

My custom eslint rules in addition to the ones provided at http://eslint.org/
97 stars 16 forks source link

Camel Case with 3rd Party libraries #9

Open tb01923 opened 8 years ago

tb01923 commented 8 years ago

Thanks for the tools! I am pushing my team to write point free JS and these are useful. I am facing a dilema on the camelcase rule. I would like to error on non-camel case names. I am using a third party library whcih violates this.

const transformNode = R.map(node => {
    const fixed = {}
    fixed.name = node.name
    fixed.chefEnvironment = node.chef_environment
    fixed.platform = node.automatic.platform
    fixed.platformVersion = node.automatic.platform_version
    fixed.platformFamily = node.automatic.platform_family
    fixed.address = node.automatic.ipaddress
    fixed.runList = node.run_list

    return fixed
})

I wonder if it would be better if the rule was enforced only on object definition or the left side of an assignment?

THoughts?