Jslint Missing Property Name

I am using jslint. I have this tolerance setting in my comments.

/*jslint todo: true*/

An online tester transmits it. This happens to me in the part of the code checked earlier. However, later I get this error message:

Missing property name.

Does anyone know why a property name is considered absent in second place and not first?

Update 07/17/2014 15:03 - code included

I was able to isolate the problem using the following code. Below you can see parts of the code if they are running on lint.com and what errors they display:

/**
  * @todo "Unexpected TODO comment".
  */

/*jslint todo: true*/
/**
  * @todo Will be tolerated by jslint.
  */
/*jslint todo: false*/

var obj = {
    /**
      * @todo "Unexpected TODO comment".
      */
};

/*jslint todo: true*/
var obj = {
    /**
      * @todo jslint will tolerate this line.
      */
};
/*jslint todo: false*/

var obj = {
    /*jslint todo: true*/
    /**
      * @todo jslint will never get to this line.
      */
    /*jslint todo: false*/
};

I found that tolerance properties cannot be set inside an object literal. Now I can solve the problem.

, "" . - , , , , ?

+4
1

JSLint , /* */ .

, :

config.output = {
    /*jslint nomen:true*/
    path: __dirname + '/public',
    /*jslint nomen:false*/

    publicPath: BUILD ? '/' : 'http://localhost:8080/',
    filename: BUILD ? '[name].[hash].js' : '[name].bundle.js',
    chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js'
};

, :

/*jslint nomen:true*/
config.output = {
    path: __dirname + '/public',
    publicPath: BUILD ? '/' : 'http://localhost:8080/',
    filename: BUILD ? '[name].[hash].js' : '[name].bundle.js',
    chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js'
};
/*jslint nomen:false*/

, , , , , , .

+1

All Articles