You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 23, 2024. It is now read-only.
We are using JSCS on our Angular application, but we got some problems with the leadingUnderscoreAccess rule. I let you see the code, JSCS rule and output to see why I say this.
JavaScript demo code:
(function(){angular.module('bug-demo').controller('DemoController',DemoController);DemoController.$inject=['$scope','$log'];functionDemoController($scope,$log){$scope.myFunctionWorking=functionmyFunctionWorking(){$scope.$on('bug',_jscsFailsHereWithJsDocRule)/** * Here is the demonstration that JSCS don't find the @private annotation * * @private **/function_jscsFailsHereWithJsDocRule(){_jscsWillFailEvenWithAccessAnnotation();}/** * Here is the demonstration that JSCS don't find the @access annotation no more * * @access private **/function_jscsWillFailEvenWithAccessAnnotation(){$log.debug('JSCS will report innapropriate error here');}}}})();
We are using JSCS on our Angular application, but we got some problems with the
leadingUnderscoreAccessrule. I let you see the code, JSCS rule and output to see why I say this.JavaScript demo code:
.jscrc file used:
{ "disallowEmptyBlocks": true, "disallowKeywords": ["with"], "disallowMixedSpacesAndTabs": true, "disallowMultipleSpaces": true, "disallowPaddingNewlinesInBlocks": true, "disallowQuotedKeysInObjects": "allButReserved", "disallowSpaceAfterObjectKeys": true, "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], "disallowSpaceBeforeComma": true, "disallowSpaceBeforeSemicolon": true, "disallowSpacesInFunctionExpression": { "beforeOpeningRoundBrace": true }, "disallowSpacesInsideArrayBrackets": true, "disallowSpacesInsideParentheses": true, "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], "disallowTrailingWhitespace": true, "jsDoc": { "checkAnnotations": "jsdoc3", "checkParamNames": true, "requireParamTypes": true, "checkRedundantParams": true, "checkReturnTypes": true, "checkRedundantReturns": true, "checkTypes": "capitalizedNativeCase", "checkRedundantAccess": true, "leadingUnderscoreAccess": true, "requireNewlineAfterDescription": true }, "requireCamelCaseOrUpperCaseIdentifiers": "ignoreProperties", "requireCapitalizedConstructors": true, "requireCommaBeforeLineBreak": true, "requireCurlyBraces": ["try", "catch"], "requireDotNotation": true, "requireFunctionDeclarations": true, "requireLineFeedAtFileEnd": true, "requireMultipleVarDecl": true, "requireOperatorBeforeLineBreak": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=", ","], "requireParenthesesAroundIIFE": true, "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ","], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], "requireSpaceBeforeObjectValues": true, "requireSpaceBetweenArguments": true, "requireSpacesInConditionalExpression": true, "requireSpacesInForStatement": true, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInsideObjectBrackets": "all", "requireYodaConditions": true, "validateLineBreaks": "LF", "validateQuoteMarks": "'", "excludeFiles": ["node_modules/**", "bower_components/**", "src/assets/**"], "fileExtensions": [".js"] }Console output – runned with JSCS --verbose:
Running environment: