Questions tagged [jscs]

JSCS is a code style checker for JavaScript.

JSCS — JavaScript Code Style.

Notice that lately, it was announced that JSCS is merging with ESLInt.

is a code style checker. You can configure for your project in detail using over 90 validation rules, including presets from popular style guides like jQuery.

Presets

Friendly packages

Extensions

77 questions
2
votes
0 answers

Detect commented-out source code (JS)

I need to eliminate the issue working with multiple teams, that developers constantly check in source that contains commented out code. This is a webapp, .html and .js. Unfortunately locked into SVN, so there is nothing preventing the accumulation…
sibidiba
  • 6,270
  • 7
  • 40
  • 50
1
vote
0 answers

JSCS FIX : Expected end of node list but "CommentBlock" found

I got a new mac recently cloned the repo and installed all the packages. When I run my linter it gives me below error. Expected end of node list but "CommentBlock" found at ./stack/surface/features/stack/ui/kit.js : 1 |// ##…
1
vote
1 answer

How to run JSCS on save only (not on keypress) in Atom?

I'm using https://github.com/AtomLinter/linter-jscs. The docs say: It will lint on edit and/or on save It seems that it lints on edit and save all the time. I don't see a way to configure it to lint on only save.
Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
1
vote
1 answer

How to fix requireShorthandArrowFunctions

How to fix this requireShorthandArrowFunctions arrow function so that it is compliant with JSCS? const doSomething = () => { return new Promise((resolve, reject) => { resolve('success'); }); };
cometta
  • 35,071
  • 77
  • 215
  • 324
1
vote
0 answers

Unable to load JSCS config file

I new in "Gulp". I see this error when I start task with use gulp-jscs (v3.0.0) TypeError: Unable to load JSCS config file Unable to load JSCS config file at Function.keys (native) at copyConfiguration…
1
vote
1 answer

requirePaddingNewLinesAfterUseStrict in ESLint

Now the JSCS project was merged with ESLint and the JSCS linter is deprecated I'm still having a hard time trying to figure out how to replace certain rules. Specifically, JSCS has this rule requirePaddingNewLinesAfterUseStrict that does what the…
Lynn
  • 423
  • 4
  • 10
1
vote
1 answer

How to get Airbnb's JavaScript style eslint guide working in vim with react, es6?

I am fairly new to vim, and starting a new javascript project with editor as vim(currently learning as well). I found that there are some presets for style-guide, and linting provided by Airbnb, Google and some others. I also found that I can use…
WitVault
  • 23,445
  • 19
  • 103
  • 133
1
vote
1 answer

gulp-jscs save report to file

Is there a possibility to run jscs check and using gulp and save report it produces to a file? I want junit style xml files reports saved somewhere. I can do this using direct command line call with > but how to do it using proper gulp?
David
  • 3,190
  • 8
  • 25
  • 31
1
vote
1 answer

Redundant JSDoc @return from an anonymous callback in JavaScript

I am using JSCS with Google preset style rules to check my code and I have a method in a DAO class defined like so: /** * Inserts a new user into database. * * @param {User} user User to insert. * @return {User} Last inserted user. // Redundant…
1
vote
3 answers

jscs error : validateLineBreaks: Invalid line break at filename.js

After grunt-jscs it gives following errors for base/index.js file. Running "jscs:src" (jscs) task validateLineBreaks: Invalid line break at api/v1/base/index.js : 1 |var errors =…
Jagdish Idhate
  • 7,513
  • 9
  • 35
  • 51
1
vote
2 answers

Expected indentation of 4 characters

UPDATE as @dev-null (btw thx a lot :)) suggest (see the comment) the right way is jscs --fix file.js What's the problem with my indentation ? .editorconfig root = true [*] indent_style = space indent_size = 4 end_of_line = lf charset =…
Whisher
  • 31,320
  • 32
  • 120
  • 201
1
vote
1 answer

How to create a JSCS config file on windows

When I try to create a JSCS config file: C:\Blog\BlogWeb>jscs --auto-configure "C:\Blog\BlogWeb\temp.jscs" I get the following error: safeContextKeyword option requires string or array value What parameter am I supposed to pass? What is a…
Hoppe
  • 6,508
  • 17
  • 60
  • 114
1
vote
2 answers

JSCS checks for ngdocs?

Wondering if there are any JSCS checks for ngdocs? Alternatively which documentation framework do you suggest for AngularJS code and the possibility to check if code is documented well? maybe related to this: A 'documentation coverage' of…
cilap
  • 2,215
  • 1
  • 25
  • 51
1
vote
1 answer

Unable to get "disallowSpacesInsideParentheses" to work

My .jscsrc file looks like below { "preset": "wikimedia", "requireSpacesInsideArrayBrackets": null, "validateIndentation": 4, "disallowMultipleVarDecl": true, "disallowSpaceAfterObjectKeys": "ignoreMultiLine", …
Jigar Jain
  • 1,447
  • 1
  • 15
  • 38
1
vote
2 answers

JSCS error: X and Y should have at most 2 line(s) between them at

; and $rootScope should have at most 2 line(s) between them at app/scripts/services/betslipfactory.js : 131 | } 132 | $rootScope.copyLineStatus += '
'; 133 | }); ---------------------^ 134 | 135…
Non
  • 8,409
  • 20
  • 71
  • 123