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
0
votes
0 answers

Allow unnamed function with JSCS

I have a CouchDB map.js file which expects code to be defined within an unnamed function: function(doc){ // do something } Because JSCS expects the function to be named, it says: parseError: Unexpected token ( How can I ignore this error…
Matt
  • 3,483
  • 4
  • 36
  • 46
0
votes
1 answer

Is there an option for jscs and jshint in .jscsrc/.jshintrc to turn off linting for a directory?

I would like to disable linting for all files in a directory For example / some.js <-LINT noLint file1.js <- NO LINT file2.js <- NO LINT subDir file3.js <- NO LINT
Toli
  • 5,547
  • 8
  • 36
  • 56
0
votes
1 answer

Is it possible to use cache for Git pre-commit hook?

I use a pre-commit hook to check code-style and other rules for my project. gulp.task('git-preCommit', ['jscs', 'jshint', 'tslint', 'stylint']); Often this process is long-running. I wonder, is it possible to set some cache for changed files in…
Alerkesi
  • 165
  • 8
0
votes
1 answer

gulp-jscs seems to be unable to detect the config (.jscsrc) file, but normal jscs can from the command line

When I run "gulp style" from the command line, Gulp runs, and, subsequently, gulp-jscs runs, but the latter seems to be unable to detect the rules defined in the jscs config file (.jscsrc). But, if I run jscs from the command line, then jscs does…
Michael P.
  • 1,373
  • 3
  • 12
  • 33
0
votes
1 answer

Specify specific amount of line breaks in JSCS or ESLint

JSCS has a disallowMultipleLineBreaks rule. This asserts that there is no more than 1 line break between statements in JavaScript. I would like to allow 2 line breaks between method declarations, but no more than 2. I'd also like to disallow more…
james_womack
  • 10,028
  • 6
  • 55
  • 74
0
votes
0 answers

How to set up JSCS/JSHINT rule to invalid code with reserved keywords?

I need to check my JavaScript code for validity using JSCS/JSHINT. I need to invalidate my code if a "reserved keywords" is present example. require([ ], function ( ) { var model = { delete: function () { alert('hello!') …
GibboK
  • 71,848
  • 143
  • 435
  • 658
0
votes
1 answer

JSCS hangs when excludeFiles property added to .jscsrc

I installed istanbul to catch coverage on my tests, which started to cause jscs to throw a lot of errors on the coverage directory. I tried putting "excludeFiles": ["coverage/**", "test/fixtures/**"] into my .jscsrc file but now that is causing…
realisation
  • 475
  • 6
  • 19
0
votes
1 answer

How to select commands based on file syntax in Sublime Text

I spent way too much time working out exactly how to override a particular code formatting tool in favor of another one when editing JavaScript, but leaving the other one in place for formatting HTML and CSS. I didn't find any complete instructions…
shanemgrey
  • 2,280
  • 1
  • 26
  • 33
0
votes
1 answer

How do I disallow tabs in JavaScript via jshint or jscs?

I'm setting up enforcement of style rules for a JavaScript project and I'd like to disallow tabs in files altogether (favoring two spaces per indent level). The only related jscs option I've found is disallowMixedSpacesAndTabs, which doesn't…
Mike Ottum
  • 1,361
  • 1
  • 12
  • 20
0
votes
1 answer

JsHint {a} is not defined

I need to disable rule 117 for JsHint for a specific line, at the moment I am using /*jshint -W117 */ with no success. Any idea how to fix it? _createDom: function () { //jscs:disable maximumLineLength var template = ''; …
GibboK
  • 71,848
  • 143
  • 435
  • 658
0
votes
1 answer

what's the equivalent of jscs `disallowKeywordsOnNewLine` in eslint?

what's the equivalent of jscs's disallowKeywordsOnNewLine in eslint? I can't find it in the docs :( disallowKeywordsOnNewLine Disallows placing keywords on a new line. Type: Array Values: Array of quoted keywords Example "disallowKeywordsOnNewLine":…
stevemao
  • 1,423
  • 1
  • 16
  • 29