Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore jshint directives #74

Closed
bernharduw opened this issue Nov 26, 2012 · 8 comments
Closed

Ignore jshint directives #74

bernharduw opened this issue Nov 26, 2012 · 8 comments

Comments

@bernharduw
Copy link

directives for jshint should be ignored:

  /*jshint latedef:false */
  var define = require('amdefine')(module);

results in

{
    "tags": [],
    "description": {
      "full": "<p>shint latedef:false</p>",
      "summary": "<p>shint latedef:false</p>",
      "body": ""
    },
    "ignore": false,
    "code": "var define = require('amdefine')(module);\n}\n\n\ndefine(function (require) {\n\t'use strict';\n\tvar _ = require('underscore');\n\t\n\tvar type = function(typename,
 required, options) {\n\t\t\tvar t = {type: typename};\n\t\t\tif (required) {\n\t\t\t\tt.required = true;\n\t\t\t}\n\t\t\treturn _.extend(t, options);\n\t};\n\t\n\tvar combine = 
function(",
    "ctx": {
      "type": "declaration",
      "name": "define",
      "value": "require('amdefine')(module)",
      "string": "define"
    }
  }

Those directives should really be treated as regular code. JSHint does not allow a space between the comment start and jshint or global:

ok: /*jshint latedef:false */, /*global console:true */
not recognized by jshint: /* jshint onevar:false */

@phun-ky
Copy link

phun-ky commented Jan 30, 2013

👍

@tj
Copy link
Owner

tj commented Jan 30, 2013

haha sounds reasonable :D

@shannonmoeller
Copy link

👍

1 similar comment
@jmendiara
Copy link

👍

rf pushed a commit to rf/dox that referenced this issue Jun 6, 2014
rf pushed a commit to rf/dox that referenced this issue Jun 6, 2014
@yangit
Copy link

yangit commented Aug 23, 2014

@evindor evindor closed this as completed in e759663 Sep 4, 2014
@tregusti
Copy link

tregusti commented Oct 4, 2014

This is still an issue with /*global thingie*/. It becomes lobal thingie. Personally I think dox should ignore anything not starting with /** and ending with */.

@Twipped
Copy link
Collaborator

Twipped commented Oct 4, 2014

Are you certain that you are using version 0.5.1?

The test .parseComments() code with a multi-line comment on a single line test specifically checks for that style of comment, and the test is passing correctly. I even changed it specifically to /*global thingie*/ to confirm, and intentionally broke the test to make sure that it wasn't falsely passing.

@tregusti
Copy link

tregusti commented Oct 5, 2014

I'm sorry. I was not. I tried with grunt-doxx, that depended on doxx, that depended on dox ~0.4.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants