public
Last active

Use PHP CodeSniffer for static analysis of JavaScript

  • Download Gist
js_sniffs.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?xml version="1.0"?>
<ruleset name="JavaScript">
<description>Run all the sniffs that are applicable to JavaScript files. See https://gist.github.com/3375708</description>
 
<rule ref="Squiz.Operators.ComparisonOperatorUsage"/>
<rule ref="Squiz.ControlStructures.ControlSignature"/>
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
<rule ref="Squiz.PHP.DisallowInlineIf"/>
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<!-- <rule ref="Squiz.Commenting.FileComment"/> -->
<rule ref="Squiz.ControlStructures.ForLoopDeclaration"/>
<!-- <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/> -->
<!-- <rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/> -->
<rule ref="Squiz.Commenting.InlineComment"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.Commenting.LongConditionClosingComment"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<!-- <rule ref="Generic.Formatting.MultipleStatementAlignment"/> -->
<!-- <rule ref="Squiz.Formatting.OperatorBracket"/> -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.Commenting.PostStatementComment"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<rule ref="Squiz.ControlStructures.SwitchDeclaration"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
 
</ruleset>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.