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

Commit

Permalink
Preset: add requireCamelCaseOrUpperCaseIdentifiers to google preset
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markelog committed Jan 24, 2016
1 parent c1d277c commit 63db340
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion presets/google.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"catch"
],
"requireOperatorBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCamelCaseOrUpperCaseIdentifiers": {
"allowedPrefixes": ["opt_"],
"allExcept": ["var_args"]
},
"maximumLineLength": {
"value": 80,
"allExcept": ["comments", "regex"]
Expand Down
5 changes: 5 additions & 0 deletions test/data/options/preset/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ var opts = nopt({
version: Boolean
});

// requireCamelCaseOrUpperCaseIdentifiers
function test(opt_test) {
var var_args = arguments;
}

// disallowMultipleLineBreaks
// disallowMultipleVarDecl
var insight = new Insight({
Expand Down

0 comments on commit 63db340

Please sign in to comment.