Questions tagged [gjslint]

Npm package to work with Grunt which validate files with Google Closure Linter.

11 questions
1282
votes
8 answers

What is "Linting"?

PHPLint, JSLint, and I recently came across "you can lint your JS code on the fly" while reading something about some IDE. So, what is "linting"?
Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68
16
votes
4 answers

why "Single-quoted string preferred over double-quoted string." in js?

While using gjslint, I got a hint: "Single-quoted string preferred over double-quoted string". So why? I'm a little confused with this. Why single-quoted preferred? Hope to get some help. Thanks all.
Lynn
  • 665
  • 8
  • 25
3
votes
1 answer

Why is it that "Member must not have @private JsDoc"?

I'm cleaning up my code with the gjslint tool from Google Closure Tools. It is reporting the following error: Line 15, E:0222: Member "this._dictionary" must not have @private JsDoc And this is the code: /** * Stacker class. * @constructor *…
1
vote
0 answers

Is there a way to lint only modified part in a .js file before git commit?

I will maintain a old project and I must check self commited code with some lint tool, such as eslint or gjslint. If simply run gjslint or eslint for a .js file, I will get all the lint error... I don't want to chang the old part which no bug with…
Icove
  • 11
  • 2
1
vote
1 answer

Does GIT cache pre-commit hooks

Due to gJSLint spewing out errors because of missing member documentation. We updated our pre-commit hook tasked with linting JavaScript. The edit included gJSLint rule 220 (ignore missing member documentation). However when performing a commit…
Ben Crowhurst
  • 8,204
  • 6
  • 48
  • 78
1
vote
1 answer

why "Optional parameter name %s must be prefixed with opt_." in gjslint --strict mode?

I get the following on one particular javascript file Line 23, E:0233: Optional parameter name category must be prefixed with opt_. Line 649, E:0233: Optional parameter name animate must be prefixed with opt_. Line 697, E:0233: Optional parameter…
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
0
votes
2 answers

how do I know what version of gjslint I have installed?

This may be a dumb question, but I cannot figure it out. Doing gjslint --help does not provide the answer, and --version is not a valid flag. Any ideas?
pocketfullofcheese
  • 8,427
  • 9
  • 41
  • 57
0
votes
1 answer

Why does running Google JavaScript Linter via Grunt fail?

We use gjslinter with Grunt to lint all the js files in our project. The configuration in Gruntfile.js looks like this: gjslint: { options: { flags: ['--disable 220,110,200'], reporter: { name: 'gjslint_xml', …
Timo Ernst
  • 15,243
  • 23
  • 104
  • 165
0
votes
0 answers

gjslint not reporting any error on file without jsdoc whatsoever

I read somewhere that with jsdoc in your JavaScript and the google closure tool gjslint you can strongly type your javascript. It's not really strongly typed but the tool will report on uncommented variables and or parameters. Here is the test…
HMR
  • 37,593
  • 24
  • 91
  • 160
0
votes
1 answer

Is it possible to check function arguments by google closure linter (gjslint) tool?

For example, I have the following script "test.js": /** * Adds two numbers. * @param {number} a First number. * @param {number} b First number. * @return {number} Sum of two numbers. */ function add(a, b) { return a + b; } var sum = add(1,…
user607854
  • 85
  • 1
  • 5
0
votes
1 answer

jslint - jslint4java - how to skip checking Required Blocks condition in javascript

I must use a condition like this in my Javascript code if (condition) statement; but it returns an error (" Expected '{' and instead saw ' '. ") while validating using jslint4java. Is there is any way to skip this checking?
Akhil
  • 1
  • 1