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
78
votes
3 answers

Is there any way for jscs to ignore rules per file, block or line?

I'm looking for a way for jscs (JavaScript Code Style) do the same behavior as jshint to ignore certain rules per file with a comment at the top, or per line, with a start and end comment. jshint example to ignore a specific rule in the file : /*…
fernandopasik
  • 9,565
  • 7
  • 48
  • 55
26
votes
4 answers

How can I configure Web Essentials 2013 to ignore files?

I have a fresh MVC 5.1 web app project in VS 2013 (Update 1) w/ Web Essential 2013 (latest as of today) installed. After building the project, Web Essentials scans for javascript files and post messages to the output window for any issues it finds.…
Jim Lamb
  • 25,355
  • 6
  • 42
  • 48
25
votes
3 answers

How can I disable JSCS in Web Essentials for Visual Studio 2013?

How might I disable JSCS in the latest version of Web Essentials for Visual Studio 2013? I was unable to find a relevant option in the menu. I tried setting the JSCS configuration to ignore all files. This caused it to occasionally generate messages…
Keen
  • 954
  • 12
  • 19
9
votes
2 answers

How can I integrate jscs autofix feature into vim?

I'm trying to get a command I can run within vim to get jscs auto correct formatting issues in my code. So far I've come up with : :nmap :!jscs -x . which is ok, but it runs it on the entire directory and I need to confirm to vim that I…
Will Munn
  • 7,363
  • 4
  • 27
  • 32
8
votes
1 answer

Why should I use let instead of const inside functions?

I add linters for js (es6) in my project, and for new configurations I found that they prevent using const inside functions - only for module-level constants. And inside functions I should use let. But I can't find any ground for such rule. Why? For…
Vasiliy vvscode Vanchuk
  • 7,007
  • 2
  • 21
  • 44
8
votes
3 answers

gulp-jscs Object.keys called on non-object

I'm a novice at gulp, and trying to play with it. I get this error when I try to use gulp-jscs 'default' errored after 98 ms [16:58:00] TypeError: Object.keys called on non-object at Function.keys (native) at…
Khaled Karam
  • 173
  • 1
  • 4
  • 13
7
votes
3 answers

Node/NPM/Grunt failing on jscs (grunt-jscs)

I have a grunt task that runs JSCS on a javascript code base and it was working until it came time to integrate with the build server which is using latest, stable versions of grunt, npm/node. This all ran fine under npm 1.XX.X but after i upgraded…
O'Mutt
  • 1,557
  • 1
  • 13
  • 27
7
votes
1 answer

gulp-jscs autofix doesn't work

I have the following code in my gulpfile.js gulp.src(['server.js']) .pipe(jscs({fix: true})) .pipe(gulp.dest('prod-app')); But in prod-app/server.js is the same file as server.js. Without any fixes. How to fix it?
Gregory Leleytner
  • 159
  • 1
  • 1
  • 7
7
votes
1 answer

Linting Promises in Javascript

I am looking to standardize the use of Q promises in my team's codebase. Are there any good jscs extensions (or other linters) to help enforce style when it comes to promises? We would like our promises to follow this form: promise() .then() …
Jeff
  • 2,425
  • 1
  • 18
  • 43
6
votes
2 answers

Unsupported jsdoc rule fix

Using the .jsrc file, I'm getting the following error for my server/front-end files. It's throwing an error at the top of my files. How can I suppress this? Unsupported rule: fix at js/server.js : 1 |'use strict'; Unsupported rule: fix at…
cusejuice
  • 10,285
  • 26
  • 90
  • 145
5
votes
0 answers

TSLint - Require Spaces Inside Array Brackets

Is it possible to enforce spaces inside array brackets, functions, if, for, switch, and object literals in TSLint just like we can do with JSCS? For example: const list = [ 1, 2, 3 ]; console.debug( list[ 1 ]; ); function foo ( a, b, c ) { …
darksoulsong
  • 13,988
  • 14
  • 47
  • 90
5
votes
1 answer

JSCS process timeout in Webstorm

I often get the following error in Webstorm when working with a .jscs file. JSCS: JSCS process timeout What does that mean? Normally, if my Javascript code fails the style checks, I get error marks and it is shown what is not correct. But this…
uloco
  • 2,283
  • 4
  • 22
  • 37
5
votes
1 answer

JSCS: Operator should stick to following expression

I keep receiving the following error, and I am unable to find documentation on what it means. I know it involves strict javascript formatting, and I was wanting to resolve it by abiding by the formating. JSCS: Operator / should stick to following…
Joseph Casey
  • 1,283
  • 1
  • 14
  • 34
5
votes
1 answer

Tool for checking codestyle in JSX files

There are exists many beautiful code formatting tools for vanilla Javascript. For example, JSCS. Is there any tool that can validate and format reactjs templates? I have got error like that one at this moment Unexpected token < at…
Alexey B.
  • 11,965
  • 2
  • 49
  • 73
4
votes
1 answer

How to get gulp-jshint to ignore folders

I have the following folder structure within a solution that I have inherited .\gulp.config.js .\gulpfile.js .\.jscsrc .\.jshintrc .\default.js .\Resources\js\main.js .\Resources\js\modules\ various user created js files .\Resources\js\vendor\ …
Darren Guy
  • 1,123
  • 2
  • 13
  • 39
1
2 3 4 5 6