Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 63db340

Browse files
committed
Preset: add requireCamelCaseOrUpperCaseIdentifiers to google preset
See http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml?showone=Naming#Naming > Optional function arguments start with opt_. > Functions that take a variable number of arguments should > have the last argument named var_args. Ref #1900
1 parent c1d277c commit 63db340

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

presets/google.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
"catch"
1010
],
1111
"requireOperatorBeforeLineBreak": true,
12-
"requireCamelCaseOrUpperCaseIdentifiers": true,
12+
"requireCamelCaseOrUpperCaseIdentifiers": {
13+
"allowedPrefixes": ["opt_"],
14+
"allExcept": ["var_args"]
15+
},
1316
"maximumLineLength": {
1417
"value": 80,
1518
"allExcept": ["comments", "regex"]

test/data/options/preset/google.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ var opts = nopt({
55
version: Boolean
66
});
77

8+
// requireCamelCaseOrUpperCaseIdentifiers
9+
function test(opt_test) {
10+
var var_args = arguments;
11+
}
12+
813
// disallowMultipleLineBreaks
914
// disallowMultipleVarDecl
1015
var insight = new Insight({

0 commit comments

Comments
 (0)