Skip to content

Commit 353d24d

Browse files
committed
JS: enforce camel case (#38)
We seem to be bad at sticking to this rule, so I think it's worth enforcing it. I think part of why we haven't done this before is that we were afraid of triggering this on code interacting with JSON fields from API responses, which generally *are* underscored. From my local testing, I actually don't think that's a concern: the rule seems to trigger on assignment/creation (`var foo_bar`, `{ name_blah: true}`, etc.), but not access (e.g. `thing.foo_bar()` and `thing["attr_name"]` don't trigger this). Thoughts, @codeclimate/review?
1 parent 29c5ebb commit 353d24d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

javascript/eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ module.exports = {
33
"node": true, // When in a backend context
44
"browser": true, // When in a web context
55
"jquery": true, // When in a web context
6-
"es6": true,
6+
"es6": true, // When using ES6 features
77
},
88
"rules": {
99
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
10+
"camelcase": [2, { "properties": "always" }],
1011
"comma-style": [2, "first", { exceptions: {ArrayExpression: true, ObjectExpression: true} }],
1112
"complexity": [2, 6],
1213
"curly": 2,

0 commit comments

Comments
 (0)