jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

TypeError: Cannot read property 'offset' of undefined #2247

Closed ghost closed 8 years ago

ghost commented 8 years ago

internalError: Error running rule jsDoc: This is an issue with JSCS and not your codebase. Please file an issue (with the stack trace below) at: https://github.com/jscs-dev/node-jscs/issues/new TypeError: Cannot read property 'offset' of undefined at Object.enforceExistence (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc\enforce-existence.js:116:65) at D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:128:27 at Array.forEach (native) at Object. (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:127:32) at Array.forEach (native) at Object.JsFile.iterateNodesByType (D:\devs\subtitles\node_modules\jscs\lib\js-file.js:331:42) at D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:120:18 at Array.forEach (native) at Object.module.exports.check (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:112:29) at . (D:\devs\subtitles\node_modules\jscs\lib\string-checker.js:154:22) at ./xxx.js : 1 |var assert = require('assert');

markelog commented 8 years ago

/cc @zxqfox

qfox commented 8 years ago

@avighier Can you please provide information about your xxx.js?

ghost commented 8 years ago

Hi,

It was only a test for comments.

the .jscsrc :
{
    "preset": "node-style-guide",
        "jsDoc": {
                "checkAnnotations": "closurecompiler",
                "checkTypes": "strictNativeCase",
                "enforceExistence": "exceptExports"
    }
}
ghost commented 8 years ago

The file is "./subtitle.js"

Its code is here : https://github.com/avighier/subtitles/blob/develop/subtitle.js

ghost commented 8 years ago

Note that I am on Windows and I have not a well configuration. I have tabs instead of space and \r\n for line feed. The tool need, when it will be installed, to fail the build if there is that.

For the moment, the file is like that : "'var assert = require(\'assert\');\r\n\r\n/**\r\n\t@constructor\r\n\t@"

ghost commented 8 years ago

It seems to be that. I have replaced line feed in subtitle.js, now I have :

internalError: Error running rule jsDoc: This is an issue with JSCS and not your codebase. Please file an issue (with the stack trace below) at: https://github.com/jscs-dev/node-jscs/issues/new TypeError: Cannot read property 'offset' of undefined at Object.enforceExistence (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc\enforce-existence.js:116:65) at D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:128:27 at Array.forEach (native) at Object. (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:127:32) at Array.forEach (native) at Object.JsFile.iterateNodesByType (D:\devs\subtitles\node_modules\jscs\lib\js-file.js:331:42) at D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:120:18 at Array.forEach (native) at Object.module.exports.check (D:\devs\subtitles\node_modules\jscs-jsdoc\lib\rules\validate-jsdoc.js:112:29) at . (D:\devs\subtitles\node_modules\jscs\lib\string-checker.js:154:22) at ./subtitles.js : 1 |var Subtitle = require('./subtitle'), --------^ 2 | assert = require('assert'); 3 |

markelog commented 8 years ago

At this point only major and CST related bugs will be fixed.

You however open ticket on https://github.com/jscs-dev/jscs-jsdoc and keep pinging @zxqfox